A structure that contains an application-defined event type.
Uint32 |
type |
value obtained from SDL_RegisterEvents() |
Uint32 |
timestamp |
timestamp of the event |
Uint32 |
windowID |
the associated window, if any |
Sint32 |
code |
user defined event code |
void* |
data1 |
user defined data pointer |
void* |
data2 |
user defined data pointer |
1);
Uint32 myEventType = SDL_RegisterEvents(if (myEventType != ((Uint32)-1)) {
SDL_Event event;0, sizeof(event)); /* or SDL_zero(event) */
SDL_memset(&event,
event.type = myEventType;
event.user.code = my_event_code;
event.user.data1 = significant_data;0;
event.user.data2 =
SDL_PushEvent(&event); }
SDL_UserEvent is in the user member of the SDL_Event union. This event is unique; it is never created by SDL but only by the application. The event can be pushed onto the event queue using SDL_PushEvent(). The contents of the structure members are completely up to the programmer; the only requirement is that type is a value obtained from SDL_RegisterEvents().
CategoryStruct, CategoryEvents