sdlSetWindowModal function

bool sdlSetWindowModal(
  1. Pointer<SdlWindow> window,
  2. bool modal
)

Toggle the state of the window as modal.

To enable modal status on a window, the window must currently be the child window of a parent, or toggling modal status on will fail.

\param window the window on which to set the modal state. \param modal true to toggle modal status on, false to toggle it off. \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_SetWindowParent \sa SDL_WINDOW_MODAL

extern SDL_DECLSPEC bool SDLCALL SDL_SetWindowModal(SDL_Window *window, bool modal)

Implementation

bool sdlSetWindowModal(Pointer<SdlWindow> window, bool modal) {
  final sdlSetWindowModalLookupFunction = libSdl3.lookupFunction<
      Uint8 Function(Pointer<SdlWindow> window, Uint8 modal),
      int Function(Pointer<SdlWindow> window, int modal)>('SDL_SetWindowModal');
  return sdlSetWindowModalLookupFunction(window, modal ? 1 : 0) == 1;
}