|
NAMEal_init_user_event_source - Allegro 5 APISYNOPSIS
DESCRIPTIONInitialise an event source for emitting user events. The space for the event source must already have been allocated.One possible way of creating custom event sources is to derive other structures with ALLEGRO_EVENT_SOURCE at the head, e.g.
The advantage here is that the THING pointer will be the same as the ALLEGRO_EVENT_SOURCE pointer. Events emitted by the event source will have the event source pointer as the source field, from which you can get a pointer to a THING by a simple cast (after ensuring checking the event is of the correct type). However, it is only one technique and you are not obliged to use it. The user event source will never be destroyed automatically. You must destroy it manually with al_destroy_user_event_source(3). SEE ALSOALLEGRO_EVENT_SOURCE(3), al_destroy_user_event_source(3), al_emit_user_event(3), ALLEGRO_USER_EVENT(3)
Visit the GSP FreeBSD Man Page Interface. |