sdlSetWindowFullscreenMode function

bool sdlSetWindowFullscreenMode(
  1. Pointer<SdlWindow> window,
  2. Pointer<SdlDisplayMode> mode
)

Set the display mode to use when a window is visible and fullscreen.

This only affects the display mode used when the window is fullscreen. To change the window size when the window is not fullscreen, use SDL_SetWindowSize().

If the window is currently in the fullscreen state, this request is asynchronous on some windowing systems and the new mode dimensions may not be applied immediately upon the return of this function. If an immediate change is required, call SDL_SyncWindow() to block until the changes have taken effect.

When the new mode takes effect, an SDL_EVENT_WINDOW_RESIZED and/or an SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED event will be emitted with the new mode dimensions.

\param window the window to affect. \param mode a pointer to the display mode to use, which can be NULL for borderless fullscreen desktop mode, or one of the fullscreen modes returned by SDL_GetFullscreenDisplayModes() to set an exclusive fullscreen mode. \returns true on success or false on failure; call SDL_GetError() for more information.

\threadsafety This function should only be called on the main thread.

\since This function is available since SDL 3.1.3.

\sa SDL_GetWindowFullscreenMode \sa SDL_SetWindowFullscreen \sa SDL_SyncWindow

extern SDL_DECLSPEC bool SDLCALL SDL_SetWindowFullscreenMode(SDL_Window *window, const SDL_DisplayMode *mode)

Implementation

bool sdlSetWindowFullscreenMode(
    Pointer<SdlWindow> window, Pointer<SdlDisplayMode> mode) {
  final sdlSetWindowFullscreenModeLookupFunction = libSdl3.lookupFunction<
      Uint8 Function(Pointer<SdlWindow> window, Pointer<SdlDisplayMode> mode),
      int Function(Pointer<SdlWindow> window,
          Pointer<SdlDisplayMode> mode)>('SDL_SetWindowFullscreenMode');
  return sdlSetWindowFullscreenModeLookupFunction(window, mode) == 1;
}