sdlShouldQuit function

bool sdlShouldQuit(
  1. Pointer<SdlInitState> state
)

Return whether cleanup should be done.

This function checks the passed in state and if cleanup should be done, sets the status to SDL_INIT_STATUS_UNINITIALIZING and returns true.

If this function returns true, the calling code must call SDL_SetInitialized() to complete the cleanup.

\param state the initialization state to check. \returns true if cleanup needs to be done, false otherwise.

\threadsafety It is safe to call this function from any thread.

\since This function is available since SDL 3.1.3.

\sa SDL_SetInitialized \sa SDL_ShouldInit

extern SDL_DECLSPEC bool SDLCALL SDL_ShouldQuit(SDL_InitState *state)

Implementation

bool sdlShouldQuit(Pointer<SdlInitState> state) {
  final sdlShouldQuitLookupFunction = libSdl3.lookupFunction<
      Uint8 Function(Pointer<SdlInitState> state),
      int Function(Pointer<SdlInitState> state)>('SDL_ShouldQuit');
  return sdlShouldQuitLookupFunction(state) == 1;
}