From 4e34c771e4f8928cbbf70994eec27229e3120288 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 11 Jul 2025 18:25:14 -0400 Subject: [PATCH] Revert "windows: Use wglSwapLayerBuffers if available." This reverts commit b8ee44ca6a0559a509f8d58b466d995c2669cb71. This is reverting a cherry-pick. It's probably too risky for a 3.2.x release, but we'll let it marinate on main, for 3.4.0. --- src/video/windows/SDL_windowsopengl.c | 13 ++----------- src/video/windows/SDL_windowsopengl.h | 2 -- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/video/windows/SDL_windowsopengl.c b/src/video/windows/SDL_windowsopengl.c index 4588e2531c..c458796044 100644 --- a/src/video/windows/SDL_windowsopengl.c +++ b/src/video/windows/SDL_windowsopengl.c @@ -141,9 +141,6 @@ bool WIN_GL_LoadLibrary(SDL_VideoDevice *_this, const char *path) SDL_LoadFunction(handle, "wglMakeCurrent"); _this->gl_data->wglShareLists = (BOOL (WINAPI *)(HGLRC, HGLRC)) SDL_LoadFunction(handle, "wglShareLists"); - _this->gl_data->wglSwapLayerBuffers = (BOOL (WINAPI *)(HDC, UINT)) - SDL_LoadFunction(handle, "wglSwapLayerBuffers"); - /* *INDENT-ON* */ // clang-format on #if defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES) @@ -889,14 +886,8 @@ bool WIN_GL_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window) { HDC hdc = window->internal->hdc; - if (_this->gl_data->wglSwapLayerBuffers) { - if (!_this->gl_data->wglSwapLayerBuffers(hdc, WGL_SWAP_MAIN_PLANE)) { - return WIN_SetError("wglSwapLayerBuffers()"); - } - } else { - if (!SwapBuffers(hdc)) { - return WIN_SetError("SwapBuffers()"); - } + if (!SwapBuffers(hdc)) { + return WIN_SetError("SwapBuffers()"); } return true; } diff --git a/src/video/windows/SDL_windowsopengl.h b/src/video/windows/SDL_windowsopengl.h index 7d6abece1f..23e2f3a58f 100644 --- a/src/video/windows/SDL_windowsopengl.h +++ b/src/video/windows/SDL_windowsopengl.h @@ -85,8 +85,6 @@ struct SDL_GLDriverData BOOL (WINAPI *wglGetPixelFormatAttribivARB)(HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues); BOOL (WINAPI *wglSwapIntervalEXT)(int interval); int (WINAPI *wglGetSwapIntervalEXT)(void); - BOOL (WINAPI *wglSwapLayerBuffers)(HDC hdc, UINT flags); - #if defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES) BOOL (WINAPI *wglSwapBuffers)(HDC hdc); int (WINAPI *wglDescribePixelFormat)(HDC hdc,