Jump to content
  • Advertisement
Sign in to follow this  
_Flecko

device.Reset() problems

This topic is 4889 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

I'm getting an InvalidCallException when I try to use device.Reset, and having trouble figuring out why. To test it I created a simple application that just creates a vertex buffer with 3 vertices in it. I found that if I draw the vertex buffer in my render loop using the code:
device.SetStreamSource(0,vb,0);
device.VertexFormat=CustomVertex.PositionColoredTextured.Format;
device.DrawPrimitives(PrimitiveType.TriangleList,0,1);

then the exception happens, but otherwise everything is fine. Does anyone know how drawing it would make a difference as to whether the device can reset?

Share this post


Link to post
Share on other sites
Advertisement
Are you releasing the vertex buffer before you call reset? You need to release all video memory objects, call reset, then restore them. You have to release video-device type objects, even if they are totally stored in system memory.

Share this post


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

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!