mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-25 01:57:47 +01:00
retry wglMakeCurrent up to 5 times on failure
This commit is contained in:
parent
f2f6ffe69f
commit
9bd6cb9cc8
@ -54,12 +54,14 @@ DWORD WINAPI ogl_render_main(void)
|
|||||||
Sleep(250);
|
Sleep(250);
|
||||||
g_ogl.got_error = g_ogl.use_opengl = FALSE;
|
g_ogl.got_error = g_ogl.use_opengl = FALSE;
|
||||||
|
|
||||||
BOOL made_current = xwglMakeCurrent(g_ogl.hdc, g_ogl.context);
|
BOOL made_current = FALSE;
|
||||||
if (!made_current)
|
|
||||||
|
for (int i = 0; i < 5; i++)
|
||||||
{
|
{
|
||||||
/* make sure we retry at least once */
|
if ((made_current = xwglMakeCurrent(g_ogl.hdc, g_ogl.context)))
|
||||||
|
break;
|
||||||
|
|
||||||
Sleep(50);
|
Sleep(50);
|
||||||
made_current = xwglMakeCurrent(g_ogl.hdc, g_ogl.context);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (made_current && glGetError() == GL_NO_ERROR)
|
if (made_current && glGetError() == GL_NO_ERROR)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user