ALLEGRO_GET_EVENT_TYPE(3)

πŸ“¦
version 5.2.11.3 Β· 3 versions
, in arch rolling

πŸ’– NAME πŸ’–

okay so bestie, welcome to ALLEGRO_GET_EVENT_TYPE(3) β€” yes, that’s the page title, and it’s from the Library Functions Manual. The whole vibe? Allegro 5 API. That’s the name section, she’s concise, we respect it. πŸŽ€

✨ SYNOPSIS ✨

Here’s the literal setup, no cap:

              #include <allegro5/allegro.h>

              #define ALLEGRO_GET_EVENT_TYPE(a, b, c, d)   AL_ID(a, b, c, d)

πŸ¦‹ DESCRIPTION πŸ¦‹

So this macro makes an event type identifier, which is a 32-bit integer. Usually β€” but not necessarily, she’s flexible β€” it’s made from four 8-bit character codes, like this:

              #define MY_EVENT_TYPE   ALLEGRO_GET_EVENT_TYPE('M','I','N','E')
🚨 reserved-zone alert: IDs less than 1024 are reserved for Allegro or its addons. Do not use anything lower than ALLEGRO_GET_EVENT_TYPE(0, 0, 4, 0).

You should try to make your IDs unique so they don’t clash with any 3rd party code you may be using. Be creative. Numbering from 1024 is not creative β€” literally the opposite of a main-character move. πŸ’…

If you need multiple identifiers, you could define them like this:

              #define BASE_EVENT   ALLEGRO_GET_EVENT_TYPE('M','I','N','E')
              #define BARK_EVENT   (BASE_EVENT + 0)
              #define MEOW_EVENT   (BASE_EVENT + 1)
              #define SQUAWK_EVENT (BASE_EVENT + 2)

              /* Alternatively */
              enum {
                 BARK_EVENT = ALLEGRO_GET_EVENT_TYPE('M','I','N','E'),
                 MEOW_EVENT,
                 SQUAWK_EVENT
              };

🌈 SEE ALSO 🌈

Go touch these pages too, iykyk:


Source/version: Allegro reference manual. Date: not listed on this page β€” mysterious queen behavior, honestly. Stay slay, bestie. πŸ’œ

πŸ“¦ where this page comes from
  • arch rolling: allegro 5.2.11.3-2 Β· Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms