EFileTahi-A Posted June 4, 2005 Posted June 4, 2005 (edited) My directX dveice is set to be rendered into a panel control. This works fine as long I don't resize the panel. If I change the panels size it does give this error: "An unhandled exception of type 'System.NullReferenceException' occurred in microsoft.directx.direct3dx.dll Additional information: Object reference not set to an instance of an object". When executing the following code: sprite.Draw(dxTexture[VAR.iTag], textureSize, new Vector3(0, 0, 0), new Vector3(0,0,0), Color.White); Why on earth the sprite.draw stops working when I change the panels size?! The dxTexture[] have a texture (it's not null), the textureSize is correctly set... Edited June 4, 2005 by EFileTahi-A Quote
EFileTahi-A Posted June 4, 2005 Author Posted June 4, 2005 I discovered the problem. Instead of loading the textures into the texture[] like this; c_DirectX.dxTexture[iCounter] = TextureLoader.FromFile(c_DirectX.dxDevice, sCurrentFile, 0, 0, D3DX.Default, 0, Format.Unknown, Pool.Pool, Filter.None, Filter.None, Color.Blue.ToArgb()); I needed to change the Pool.Pool to Pool.Managed :D - THREAD CLOSED - Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.