Set framebuffer_srgb_capable to the actual value obtained (#8634)

(cherry picked from commit 594a79c2f9)
This commit is contained in:
Jake S. Del Mastro 2023-11-28 08:48:19 -05:00 committed by Sam Lantinga
parent ed3fad1880
commit ceac93ade2
1 changed files with 7 additions and 0 deletions

View File

@ -526,6 +526,9 @@ static int WIN_GL_ChoosePixelFormatARB(SDL_VideoDevice *_this, int *iAttribs, fl
int pixel_format = 0;
unsigned int matching;
int qAttrib = WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB;
int srgb = 0;
hwnd =
CreateWindow(SDL_Appname, SDL_Appname, (WS_POPUP | WS_DISABLED), 0, 0,
10, 10, NULL, NULL, SDL_Instance, NULL);
@ -547,6 +550,10 @@ static int WIN_GL_ChoosePixelFormatARB(SDL_VideoDevice *_this, int *iAttribs, fl
&matching);
}
/* Check whether we actually got an SRGB capable buffer */
_this->gl_data->wglGetPixelFormatAttribivARB(hdc, pixel_format, 0, 1, &qAttrib, &srgb);
_this->gl_config.framebuffer_srgb_capable = srgb;
_this->gl_data->wglMakeCurrent(hdc, NULL);
_this->gl_data->wglDeleteContext(hglrc);
}