From 1cab428e6eb78622189c1d0d547fab959aad0c05 Mon Sep 17 00:00:00 2001 From: Ralph Sennhauser Date: Sat, 23 May 2026 08:18:17 +0200 Subject: [PATCH] Drop vsync workaround for wxWidgets wxWidgets already sets it's prefered mode. Signed-off-by: Ralph Sennhauser --- source/lib/ogl.cpp | 15 --------------- source/lib/ogl.h | 7 +------ source/renderer/backend/gl/Device.cpp | 6 ------ 3 files changed, 1 insertion(+), 27 deletions(-) diff --git a/source/lib/ogl.cpp b/source/lib/ogl.cpp index aaf6b71c25..a38110b4ab 100644 --- a/source/lib/ogl.cpp +++ b/source/lib/ogl.cpp @@ -449,18 +449,3 @@ bool ogl_Init(void* (load)(const char*)) return true; } - - -void ogl_SetVsyncEnabled(bool enabled) -{ - [[maybe_unused]] const int interval = enabled ? 1 : 0; -#if !CONFIG2_GLES && OS_WIN - if (ogl_HaveExtension("WGL_EXT_swap_control")) - wglSwapIntervalEXT(interval); -#elif !CONFIG2_GLES && !OS_MACOSX -#if defined(SDL_VIDEO_DRIVER_X11) - if (GLXVersion && ogl_HaveExtension("GLX_SGI_swap_control")) - glXSwapIntervalSGI(interval); -#endif -#endif -} diff --git a/source/lib/ogl.h b/source/lib/ogl.h index a05c71ab59..23b98a37b6 100644 --- a/source/lib/ogl.h +++ b/source/lib/ogl.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 Wildfire Games. +/* Copyright (C) 2026 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -52,11 +52,6 @@ extern bool ogl_Init(void* (load)(const char*), void* display, int subsystem); extern bool ogl_Init(void* (load)(const char*)); #endif -/** - * Change vsync state. - **/ -extern void ogl_SetVsyncEnabled(bool enabled); - //----------------------------------------------------------------------------- // extensions diff --git a/source/renderer/backend/gl/Device.cpp b/source/renderer/backend/gl/Device.cpp index 3a7c63c3d1..c6db23ee49 100644 --- a/source/renderer/backend/gl/Device.cpp +++ b/source/renderer/backend/gl/Device.cpp @@ -313,12 +313,6 @@ std::unique_ptr CDevice::Create(SDL_Window* window) ogl_Init(SDL_GL_GetProcAddress); #endif -#if OS_WIN || defined(SDL_VIDEO_DRIVER_X11) && !CONFIG2_GLES - // Hack to stop things looking very ugly when scrolling in Atlas. - ogl_SetVsyncEnabled(true); -#endif - } - if (!ogl_HaveVersion(2, 0) || !ogl_HaveExtension("GL_ARB_vertex_buffer_object") || ogl_HaveExtensions(0, "GL_ARB_multitexture", "GL_EXT_draw_range_elements", nullptr)