• Advertisement
Sign in to follow this  

device.Reset() problems

This topic is 4650 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
Alternatively, you could create all your resources in the managed pool.

Share this post


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

  • Advertisement