al_wait_for_event_timed(3alleg5)

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

πŸ’– al_wait_for_event_timed πŸ’–

okay bestie, so this is a page straight out of the Allegro 5 API β€” yes, the <pink>al_wait_for_event_timed(3alleg5)</pink> one, we been knew πŸ’…


✨ NAME ✨

al_wait_for_event_timed β€” Allegro 5 API πŸ¦‹


🌸 SYNOPSIS 🌸

#include <allegro5/allegro.h>

bool al_wait_for_event_timed(ALLEGRO_EVENT_QUEUE *queue,
   ALLEGRO_EVENT *ret_event, float secs)

πŸŽ€ DESCRIPTION πŸŽ€

so basically you're gonna wait until the event queue you passed in is not empty. that's the whole vibe. sitting there. patiently. like a good little main character πŸ‘‘

now here's the tea about ret_event, and it's giving fork-in-the-road:

  • if ret_event is not NULL, the first event in the queue gets copied into ret_event and then removed from the queue. it's gone, bestie, it left the group chat 😭
  • if ret_event is NULL, that first event just stays right at the head of the queue. nobody touches it. it's still there, unbothered, living its truth ✨

and secs? that's your girl telling the function approximately how many seconds to hang around waiting. roughly. approximately. don't come for her about precision πŸ’…

then the return value does a little vibe check:

  • if the call times out β†’ false comes back πŸ₯²
  • otherwise, if an event occurred β†’ true comes back, slay πŸŽ‰
⚠️ okay important one, no cap: for compatibility with all platforms, secs must be 2,147,483.647 seconds or less. that's the ceiling. do not test it. do not try to be cute about it. 🫢

πŸ‘€ SEE ALSO πŸ‘€


and that's the whole page, periodt πŸŽ€ this was the Allegro reference manual talking about al_wait_for_event_timed(3alleg5) β€” go forth and wait for your events, you icon πŸ’–πŸ¦‹βœ¨

πŸ“¦ where this page comes from