Don't call into SwapBuffers if no window is associated with the DC

This commit is contained in:
baldurk
2015-09-18 23:26:11 +02:00
parent 1b8d291874
commit 4242c12226
+7 -4
View File
@@ -523,12 +523,15 @@ class OpenGLHook : LibraryHook
{
HWND w = WindowFromDC(dc);
RECT r;
GetClientRect(w, &r);
if(w != NULL)
{
RECT r;
GetClientRect(w, &r);
glhooks.GetDriver()->WindowSize(w, r.right-r.left, r.bottom-r.top);
glhooks.GetDriver()->WindowSize(w, r.right - r.left, r.bottom - r.top);
glhooks.GetDriver()->SwapBuffers(w);
glhooks.GetDriver()->SwapBuffers(w);
}
return glhooks.SwapBuffers_hook()(dc);
}