gfx_mode_select(3)

πŸ“¦ version 4.4.3.1, in fedora 43, fedora 44

πŸ’– 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