update SDL3 to latest commit

This commit is contained in:
Sasha Szpakowski
2024-10-06 20:30:44 -03:00
parent 1b0fdc338b
commit 9e5eb1b018
1426 changed files with 242456 additions and 103496 deletions
+6 -7
View File
@@ -34,7 +34,7 @@ print_mode(const char *prefix, const SDL_DisplayMode *mode)
int main(int argc, char *argv[])
{
SDL_DisplayID *displays;
const SDL_DisplayMode **modes;
SDL_DisplayMode **modes;
const SDL_DisplayMode *mode;
int num_displays, i;
SDLTest_CommonState *state;
@@ -45,16 +45,13 @@ int main(int argc, char *argv[])
return 1;
}
/* Enable standard application logging */
SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
/* Parse commandline */
if (!SDLTest_CommonDefaultArgs(state, argc, argv)) {
return 1;
}
/* Load the SDL library */
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
if (!SDL_Init(SDL_INIT_VIDEO)) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError());
return 1;
}
@@ -66,12 +63,14 @@ int main(int argc, char *argv[])
for (i = 0; i < num_displays; i++) {
SDL_DisplayID dpy = displays[i];
SDL_PropertiesID props = SDL_GetDisplayProperties(dpy);
SDL_Rect rect = { 0, 0, 0, 0 };
int m, num_modes = 0;
const bool has_HDR = SDL_GetBooleanProperty(props, SDL_PROP_DISPLAY_HDR_ENABLED_BOOLEAN, false);
SDL_GetDisplayBounds(dpy, &rect);
modes = SDL_GetFullscreenDisplayModes(dpy, &num_modes);
SDL_Log("%" SDL_PRIu32 ": \"%s\" (%dx%d at %d,%d), content scale %.1f, %d fullscreen modes.\n", dpy, SDL_GetDisplayName(dpy), rect.w, rect.h, rect.x, rect.y, SDL_GetDisplayContentScale(dpy), num_modes);
SDL_Log("%" SDL_PRIu32 ": \"%s\" (%dx%d at %d,%d), content scale %.2f, %d fullscreen modes, HDR capable: %s.\n", dpy, SDL_GetDisplayName(dpy), rect.w, rect.h, rect.x, rect.y, SDL_GetDisplayContentScale(dpy), num_modes, has_HDR ? "yes" : "no");
mode = SDL_GetCurrentDisplayMode(dpy);
if (mode) {
@@ -92,7 +91,7 @@ int main(int argc, char *argv[])
(void)SDL_snprintf(prefix, sizeof(prefix), " MODE %d", m);
print_mode(prefix, modes[m]);
}
SDL_free((void*)modes);
SDL_free(modes);
SDL_Log("\n");
}