sdlGetCurrentDisplayMode function

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

Get information about the current display mode.

There's a difference between this function and SDL_GetDesktopDisplayMode() when SDL runs fullscreen and has changed the resolution. In that case this function will return the current display mode, and not the previous native 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_GetDesktopDisplayMode \sa SDL_GetDisplayMode \sa SDL_GetNumVideoDisplays \sa SDL_SetWindowDisplayMode

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

Implementation

int sdlGetCurrentDisplayMode(int displayIndex, Pointer<SdlDisplayMode> mode) {
  final sdlGetCurrentDisplayModeLookupFunction = libSdl2.lookupFunction<
      Int32 Function(Int32 displayIndex, Pointer<SdlDisplayMode> mode),
      int Function(int displayIndex,
          Pointer<SdlDisplayMode> mode)>('SDL_GetCurrentDisplayMode');
  return sdlGetCurrentDisplayModeLookupFunction(displayIndex, mode);
}