Share this post

Link to post

Share on other sites

Have you checked the return code of Reset()? If it is failing, it will probably give you a hint on what's going wrong.

If Reset() is not failing, then you could try forcing the transforms, render, texture and sampler states as you did when creating the device to make sure the device is in the right state before starting rendering again.

Share this post

Link to post

Share on other sites

You have to free all non-managed textures, vertex buffers, state blocks, etc that are in use, Reset, then recreate those resources. Anything not in POOL_MANAGED needs destroying and recreating. If you use the debug runtimes the output window should list each resource you've missed.

You'll notice the D3D samples all have InvalidateDevice and RestoreDevice member functions. These are for the freeing and recreating of resources. The font system you're using likely has calls for this, if they're necessary.

You should also check for DEVICELOST. In this case you don't reset or render, just sit back and processing more windows messages until you get DEVICENOTRESET. This ensures that you don't suck all the performance away from other apps when you should be in the background, awaiting your turn.