sdlSetAssertionHandler function assert

void sdlSetAssertionHandler(
  1. Pointer<NativeFunction<SdlAssertionHandler>> handler,
  2. Pointer<NativeType> userdata
)

Set an application-defined assertion handler.

This function allows an application to show its own assertion UI and/or force the response to an assertion failure. If the application doesn't provide this, SDL will try to do the right thing, popping up a system-specific GUI dialog, and probably minimizing any fullscreen windows.

This callback may fire from any thread, but it runs wrapped in a mutex, so it will only fire from one thread at a time.

This callback is NOT reset to SDL's internal handler upon SDL_Quit()!

\param handler the SDL_AssertionHandler function to call when an assertion fails or NULL for the default handler. \param userdata a pointer that is passed to handler.

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

\since This function is available since SDL 3.2.0.

\sa SDL_GetAssertionHandler

extern SDL_DECLSPEC void SDLCALL SDL_SetAssertionHandler( SDL_AssertionHandler handler, void *userdata)

Implementation

void sdlSetAssertionHandler(
  Pointer<NativeFunction<SdlAssertionHandler>> handler,
  Pointer<NativeType> userdata,
) {
  final sdlSetAssertionHandlerLookupFunction = _libSdl
      .lookupFunction<
        Void Function(
          Pointer<NativeFunction<SdlAssertionHandler>> handler,
          Pointer<NativeType> userdata,
        ),
        void Function(
          Pointer<NativeFunction<SdlAssertionHandler>> handler,
          Pointer<NativeType> userdata,
        )
      >('SDL_SetAssertionHandler');
  return sdlSetAssertionHandlerLookupFunction(handler, userdata);
}