Преглед изворни кода

hints: Rename SDL_HINT_OPENGL_FORCE_SRGB_CAPABLE.

It's now SDL_HINT_OPENGL_FORCE_SRGB_FRAMEBUFFER, since it does more than mess
with the srgb-capable context attribute now.

Reference Issue #14898.
Ryan C. Gordon пре 2 недеља
родитељ
комит
10b524c7cc

+ 1 - 1
include/SDL3/SDL_hints.h

@@ -3078,7 +3078,7 @@ extern "C" {
  *
  *
  * \since This hint is available since SDL 3.4.2.
  * \since This hint is available since SDL 3.4.2.
  */
  */
-#define SDL_HINT_OPENGL_FORCE_SRGB_CAPABLE "SDL_OPENGL_FORCE_SRGB_CAPABLE"
+#define SDL_HINT_OPENGL_FORCE_SRGB_FRAMEBUFFER "SDL_OPENGL_FORCE_SRGB_FRAMEBUFFER"
 
 
 /**
 /**
  * Mechanism to specify openvr_api library location
  * Mechanism to specify openvr_api library location

+ 1 - 1
src/video/SDL_egl.c

@@ -1291,7 +1291,7 @@ EGLSurface SDL_EGL_CreateSurface(SDL_VideoDevice *_this, SDL_Window *window, Nat
 
 
 #ifdef EGL_KHR_gl_colorspace
 #ifdef EGL_KHR_gl_colorspace
     if (SDL_EGL_HasExtension(_this, SDL_EGL_DISPLAY_EXTENSION, "EGL_KHR_gl_colorspace")) {
     if (SDL_EGL_HasExtension(_this, SDL_EGL_DISPLAY_EXTENSION, "EGL_KHR_gl_colorspace")) {
-        const char *srgbhint = SDL_GetHint(SDL_HINT_OPENGL_FORCE_SRGB_CAPABLE);
+        const char *srgbhint = SDL_GetHint(SDL_HINT_OPENGL_FORCE_SRGB_FRAMEBUFFER);
         if (srgbhint && *srgbhint) {
         if (srgbhint && *srgbhint) {
             if (SDL_strcmp(srgbhint, "skip") == 0) {
             if (SDL_strcmp(srgbhint, "skip") == 0) {
                 // don't set an attribute at all.
                 // don't set an attribute at all.

+ 1 - 1
src/video/SDL_video.c

@@ -5396,7 +5396,7 @@ SDL_GLContext SDL_GL_CreateContext(SDL_Window *window)
 
 
 #if defined(SDL_VIDEO_OPENGL) || defined(SDL_VIDEO_OPENGL_ES) || defined(SDL_VIDEO_OPENGL_ES2)
 #if defined(SDL_VIDEO_OPENGL) || defined(SDL_VIDEO_OPENGL_ES) || defined(SDL_VIDEO_OPENGL_ES2)
     int srgb_requested = -1;
     int srgb_requested = -1;
-    const char *srgbhint = SDL_GetHint(SDL_HINT_OPENGL_FORCE_SRGB_CAPABLE);
+    const char *srgbhint = SDL_GetHint(SDL_HINT_OPENGL_FORCE_SRGB_FRAMEBUFFER);
     if (srgbhint && *srgbhint) {
     if (srgbhint && *srgbhint) {
         srgb_requested = SDL_GetStringBoolean(srgbhint, false) ? 1 : 0;
         srgb_requested = SDL_GetStringBoolean(srgbhint, false) ? 1 : 0;
     }
     }

+ 1 - 1
src/video/uikit/SDL_uikitopengles.m

@@ -155,7 +155,7 @@ SDL_GLContext UIKit_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window)
         }
         }
 
 
         int srgb = _this->gl_config.framebuffer_srgb_capable;
         int srgb = _this->gl_config.framebuffer_srgb_capable;
-        const char *srgbhint = SDL_GetHint(SDL_HINT_OPENGL_FORCE_SRGB_CAPABLE);
+        const char *srgbhint = SDL_GetHint(SDL_HINT_OPENGL_FORCE_SRGB_FRAMEBUFFER);
         if (srgbhint && *srgbhint) {
         if (srgbhint && *srgbhint) {
             srgb = SDL_GetStringBoolean(srgbhint, false) ? 1 : 0;  // there is no "skip" here, since initWithFrame expects it, so we'll treat it as false.
             srgb = SDL_GetStringBoolean(srgbhint, false) ? 1 : 0;  // there is no "skip" here, since initWithFrame expects it, so we'll treat it as false.
         }
         }

+ 1 - 1
src/video/windows/SDL_windowsopengl.c

@@ -661,7 +661,7 @@ static bool WIN_GL_SetupWindowInternal(SDL_VideoDevice *_this, SDL_Window *windo
     }
     }
 
 
     if (_this->gl_data->HAS_WGL_ARB_framebuffer_sRGB) {
     if (_this->gl_data->HAS_WGL_ARB_framebuffer_sRGB) {
-        const char *srgbhint = SDL_GetHint(SDL_HINT_OPENGL_FORCE_SRGB_CAPABLE);
+        const char *srgbhint = SDL_GetHint(SDL_HINT_OPENGL_FORCE_SRGB_FRAMEBUFFER);
         if (srgbhint && *srgbhint) {
         if (srgbhint && *srgbhint) {
             if (SDL_strcmp(srgbhint, "skip") == 0) {
             if (SDL_strcmp(srgbhint, "skip") == 0) {
                 // don't set an attribute at all.
                 // don't set an attribute at all.

+ 1 - 1
src/video/x11/SDL_x11opengl.c

@@ -585,7 +585,7 @@ static int X11_GL_GetAttributes(SDL_VideoDevice *_this, Display *display, int sc
     }
     }
 
 
     if (_this->gl_data->HAS_GLX_ARB_framebuffer_sRGB) {
     if (_this->gl_data->HAS_GLX_ARB_framebuffer_sRGB) {
-        const char *srgbhint = SDL_GetHint(SDL_HINT_OPENGL_FORCE_SRGB_CAPABLE);
+        const char *srgbhint = SDL_GetHint(SDL_HINT_OPENGL_FORCE_SRGB_FRAMEBUFFER);
         if (srgbhint && *srgbhint) {
         if (srgbhint && *srgbhint) {
             if (SDL_strcmp(srgbhint, "skip") == 0) {
             if (SDL_strcmp(srgbhint, "skip") == 0) {
                 // don't set an attribute at all.
                 // don't set an attribute at all.