Commit f57967c9 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Always check the result of wglMakeCurrent().

parent 40565211
......@@ -1073,7 +1073,10 @@ WineD3DContext *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *tar
* but enable it for the first context we create, and reenable it on the old context
*/
if(oldDrawable && oldCtx) {
pwglMakeCurrent(oldDrawable, oldCtx);
if (!pwglMakeCurrent(oldDrawable, oldCtx))
{
ERR("Failed to make previous GL context %p current.\n", oldCtx);
}
} else {
last_device = This;
}
......@@ -1201,7 +1204,11 @@ void DestroyContext(IWineD3DDeviceImpl *This, WineD3DContext *context) {
}
/* Cleanup the GL context */
pwglMakeCurrent(NULL, NULL);
if (!pwglMakeCurrent(NULL, NULL))
{
ERR("Failed to disable GL context.\n");
}
if(context->isPBuffer) {
GL_EXTCALL(wglReleasePbufferDCARB(context->pbuffer, context->hdc));
GL_EXTCALL(wglDestroyPbufferARB(context->pbuffer));
......
......@@ -230,7 +230,10 @@ static void WineD3D_ReleaseFakeGLContext(void) {
if (0 == (--wined3d_fake_gl_context_ref) ) {
if(!wined3d_fake_gl_context_foreign && glCtx) {
TRACE_(d3d_caps)("destroying fake GL context\n");
pwglMakeCurrent(NULL, NULL);
if (!pwglMakeCurrent(NULL, NULL))
{
ERR("Failed to disable fake GL context.\n");
}
pwglDeleteContext(glCtx);
}
if(wined3d_fake_gl_context_hdc)
......@@ -301,7 +304,7 @@ static BOOL WineD3D_CreateFakeGLContext(void) {
/* Make it the current GL context */
if (!pwglMakeCurrent(wined3d_fake_gl_context_hdc, glCtx)) {
WARN_(d3d_caps)("Error setting default context as current for capabilities initialization\n");
ERR_(d3d_caps)("Failed to make fake GL context current.\n");
goto fail;
}
}
......
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