• Advertisement
Sign in to follow this  

DX9 Lost device

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

Hello!

I am really getting lost about a little warning message in my device lost code.
I only call my render method if getState() returns RS_READY:

RS_STATE rsState = mRenderSystem->getState();
if(rsState == RS_READY)
renderOneFrame();

and this is my getState() method:


RS_STATE D3D9RenderSystem::getState() {
HRESULT hr = mDevice->TestCooperativeLevel();

if(FAILED(hr)) {
WindowUtilities::messagePump(); // Keep message loop running
if(hr == D3DERR_DEVICELOST) {
OutputDebugString("Device Lost!\n");
mRoot->getTimer()->pause();
return RS_NOT_READY;
}
if(hr == D3DERR_DEVICENOTRESET) {
//onLostDevice();
OutputDebugString("Device Not Reset!\n");
D3DPRESENT_PARAMETERS defaultPresentParams(mDefaultPresentParams);
hr = mDevice->Reset(&defaultPresentParams);

if(FAILED(hr))
return RS_NOT_READY;

//onResetDevice();
return RS_READY;
}

}

return RS_READY;
}

Nothing special as you can see. Now if I alt+tab from my fullscreen application to windows I periodically get these messages:

Device Lost!
Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails
Device Lost!
Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails
Device Lost!
Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails
[/quote]
What causes this warning and how can I fix it?

Share this post


Link to post
Share on other sites
Advertisement
*bump cause I edited and changed the whole question (but don't want to start a new thread)

Share this post


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

  • Advertisement