| SDL_GetClosestFullscreenDisplayMode(3) | SDL3 FUNCTIONS | SDL_GetClosestFullscreenDisplayMode(3) |
SDL_GetClosestFullscreenDisplayMode - Get the closest match to the requested display mode.
Defined in SDL3/SDL_video.h
#include "SDL3/SDL.h"
bool SDL_GetClosestFullscreenDisplayMode(SDL_DisplayID displayID, int w, int h, float refresh_rate, bool include_high_density_modes, SDL_DisplayMode *closest);
The available display modes are scanned and closest is filled in with the closest mode matching the requested mode and returned. The mode format and refresh rate default to the desktop mode if they are set to 0. The modes are scanned with size being first priority, format being second priority, and finally checking the refresh rate. If all the available modes are too small, then false is returned.
Returns true on success or false on failure; call
SDL_GetError () for more information.
This function should only be called on the main thread.
This function is available since SDL 3.2.0.
•(3), SDL_GetDisplays(3), •(3), SDL_GetFullscreenDisplayModes(3)
| SDL 3.2.10 | Simple Directmedia Layer |