mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-03-23 18:53:08 +08:00
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.
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
Reference in New Issue
Block a user