scroll_screen(3alleg4)

πŸ’– scroll_screen(3alleg4) πŸ’–

okay bestie, welcome to the Allegro manual ✨ this one's called scroll_screen, and it's giving "let me just nudge the whole hardware screen over there real quick" energy πŸ¦‹


✨ NAME ✨

scroll_screen β€” Requests a hardware scroll request. Allegro game programming library. no cap, that's literally the whole job πŸŽ€


🌸 SYNOPSIS 🌸

#include <allegro.h>

int scroll_screen(int x, int y);

πŸ’… DESCRIPTION πŸ’…

So the way that this works: scroll_screen attempts to scroll the hardware screen so it shows a different part of the virtual screen. Where does the virtual screen start out? At 0, 0 β€” the top left corner, queen of origin points πŸ‘‘.

You can use this to:

  • move the screen display around inside a big ol' virtual screen space, or
  • page flip back and forth between two non-overlapping areas of the virtual screen.
⚠️ But listen β€” if you wanna draw outside the original position in the screen bitmap, you're gonna have to alter the clipping rectangle with set_clip_rect(). Don't skip that step bestie, it's not optional πŸ™ˆ

🧚 driver tea β˜•

Mode-X scrolling is reliable and will work on any card.</purl> Other drivers? Lowkey may not work, or may not work reliably 😭. Check the platform-specific section of the docs for the deets.


⏱️ the vsync thing ⏱️

Allegro will handle any necessary vertical retrace synchronisation when scrolling the screen, so you do NOT need to call vsync() before it. Which means scroll_screen() has the exact same time delay effects as vsync() β€” iconic behaviour, honestly πŸ’…βœ¨


🌈 RETURN VALUE 🌈

  • 0 β€” zero on success, slay πŸ’š
  • non-zero β€” returned if the graphics driver can't handle hardware scrolling, or if the virtual screen isn't large enough πŸ’€

πŸŽ€ SEE ALSO πŸŽ€


okay that's the whole page, mwah 🫢 this was brought to you by Allegro version 4.4.3 β€” and yes, scroll_screen(3alleg4) really is the name of the girl writing this, periodt πŸ’œπŸŒΈ