gfx_mode_select(3)
π gfx_mode_select π
okay bestie, so this one is from the Allegro manual, it's gfx_mode_select(3), and it's literally the vibe-check dialog for your graphics mode. let's get into it π
β¨ NAME β¨
gfx_mode_select β pops up the Allegro graphics mode selection dialog, no cap π
π SYNOPSIS π
#include <allegro.h>
int gfx_mode_select(int *card, int *w, int *h);
π¦ DESCRIPTION π¦
So like. This function displays the Allegro graphics mode selection dialog β the little window where the user gets to pick a screen mode and a graphics card. iconic behavior honestly.
Here's the tea on how the defaults work π: whatever values are sitting at the addresses pointed to by card, w, and h get used as the default selections in the dialog β but only if those values are actually found in the driver and mode lists. If they're not found? Then the initial selections just become the first entry in each list instead. no biggie.
And if you really want to make sure the initial selection is always the first entry, then initialize the data at the addresses you pass into the function to the value of 0 or -1. that's the hack, periodt β¨
Then β if the dialog gets OK'd β it stores the selections at the addresses passed to the function. slay. π
π« RETURN VALUE π«
Not gonna lie, this page doesn't spell it out β it says see the gfx_mode_select_filter function for the return values. so go peek at that one, bestie π«Ά
π SEE ALSO π
fr fr, remember: the defaults only stick if they exist in the lists β otherwise it's first-entry energy whether you like it or not π
mwah π that's the whole page, and it's giving Allegro, version 4.4.3 β go forth and select your mode, main character πΈπ
π¦ 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