Commit 645eb62f authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

wined3d: Create a backup context if setting the pixel format failed in…

wined3d: Create a backup context if setting the pixel format failed in wined3d_context_gl_create_wgl_ctx(). Signed-off-by: 's avatarPaul Gofman <gofmanp@gmail.com> Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent ecad6351
......@@ -2033,9 +2033,27 @@ static BOOL wined3d_context_gl_create_wgl_ctx(struct wined3d_context_gl *context
if (!wined3d_context_gl_set_pixel_format(context_gl))
{
ERR("Failed to set pixel format %d on device context %p.\n", context_gl->pixel_format, context_gl->dc);
context_release(context);
return FALSE;
if (context_gl->dc_is_private)
{
ERR("Failed to set pixel format %d on device context %p.\n", context_gl->pixel_format, context_gl->dc);
return FALSE;
}
WARN("Failed to set pixel format %d on device context %p, trying backup DC.\n",
context_gl->pixel_format, context_gl->dc);
wined3d_release_dc(context_gl->window, context_gl->dc);
if (!(context_gl->dc = wined3d_swapchain_gl_get_backup_dc(swapchain_gl)))
{
ERR("Failed to retrieve the backup device context.\n");
return E_FAIL;
}
context_gl->dc_is_private = TRUE;
return wined3d_context_gl_create_wgl_ctx(context_gl, swapchain_gl);
}
share_ctx = device->context_count ? wined3d_context_gl(device->contexts[0])->gl_ctx : NULL;
......
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