With regards to this:
I just added this to SVN, as well as more cross-references, if that helps:
@@ -399,9 +399,16 @@ These are the public fields:
- intptr_t data3;
- intptr_t data4;
-Note that like all other event types this structure is a part of the
-ALLEGRO_EVENT union. Therefore to create a new user event you would
+Like all other event types this structure is a part of the ALLEGRO_EVENT union.
+To access the fields in an ALLEGRO_EVENT variable `ev`, you would use:
+To create a new user event you would do this:
@@ -415,6 +422,10 @@ do this:
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] for the rules you
+should follow when assigning identifiers.
See also: [al_emit_user_event], [ALLEGRO_GET_EVENT_TYPE]
I'm not clear on how to read a user event from the event queue
The answer is: the same as any other event. I'm genuinely curious how this could have come up, as I would have thought the reason you start investigating user events is because you want something that acts the same (or as reasonably close) as other Allegro events.
The manual entry for ALLEGRO_EVENT doesn't mention how to test for a user event type when processing events from a queue. Are we supposed to set event.type to some magic number that we remember later or what?
Again, in the same way you test for other event types, by checking the .type field matches some magic constant. For user events you are in charge of assigning the event type identifiers. That is described at:
I've added a few extra cross-references to that as well.
Further suggestions are welcome.