al_wait_for_event_until(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ 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_event is not NULL, then the first event in the queue gets copied into ret_event and removed from the queue. Slay, it's yours now ✨
  • If ret_event is NULL, 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, false is returned 😭
  • Otherwise, if an event did occur, true is returned πŸ‘‘
Heads up bestie: for compatibility with all platforms, timeout must be 2,147,483.647 seconds or less. Like, that's the ceiling. Don't be out here asking for more, it's giving incompatible 🚫

πŸ¦‹ SEE ALSO πŸ¦‹


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