Profile

ALLEGRO_USER_EVENT(3alleg5)

ALLEGRO_USER_EVENT(3alleg5)

NAME

ALLEGRO_USER_EVENT - Allegro 5 API

SYNOPSIS

C]
#include <allegro5/allegro.h>
typedef struct ALLEGRO_USER_EVENT ALLEGRO_USER_EVENT;
]

DESCRIPTION

An event structure that can be emitted by user event sources. These are the public fields:

[bu]
ALLEGRO_EVENT_SOURCE *source;
[bu]
intptr_t data1;
[bu]
intptr_t data2;
[bu]
intptr_t data3;
[bu]
intptr_t data4;

Like all other event types this structure is a part of the ALLEGRO_EVENT union. To access the fields in an ALLEGRO_EVENT variable C]ev], you would use:

[bu]
ev.user.source
[bu]
ev.user.data1
[bu]
ev.user.data2
[bu]
ev.user.data3
[bu]
ev.user.data4

To create a new user event you would do this:

C]
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([aq]M[aq],[aq]I[aq],[aq]N[aq],[aq]E[aq]);
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(3alleg5) for the rules you should follow when assigning identifiers.

SEE ALSO

al_emit_user_event(3alleg5), ALLEGRO_GET_EVENT_TYPE(3alleg5)

Latest Tech News
Your Notes

Sign in/Sign up

Signing in to our system allows you to post your contributions and vote on the contributions of others. It will also allow you to get extra perts like having your favorites in the cloud and having your persistent personal notes wherever you go. More will be added as we scale up our services.

By signing in to our system, you agree our Member Terms and Conditions


Sign-in with one of the following services

Almost finished!

Please select a screen name for NET SOUP.



 Please send me news and special offers from NET SOUP.

 I have read and accept the Terms of Use.

COMPLIMENTARY EXAMPLES

We have no example yet for this entry


Your Name
Now

Community Contributions and Discussions

Modify your search

View Documentation

Jobs from Indeed