From 0d2faa1cabe8bd51d7fa819c0475dd9754f46f2a Mon Sep 17 00:00:00 2001 From: vladislavbelov Date: Fri, 25 Feb 2022 16:26:56 +0000 Subject: [PATCH] Adds debug context option for GL context creation. This was SVN commit r26484. --- binaries/data/config/default.cfg | 1 + source/ps/VideoMode.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/binaries/data/config/default.cfg b/binaries/data/config/default.cfg index acbfe95031..5824892984 100644 --- a/binaries/data/config/default.cfg +++ b/binaries/data/config/default.cfg @@ -119,6 +119,7 @@ cursorbackend = "sdl" rendererbackend = "gl" ; Enables additional debug information in renderer backend. +renderer.backend.debugcontext = "false" renderer.backend.debugmessages = "false" renderer.backend.debuglabels = "false" renderer.backend.debugscopedlabels = "false" diff --git a/source/ps/VideoMode.cpp b/source/ps/VideoMode.cpp index 465c4269b8..86936fc182 100644 --- a/source/ps/VideoMode.cpp +++ b/source/ps/VideoMode.cpp @@ -407,6 +407,11 @@ bool CVideoMode::InitSDL() SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); + bool debugContext = false; + CFG_GET_VAL("renderer.backend.debugcontext", debugContext); + if (debugContext) + SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_DEBUG_FLAG); + bool forceGLVersion = false; CFG_GET_VAL("forceglversion", forceGLVersion); if (forceGLVersion)