Sign in to follow this  
_Flecko

device.Reset() problems

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this