al_get_next_event(3alleg5)

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

✨ al_get_next_event ✨

okay bestie, we're diving into the Allegro 5 API today and this one is literally the little event-queue goblin you'll be calling in every game loop ever πŸ’…


🌸 NAME 🌸

al_get_next_event β€” the Allegro 5 API function that pops the next event off your queue like it's the last boba straw πŸ§‹


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <allegro5/allegro.h>

bool al_get_next_event(ALLEGRO_EVENT_QUEUE *queue, ALLEGRO_EVENT *ret_event)

πŸ’– DESCRIPTION πŸ’–

so here's the tea β˜• β€” you hand it an event queue, and it takes the next event out of that queue, copies the contents into ret_event, and returns true. the original event gets removed from the queue. gone. not coming back. it's giving "you snooze you lose" energy 😭

but if the event queue is empty? then it returns false, and ngl the contents of ret_event are unspecified β€” like, do not trust them, do not look at them, they are not your friends πŸ™ˆ

lowkey important: ret_event only means something when the function returns true. when it returns false, whatever is sitting in there is just vibes and chaos, no cap πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page bestie, you ate 🫢 this was pulled straight from the Allegro reference manual, repping the alleg5 era, and yes the header and footer both said al_get_next_event(3alleg5) because this function is the main character and knows it ⭐🌈✨

πŸ“¦ where this page comes from