table of contents
- experimental 3.3~git20250806+ds-1
SDL_GetEventDescription(3) | SDL3 FUNCTIONS | SDL_GetEventDescription(3) |
NAME¶
SDL_GetEventDescription - Generate a human-readable description of an event.
SYNOPSIS¶
#include <SDL3/SDL_events.h>
int SDL_GetEventDescription(const SDL_Event *event, char *buf, int buflen);
DESCRIPTION¶
This will fill buf with a null-terminated string that might look something like this:
-
SDL_EVENT_MOUSE_MOTION (timestamp=1140256324 windowid=2 which=0 state=0 x=492.99 y=139.09 xrel=52 yrel=6)
The exact format of the string is not guaranteed; it is intended for logging purposes, to be read by a human, and not parsed by a computer.
The returned value follows the same rules as SDL_snprintf(): buf will always be NULL-terminated (unless buflen is zero), and will be truncated if buflen is too small. The return code is the number of bytes needed for the complete string, not counting the NULL-terminator, whether the string was truncated or not. Unlike SDL_snprintf(), though, this function never returns -1.
FUNCTION PARAMETERS¶
RETURN VALUE¶
Returns number of bytes needed for the full string, not counting the null-terminator byte.
THREAD SAFETY¶
It is safe to call this function from any thread.
AVAILABILITY¶
This function is available since SDL 3.4.0.
SDL 3.3.0 | Simple Directmedia Layer |