Perform proper Reset sequence.

Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@815 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 4ccb8b5e
...@@ -457,15 +457,19 @@ bool Display::createDevice() ...@@ -457,15 +457,19 @@ bool Display::createDevice()
bool Display::resetDevice() bool Display::resetDevice()
{ {
D3DPRESENT_PARAMETERS presentParameters = getDefaultPresentParameters(); D3DPRESENT_PARAMETERS presentParameters = getDefaultPresentParameters();
HRESULT result; HRESULT result = mDevice->TestCooperativeLevel();
do while (result == D3DERR_DEVICELOST)
{ {
Sleep(0); // Give the graphics driver some CPU time Sleep(100); // Give the graphics driver some CPU time
result = mDevice->TestCooperativeLevel();
}
if (result == D3DERR_DEVICENOTRESET)
{
result = mDevice->Reset(&presentParameters); result = mDevice->Reset(&presentParameters);
} }
while (result == D3DERR_DEVICELOST);
if (FAILED(result)) if (FAILED(result))
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment