ALLEGRO_USER_EVENT(3)
hey bestie π welcome to the ALLEGRO_USER_EVENT(3) page from the Allegro reference manual β yes, the manual name is folded right in up top, no boring header repeat needed β¨
πΈ NAME πΈ
ALLEGRO_USER_EVENT - Allegro 5 API
β¨ SYNOPSIS β¨
okay so to even talk about this type you pull in the header and get this typedef:
#include <allegro5/allegro.h>
typedef struct ALLEGRO_USER_EVENT ALLEGRO_USER_EVENT;
π DESCRIPTION π
This is the event structure that can be emitted by user event sources β very main character energy, honestly π. These are the public fields, bestie:
ALLEGRO_EVENT_SOURCE *source;intptr_t data1;intptr_t data2;intptr_t data3;intptr_t data4;
Like all other event types, this structure is part of the ALLEGRO_EVENT union. To access the fields in an ALLEGRO_EVENT variable ev, you would use:
ev.user.sourceev.user.data1ev.user.data2ev.user.data3ev.user.data4
To create a new user event you would do this:
ALLEGRO_EVENT_SOURCE my_event_source;
ALLEGRO_EVENT my_event;
float some_var;
al_init_user_event_source(&my_event_source);
my_event.user.type = ALLEGRO_GET_EVENT_TYPE('M','I','N','E');
my_event.user.data1 = 1;
my_event.user.data2 = &some_var;
al_emit_user_event(&my_event_source, &my_event, NULL);
Event type identifiers for user events are assigned by the user. Please see the documentation for ALLEGRO_GET_EVENT_TYPE(3) for the rules you should follow when assigning identifiers β yes, the rules live over there, go read them, iykyk π¦
π SEE ALSO π
kbye bestie π«Ά this page is signed off by the Allegro reference manual β thatβs the source/version label β and there is literally no date printed on it, periodt π
π¦ where this page comes from
- arch rolling: allegro 5.2.11.3-2 Β· Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms