From: Rémi Bernon rbernon@codeweavers.com
With format == 0 if internal pixel format was previously requested.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=58846 --- dlls/wined3d/context_gl.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c index ac1b9370fc1..ad2a50a66f1 100644 --- a/dlls/wined3d/context_gl.c +++ b/dlls/wined3d/context_gl.c @@ -1260,6 +1260,7 @@ success:
static BOOL wined3d_context_gl_set_gl_context(struct wined3d_context_gl *context_gl) { + const struct wined3d_gl_info *gl_info = context_gl->gl_info; struct wined3d_device_gl *device_gl = wined3d_device_gl(context_gl->c.device); BOOL backup = FALSE;
@@ -1286,7 +1287,10 @@ static BOOL wined3d_context_gl_set_gl_context(struct wined3d_context_gl *context return FALSE; }
+ if (context_gl->internal_format_set) + GL_EXTCALL(wglSetPixelFormatWINE(context_gl->dc, 0)); wined3d_release_dc(context_gl->window, context_gl->dc); + if (!(context_gl->dc = wined3d_device_gl_get_backup_dc(device_gl))) { wined3d_context_gl_set_current(NULL); @@ -1332,6 +1336,8 @@ static void context_restore_gl_context(const struct wined3d_gl_info *gl_info, HD
static void wined3d_context_gl_update_window(struct wined3d_context_gl *context_gl) { + const struct wined3d_gl_info *gl_info = context_gl->gl_info; + if (!context_gl->c.swapchain) return;
@@ -1342,7 +1348,11 @@ static void wined3d_context_gl_update_window(struct wined3d_context_gl *context_ context_gl, context_gl->window, context_gl->c.swapchain->win_handle);
if (context_gl->dc) + { + if (context_gl->internal_format_set) + GL_EXTCALL(wglSetPixelFormatWINE(context_gl->dc, 0)); wined3d_release_dc(context_gl->window, context_gl->dc); + }
context_gl->window = context_gl->c.swapchain->win_handle; context_gl->dc_is_private = FALSE; @@ -1542,6 +1552,8 @@ static void wined3d_context_gl_cleanup(struct wined3d_context_gl *context_gl) else if (wglGetCurrentContext() && !wglMakeCurrent(NULL, NULL)) ERR("Failed to disable GL context.\n");
+ if (context_gl->internal_format_set) + GL_EXTCALL(wglSetPixelFormatWINE(context_gl->dc, 0)); wined3d_release_dc(context_gl->window, context_gl->dc);
if (!wglDeleteContext(context_gl->gl_ctx))