sdlSetWindowAlwaysOnTop function

bool sdlSetWindowAlwaysOnTop(
  1. Pointer<SdlWindow> window,
  2. bool onTop
)

Set the window to always be above the others.

This will add or remove the window's SDL_WINDOW_ALWAYS_ON_TOP flag. This will bring the window to the front and keep the window above the rest.

\param window the window of which to change the always on top state. \param on_top true to set the window always on top, false to disable. \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_GetWindowFlags

extern SDL_DECLSPEC bool SDLCALL SDL_SetWindowAlwaysOnTop(SDL_Window *window, bool on_top)

Implementation

bool sdlSetWindowAlwaysOnTop(Pointer<SdlWindow> window, bool onTop) {
  final sdlSetWindowAlwaysOnTopLookupFunction = libSdl3.lookupFunction<
      Uint8 Function(Pointer<SdlWindow> window, Uint8 onTop),
      int Function(
          Pointer<SdlWindow> window, int onTop)>('SDL_SetWindowAlwaysOnTop');
  return sdlSetWindowAlwaysOnTopLookupFunction(window, onTop ? 1 : 0) == 1;
}