Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (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 by EFileTahi-A
Posted

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 -

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...