al_wait_for_event_until(3alleg5)
β¨ NAME β¨
al_wait_for_event_until β bestie, this is the Allegro 5 API function that sits there and waits for an event to show up, but like, only for as long as you tell it to π
πΈ SYNOPSIS πΈ
#include <allegro5/allegro.h>
bool al_wait_for_event_until(ALLEGRO_EVENT_QUEUE *queue,
ALLEGRO_EVENT *ret_event, ALLEGRO_TIMEOUT *timeout)
π DESCRIPTION π
Okay so picture this: you've got an event queue, and you want it to be non-empty. That's literally the whole assignment. al_wait_for_event_until waits until the event queue you specified is not empty, no cap π«Ά
Now here's where the plot splits, depending on what you pass in:
- If
ret_eventis notNULL, then the first event in the queue gets copied intoret_eventand removed from the queue. Slay, it's yours now β¨ - If
ret_eventisNULL, then the first event just stays right there at the head of the queue. Not me leaving it exactly where I found it π
Meanwhile, timeout decides how long you're willing to wait for all this. And here's the vibe check:
- If the call times out,
falseis returned π - Otherwise, if an event did occur,
trueis returned π
Heads up bestie: for compatibility with all platforms,timeoutmust be2,147,483.647seconds or less. Like, that's the ceiling. Don't be out here asking for more, it's giving incompatible π«
π¦ SEE ALSO π¦
ALLEGRO_EVENT(3alleg5)ALLEGRO_TIMEOUT(3alleg5)al_init_timeout(3alleg5)al_wait_for_event(3alleg5)al_wait_for_event_timed(3alleg5)
and that's the whole page, bestie β brought to you by the Allegro reference manual, page al_wait_for_event_until(3alleg5) (manual allegro5, section 3, the classics). go wait for your events, but like, with a timeout. periodt ππ
π¦ where this page comes from
- debian trixie: allegro5-doc 2:5.2.10.1+dfsg-1 Β· Zlib
- ubuntu questing: allegro5-doc 2:5.2.10.1+dfsg-1build1
- ubuntu resolute: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- ubuntu stonking: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms