First,
This should be posted in the DirectX Forum.
Quote:Original post by cobru
you have to Release() and recreate all resources which are allocated in video memory (D3DPOOL_DEFAULT) before Reset()-ing the device, otherwise the Reset() fails.
This is not true. You should recreate your resources (in the default pool after you reset your device) as you are doing. Textures and the buffers created in a managed/sysmem/or dynamic pool do not need to be released and recreated on a lost device.
Quote:Original post by cobru we found out that if you use D3DXFont you must also destroy and recreate it (because internally it allocates some resources in video memory).
This is very true. And if you use an ID3DXSprite to speed up font rendering then you must release that. Though, for the font and sprite you call
onlostdevice and onresetdevice I would not call TestCooperativeLevel in a loop as suggested above. And definitely don't test for equality with D3DERR_OK. Your method looks fine. As long as it is in a function that is getting called each frame or so then you should be able to recover from it eventually.
Quote:The release and recreate functions basicly release or recreate all vertex and indexbuffers and the textures.
You should also release the active swapchain, backbuffer and depthstencil before resetting and then recreate them after the device is restored.
You should also be doing what Endurion suggests. You can load the DX debug symbols, use the debug library (via DX control panel) and set the output to max and watch. You will get some help with that.
Hope tihs helps.