Jump to content
  • Advertisement
Sign in to follow this  
auto.magician

Help with managed ID3DXMesh during screen mode change

This topic is 2578 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all,

The scenario...

I have a scene with a cube created with D3DXCreateBox. I have also made a quad to use as a plane, using 4 vertices and 2 triangles created with D3DXCreateMeshFVF using the D3DXMESH_MANAGED flag with the appropriate other parameters filled in as necessary. The cube and the plane show up OK while in the initial created mode, but as soon as I change modes( windowed/fullscreen) the program crashes when it comes to rendering the plane.

In my code (now test code) I have the same effect loaded ( uses the exact same code for loading the effect for both meshes ) for the cube and the plane although they are different instances now. Each mesh will only render if the Effect is not NULL ( again,.. testing code ). If I create the effect for the cube ONLY so the plane doesnt render with its instance of the effect, then the scene will survive correctly through the changing from window to fullscreen and back again. But when I include the plane in the scene, the program crashes with EAV which I take as telling me that something needs to managed during the change, even though I've created the plane using the D3DXMESH_MANAGED flag.
Could it be the way I'm creating the vertices and indices?? using the DISCARD flag or is there something I'm completely missing?

In my code I have a 'Mesh' class ( the cube and plane use this same class ) which contains a variable to the instance of the Effect that it uses, there are callback methods that get called during device reset phase to manage its appropriate resources. In these methods I call ID3DXEffect.OnLostDevice and ID3DXEffect.OnResetDevice correctly. Like I say the 'CUBE' survives with no problems, but the 'PLANE' is causing an issue. The only difference between the two ( including creation and rendering ) is the creation phase.
Any ideas/help is greatly appreciated.


Many thanks

Dave

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!