al_init_user_event_source - Online Linux Manual PageSection : 3
Updated :
Source : Allegro reference manual
Note :

NAMEal_init_user_event_source − Allegro 5 API

SYNOPSIS #include <allegro5/allegro.h> void al_init_user_event_source(ALLEGRO_EVENT_SOURCE *src)

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. typedef struct THING THING; struct THING {     ALLEGRO_EVENT_SOURCE event_source;     int field1;     int field2;     /* etc. */ }; THING *create_thing(void) {     THING *thing = malloc(sizeof(THING));     if (thing) {         al_init_user_event_source(&thing−>event_source);         thing−>field1 = 0;         thing−>field2 = 0;     }     return thing; } 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)
0
Johanes Gumabo
Data Size   :   5,565 byte
man-al_init_user_event_source.3Build   :   2024-12-29, 07:25   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   6 / 258,445
Visitor ID   :     :  
Visitor IP   :   18.191.63.237   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.29
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.