logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SDL_SetAssertionHandler - Set an application-defined assertion handler.

Availability

       This function is available since SDL 3.2.0.

Description

       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 ()!

Function Parameters

handler
              the SDL_AssertionHandler
               function to call when an assertion fails or NULL for the default handler.

       userdata
              a pointer that is passed to handler .

Header File

       Defined in SDL3/SDL_assert.h

Name

       SDL_SetAssertionHandler - Set an application-defined assertion handler.

See Also

(3), SDL_GetAssertionHandler(3)

Simple Directmedia Layer                           SDL 3.2.10                         SDL_SetAssertionHandler(3)

Synopsis

#include"SDL3/SDL.h"voidSDL_SetAssertionHandler(SDL_AssertionHandlerhandler,void*userdata);

Thread Safety

       It is safe to call this function from any thread.

See Also