scroll_screen(3)
π scroll_screen(3) π
okay so bestie, welcome to the Allegro manual β yes, the game programming library, the whole vibe β¨ this little page is all about scroll_screen, and it's genuinely one of those functions that's giving main character energy once you get it. let's go π¦
β¨ NAME β¨
scroll_screen β it requests a hardware scroll request. yeah, that's literally it, and it lives in the Allegro game programming library π
πΈ SYNOPSIS πΈ
#include <allegro.h>
int scroll_screen(int x, int y);
π DESCRIPTION π
so what does it actually do? it attempts to scroll the hardware screen so it displays a different part of the virtual screen. and ngl, at the very start that virtual screen is just sitting at 0, 0, which is the top left corner β iconic, standard, we love her π
what's the point of that, you ask? two whole moods:
- you can move the screen display around inside a big ol' virtual screen space, like you're panning a camera over a giant canvas πΌοΈ
- or you can page flip back and forth between two non-overlapping areas of the virtual screen β flip flip flip, no cap π₯
β οΈ one thing, and listen carefully bestie: 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(). like, it will not happen on its own. periodt.
now, the tea on drivers β β Mode-X scrolling is reliable and will work on any card. any. card. slay. but other drivers? they may not work, or they may not work reliably π so please, check out the platform-specific section of the docs for the full rundown.
and here's the part that's lowkey a gift: Allegro will handle any necessary vertical retrace synchronisation when scrolling the screen, so you do not need to call vsync() before it. none. zero. don't do it. this means that scroll_screen() has the same time delay effects as vsync() β so yeah, that timing is built in, that's just how she moves π§
β RETURN VALUE β
- returns zero on success π
- returns non-zero if the graphics driver can't handle hardware scrolling, or if the virtual screen is not large enough π
like, if you get non-zero back, something's off β either the driver said "not today" or your virtual screen is just too smol.
π SEE ALSO π
go read these next, they're all besties of this one:
and that's the whole page, bestie π«Ά this was Allegro version 4.4.3, and yeah we're still on scroll_screen(3) β go scroll something gorgeous πβ¨
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms