Module: wine Branch: master Commit: 3441ba9e039521d38be0d8bdad8eca55393e3a0b URL: http://source.winehq.org/git/wine.git/?a=commit;h=3441ba9e039521d38be0d8bdad...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Wed Aug 2 18:40:34 2017 +0200
wined3d: Properly update the context when falling back to the backup window in context_set_gl_context().
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/wined3d/context.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index f9c95ba..d8ec251 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -1178,8 +1178,6 @@ static BOOL context_set_gl_context(struct wined3d_context *ctx)
if (backup || !wglMakeCurrent(ctx->hdc, ctx->glCtx)) { - HDC dc; - WARN("Failed to make GL context %p current on device context %p, last error %#x.\n", ctx->glCtx, ctx->hdc, GetLastError()); ctx->valid = 0; @@ -1196,24 +1194,27 @@ static BOOL context_set_gl_context(struct wined3d_context *ctx) return FALSE; }
- if (!(dc = swapchain_get_backup_dc(swapchain))) + if (!(ctx->hdc = swapchain_get_backup_dc(swapchain))) { context_set_current(NULL); return FALSE; }
- if (!context_set_pixel_format(ctx, dc, TRUE, ctx->pixel_format)) + ctx->hdc_is_private = TRUE; + ctx->hdc_has_format = FALSE; + + if (!context_set_pixel_format(ctx, ctx->hdc, TRUE, ctx->pixel_format)) { ERR("Failed to set pixel format %d on device context %p.\n", - ctx->pixel_format, dc); + ctx->pixel_format, ctx->hdc); context_set_current(NULL); return FALSE; }
- if (!wglMakeCurrent(dc, ctx->glCtx)) + if (!wglMakeCurrent(ctx->hdc, ctx->glCtx)) { ERR("Fallback to backup window (dc %p) failed too, last error %#x.\n", - dc, GetLastError()); + ctx->hdc, GetLastError()); context_set_current(NULL); return FALSE; }