al_peek_next_event(3alleg5)

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

✨ al_peek_next_event β€” Allegro 5 API ✨

okay bestie, welcome to al_peek_next_event(3alleg5), a certified iconic entry in the Allegro 5 manual πŸ’– this one is short, sweet, and honestly kind of a queen β€” let's get into it 🫢


🌸 SYNOPSIS 🌸

#include <allegro5/allegro.h>

bool al_peek_next_event(ALLEGRO_EVENT_QUEUE *queue, ALLEGRO_EVENT *ret_event)

πŸ’… DESCRIPTION πŸ’…

so here's the vibe: this function peeks πŸ‘€ at the next event chillin' in the event queue you passed in β€” the one you named with queue β€” and it copies that event's contents straight into ret_event, then hands you back true. slay.

but here's the part that makes it peek and not take, bestie β€” the original event packet stays right where it is, at the head of the queue. it does not get removed. it does not get consumed. it just sits there looking pretty, main character energy, waiting for you to come back for it later πŸ”₯

and if the event queue is actually empty? false, babe. that's it. and the contents of ret_event are unspecified β€” like, genuinely unspecified, no cap, don't go reading it and expecting anything cute in there. πŸ™ˆ

not me peeking at events and then pretending I didn't touch anything πŸ’€ the queue literally does not know

πŸ¦‹ SEE ALSO πŸ¦‹

go read those too, iykyk ✨


mwah πŸ’‹ that's the whole page β€” brought to you by the Allegro reference manual, filed under al_peek_next_event(3alleg5), periodt. πŸŽ€πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from