SCREEN_W(3alleg4)
π SCREEN_W β okay bestie, it's giving screen dimensions π
3alleg4 Β· the Allegro game programming library manual β¨
πΈ NAME πΈ
SCREEN_W, SCREEN_H β the global defines that hand you the size of the screen, no cap. Part of the Allegro game programming library π
π SYNOPSIS π
#include <allegro.h>
#define SCREEN_W;
#define SCREEN_H;
β¨ DESCRIPTION β¨
So these are global defines, right? And they return the width and the height of the screen. That's it. That's the whole vibe. π¦
But listen β and this is the important part β if the screen hasn't been initialised yet, they give you zero. Zero!! Not a crash, not a lie, just a big fat 0. So if your numbers are looking real empty, that's your sign to go init the screen first, bestie. π
Here's the example, and yes it's iconic:
char buf[100];
...
uszprintf(buf, sizeof(buf),
"The screen size is %d x %d pixels",
SCREEN_W, SCREEN_H);
Look at that. SCREEN_W and SCREEN_H just dropped straight into your uszprintf like they own the place. main character energy fr fr π
π SEE ALSO π
Allegro, version 4.4.3 β and that's the SCREEN_W(3alleg4) page, mwah π go forth and measure your screen, you've got this π«ΆπΈ
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms