request_scroll(3alleg4)

πŸ’– request_scroll β€” the manual page, but make it a group chat πŸ’–

okay so bestie, we're in the <pink>3alleg4</pink> section of the Allegro manual, and today's main character is request_scroll. she queues up a hardware scroll request with triple buffering, and she's part of the Allegro game programming library. iconic behavior fr fr. ✨


🌸 SYNOPSIS 🌸

#include <allegro.h>

int request_scroll(int x, int y);

that's it. two ints. she's low maintenance like that. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so this function is the triple buffering girlie. here's the vibe: you ask for a hardware scroll to the position you want (x, y), and she returns immediately instead of standing there waiting for a retrace like some patient queen. she's not about that waiting life.

the scroll itself happens during the next vertical retrace, which is the whole point β€” you get to go do other stuff in the meantime. run your other code, live your life, be productive. then when you actually wanna know if the flip happened yet, you hit up poll_scroll() and she'll tell you. 🫢

⚠️ real talk though: triple buffering is only possible with certain drivers. not every driver is gonna serve this look. to vibe check it, go look at the GFX_CAN_TRIPLE_BUFFER bit inside the gfx_capabilities flag and see if it'll actually work with the driver you've got loaded. if that bit's not set, it's giving "not today."

⭐ RETURN VALUE ⭐

  • returns zero on success ✨
  • returns non-zero otherwise 😭

that's the whole story. zero = slay, non-zero = something went sideways.


πŸ’œ SEE ALSO πŸ’œ


and that's the page bestie, no cap. πŸŽ€ this was Allegro version 4.4.3, and yes, she's still out here serving request_scroll(3alleg4) energy in the year of our lord. go scroll something pretty. πŸ’–βœ¨πŸ¦‹