SDL_GetFullscreenDisplayModes() follows the SDL_GetStringRule

This commit is contained in:
Sam Lantinga committed 2024-07-19 12:22:03 -07:00
1 parent 9758e102bc
commit 9de8cb888a
8 files changed
+28 -32

No files matched your search

+1 -2
View File
@@ -2015,14 +2015,13 @@ Rather than iterating over display modes using an index, there is a new function
{
SDL_DisplayID display = SDL_GetPrimaryDisplay();
int num_modes = 0;
SDL_DisplayMode **modes = SDL_GetFullscreenDisplayModes(display, &num_modes);
const SDL_DisplayMode * const *modes = SDL_GetFullscreenDisplayModes(display, &num_modes);
if (modes) {
for (i = 0; i < num_modes; ++i) {
SDL_DisplayMode *mode = modes[i];
SDL_Log("Display %" SDL_PRIu32 " mode %d: %dx%d@%gx %gHz\n",
display, i, mode->w, mode->h, mode->pixel_density, mode->refresh_rate);
}
SDL_free(modes);
}
}
```