From c698f10257afd185429af5300d2e4b4e6c104e17 Mon Sep 17 00:00:00 2001 From: svdijk Date: Mon, 5 Jun 2017 11:41:54 +0200 Subject: [PATCH] Fix setting of the gl_legacy_mode cvar. --- src/gl/system/gl_interface.cpp | 5 ++++- src/gl/system/gl_swframebuffer.cpp | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/gl/system/gl_interface.cpp b/src/gl/system/gl_interface.cpp index e24ac553b2..dcde3f006a 100644 --- a/src/gl/system/gl_interface.cpp +++ b/src/gl/system/gl_interface.cpp @@ -324,7 +324,10 @@ void gl_LoadExtensions() FUDGE_FUNC(glBindRenderbuffer, EXT); FUDGE_FUNC(glCheckFramebufferStatus, EXT); } - gl_legacy_mode = gl.legacyMode; + + UCVarValue value; + value.Bool = gl.legacyMode; + gl_legacy_mode.ForceSet (value, CVAR_Bool); } //========================================================================== diff --git a/src/gl/system/gl_swframebuffer.cpp b/src/gl/system/gl_swframebuffer.cpp index 665b23d385..c0ed432117 100644 --- a/src/gl/system/gl_swframebuffer.cpp +++ b/src/gl/system/gl_swframebuffer.cpp @@ -207,12 +207,15 @@ OpenGLSWFrameBuffer::OpenGLSWFrameBuffer(void *hMonitor, int width, int height, const char *glversion = (const char*)glGetString(GL_VERSION); bool isGLES = (glversion && strlen(glversion) > 10 && memcmp(glversion, "OpenGL ES ", 10) == 0); + UCVarValue value; // GL 3.0 is mostly broken on MESA drivers which really are the only relevant case here that doesn't fulfill the requirements based on version number alone. #ifdef _WIN32 - gl_legacy_mode = !ogl_IsVersionGEQ(3, 0); + value.Bool = !ogl_IsVersionGEQ(3, 0); #else - gl_legacy_mode = !ogl_IsVersionGEQ(3, 1); + value.Bool = !ogl_IsVersionGEQ(3, 1); #endif + gl_legacy_mode.ForceSet (value, CVAR_Bool); + if (!isGLES && ogl_IsVersionGEQ(3, 0) == 0) { Printf("OpenGL acceleration requires at least OpenGL 3.0. No Acceleration will be used.\n");