1al_emit_user_event(3)      Library Functions Manual      al_emit_user_event(3)
2
3
4

NAME

6       al_emit_user_event
7

SYNOPSIS

9              #include <allegro5/allegro.h>
10
11              bool al_emit_user_event(ALLEGRO_EVENT_SOURCE *src,
12                 ALLEGRO_EVENT *event, void (*dtor)(ALLEGRO_USER_EVENT *))
13

DESCRIPTION

15       Emit  a  user  event.  The event source must have been initialised with
16       al_init_user_event_source(3).  Returns false if the event source  isn't
17       registered  with  any queues, hence the event wouldn't have been delivā€
18       ered into any queues.
19
20       Events are copied in and out of event queues, so  after  this  function
21       returns  the  memory  pointed to by event may be freed or reused.  Some
22       fields of the event being passed in may be modified by the function.
23
24       Reference counting will be performed if dtor is not NULL.   Whenever  a
25       copy  of the event is made, the reference count increases.  You need to
26       call al_unref_user_event(3) to decrease the reference  count  once  you
27       are done a user event that you have received from al_get_next_event(3),
28       al_peek_next_event(3), al_wait_for_event(3), etc.
29
30       Once the reference count drops to zero dtor will be called with a  copy
31       of  the  event as an argument.  It should free the resources associated
32       with the event, but not the event itself (since it is just a copy).
33
34       If dtor is NULL then reference counting will not be performed.   It  is
35       safe,  but unnecessary, to call al_unref_user_event(3) on non-reference
36       counted user events.
37

SEE ALSO

39       ALLEGRO_USER_EVENT(3), al_unref_user_event(3)
40
41
42
43Allegro reference manual                                 al_emit_user_event(3)
Impressum