From 88bbc9492169e3cc98bf7e46a506b6684fcc0400 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 6 Feb 2026 13:53:16 -0500 Subject: [PATCH] video: Respect SDL_HINT_OPENGL_FORCE_SRGB_CAPABLE with GL_FRAMEBUFFER_SRGB. Reference Issue #14898. (cherry picked from commit 9f5747ccd42525f11b3c6bcae5c30047667512d3) --- src/video/SDL_video.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 92120b67d7..d4508702a8 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -5410,7 +5410,11 @@ SDL_GLContext SDL_GL_CreateContext(SDL_Window *window) return NULL; } - const bool srgb_requested = (_this->gl_config.framebuffer_srgb_capable > 0); + bool srgb_requested = (_this->gl_config.framebuffer_srgb_capable > 0); + const char *srgbhint = SDL_GetHint(SDL_HINT_OPENGL_FORCE_SRGB_CAPABLE); + if (srgbhint && *srgbhint) { + srgb_requested = SDL_GetStringBoolean(srgbhint, false); + } ctx = _this->GL_CreateContext(_this, window);