video: Respect SDL_HINT_OPENGL_FORCE_SRGB_CAPABLE with GL_FRAMEBUFFER_SRGB.

Reference Issue #14898.

(cherry picked from commit 9f5747ccd4)
This commit is contained in:
Ryan C. Gordon
2026-02-06 13:53:16 -05:00
parent 027183f89c
commit 88bbc94921

View File

@@ -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);