sdlGetDesktopDisplayMode function

int sdlGetDesktopDisplayMode(
  1. int displayIndex,
  2. Pointer<SdlDisplayMode> mode
)

Get information about the desktop's display mode.

There's a difference between this function and SDL_GetCurrentDisplayMode() when SDL runs fullscreen and has changed the resolution. In that case this function will return the previous native display mode, and not the current display mode.

\param displayIndex the index of the display to query \param mode an SDL_DisplayMode structure filled in with the current display mode \returns 0 on success or a negative error code on failure; call SDL_GetError() for more information.

\since This function is available since SDL 2.0.0.

\sa SDL_GetCurrentDisplayMode \sa SDL_GetDisplayMode \sa SDL_SetWindowDisplayMode

extern DECLSPEC int SDLCALL SDL_GetDesktopDisplayMode(int displayIndex, SDL_DisplayMode * mode)

Implementation

int sdlGetDesktopDisplayMode(int displayIndex, Pointer<SdlDisplayMode> mode) {
  final sdlGetDesktopDisplayModeLookupFunction = libSdl2.lookupFunction<
      Int32 Function(Int32 displayIndex, Pointer<SdlDisplayMode> mode),
      int Function(int displayIndex,
          Pointer<SdlDisplayMode> mode)>('SDL_GetDesktopDisplayMode');
  return sdlGetDesktopDisplayModeLookupFunction(displayIndex, mode);
}