소스 검색

video: Respect SDL_HINT_OPENGL_FORCE_SRGB_CAPABLE with GL_FRAMEBUFFER_SRGB.

Reference Issue #14898.
Ryan C. Gordon 4 주 전
부모
커밋
9f5747ccd4
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      src/video/SDL_video.c

+ 5 - 1
src/video/SDL_video.c

@@ -5394,7 +5394,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);