[][src]Function sdl2_sys::SDL_SetAssertionHandler

pub unsafe extern "C" fn SDL_SetAssertionHandler(
    handler: SDL_AssertionHandler,
    userdata: *mut c_void
)

\brief Set an application-defined assertion handler.

This allows an app to show its own assertion UI and/or force the response to an assertion failure. If the app 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.

Setting the callback to NULL restores SDL's original internal handler.

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

Return SDL_AssertState value of how to handle the assertion failure.

\param handler Callback function, called when an assertion fails. \param userdata A pointer passed to the callback as-is.