Function sdl2_sys::SDL_GetClosestDisplayMode

source ยท
pub unsafe extern "C" fn SDL_GetClosestDisplayMode(
    displayIndex: c_int,
    mode: *const SDL_DisplayMode,
    closest: *mut SDL_DisplayMode,
) -> *mut SDL_DisplayMode
Expand description

Get the closest match to the requested display mode.

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 NULL is returned.

\param displayIndex the index of the display to query \param mode an SDL_DisplayMode structure containing the desired display mode \param closest an SDL_DisplayMode structure filled in with the closest match of the available display modes \returns the passed in value closest or NULL if no matching video mode was available; call SDL_GetError() for more information.

\since This function is available since SDL 2.0.0.

\sa SDL_GetDisplayMode \sa SDL_GetNumDisplayModes