update SDL3 to 3.1.6.

This commit is contained in:
Sasha Szpakowski
2024-11-16 00:44:49 -04:00
parent aecb572558
commit 8c4c8655aa
231 changed files with 16035 additions and 3495 deletions
+19 -5
View File
@@ -139,6 +139,9 @@ static VideoBootStrap *bootstrap[] = {
#ifdef SDL_INPUT_LINUXEV
&DUMMY_evdev_bootstrap,
#endif
#endif
#ifdef SDL_VIDEO_DRIVER_OPENVR
&OPENVR_bootstrap,
#endif
NULL
};
@@ -274,6 +277,11 @@ static Uint32 SDL_DefaultGraphicsBackends(SDL_VideoDevice *_this)
if (_this->Metal_CreateView) {
return SDL_WINDOW_METAL;
}
#endif
#if defined(SDL_VIDEO_OPENGL) && defined(SDL_VIDEO_DRIVER_OPENVR)
if (SDL_strcmp(_this->name, "openvr") == 0) {
return SDL_WINDOW_OPENGL;
}
#endif
return 0;
}
@@ -1743,11 +1751,17 @@ float SDL_GetWindowDisplayScale(SDL_Window *window)
static void SDL_CheckWindowDisplayScaleChanged(SDL_Window *window)
{
float pixel_density = SDL_GetWindowPixelDensity(window);
float content_scale = SDL_GetDisplayContentScale(SDL_GetDisplayForWindowPosition(window));
float display_scale;
display_scale = (pixel_density * content_scale);
if (_this->GetWindowContentScale) {
display_scale = _this->GetWindowContentScale(_this, window);
} else {
const float pixel_density = SDL_GetWindowPixelDensity(window);
const float content_scale = SDL_GetDisplayContentScale(SDL_GetDisplayForWindowPosition(window));
display_scale = pixel_density * content_scale;
}
if (display_scale != window->display_scale) {
window->display_scale = display_scale;
SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED, 0, 0);
@@ -4529,7 +4543,7 @@ void SDL_GL_ResetAttributes(void)
_this->gl_config.egl_platform = 0;
}
bool SDL_GL_SetAttribute(SDL_GLattr attr, int value)
bool SDL_GL_SetAttribute(SDL_GLAttr attr, int value)
{
#if defined(SDL_VIDEO_OPENGL) || defined(SDL_VIDEO_OPENGL_ES) || defined(SDL_VIDEO_OPENGL_ES2)
bool result;
@@ -4647,7 +4661,7 @@ bool SDL_GL_SetAttribute(SDL_GLattr attr, int value)
#endif // SDL_VIDEO_OPENGL
}
bool SDL_GL_GetAttribute(SDL_GLattr attr, int *value)
bool SDL_GL_GetAttribute(SDL_GLAttr attr, int *value)
{
#if defined(SDL_VIDEO_OPENGL) || defined(SDL_VIDEO_OPENGL_ES) || defined(SDL_VIDEO_OPENGL_ES2)
PFNGLGETERRORPROC glGetErrorFunc;