summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorErik Faye-Lund <erik.faye-lund@collabora.com>2020-05-05 13:51:04 +0200
committerErik Faye-Lund <erik.faye-lund@collabora.com>2020-05-07 21:56:35 +0200
commit5b7b7975e656fa93e3aa35585fc285676a476192 (patch)
tree480ed95fd029455a507a4ef204e5e8b2da558459 /src
parent17d959043d768dff67c7872406ef6886008c9428 (diff)
Revert "wglgears: do not re-create window after re-creating context"
This fix wasn't a great idea; even if it seems to work fine on modern Windows versions, the documentation says that SetPixelFormat can only be set once per window. And worse, Mesa's OpenGL32.DLL emulation code seems to depend on this, ignoring any consecutive calls. This means that with Mesa, we get no multisampling here. So, let's revert this, and instead follow what the docs say. This reverts commit 27813895adef5866e9aee62975c7f5965cd9c601. Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src')
-rw-r--r--src/wgl/wglgears.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/wgl/wglgears.c b/src/wgl/wglgears.c
index 49e3b611..5769c07e 100644
--- a/src/wgl/wglgears.c
+++ b/src/wgl/wglgears.c
@@ -486,6 +486,16 @@ make_window(const char *name, int x, int y, int width, int height)
/* now, create new context with new pixel format */
wglMakeCurrent(hDC, NULL);
wglDeleteContext(hRC);
+ DeleteDC(hDC);
+
+ hWnd = CreateWindowEx(dwExStyle, name, name,
+ WS_CLIPSIBLINGS | WS_CLIPCHILDREN | dwStyle,
+ 0, 0,
+ winrect.right - winrect.left,
+ winrect.bottom - winrect.top,
+ NULL, NULL, hInst, NULL);
+
+ hDC = GetDC(hWnd);
SetPixelFormat(hDC, pixelFormat, &pfd);
hRC = wglCreateContext(hDC);
wglMakeCurrent(hDC, hRC);