Use this function to set an application-defined assertion handler.
void SDL_SetAssertionHandler(SDL_AssertionHandler handler, void* userdata)
the function to call when an assertion fails or NULL for the default handler; see Remarks for details
a pointer that is passed to handler
You can add your code example here
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.
The function prototype for handler is:
SDL_AssertState YourAssertionHandler(const SDL_AssertData* data, void* userdata)
where YourAssertionHandler is the name of your function and its parameters are:
This callback should return an SDL_AssertState value indicating how to handle the assertion failure.
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()!