gfx_mode_select_ex(3alleg4)

✨ gfx_mode_select_ex ✨

okay bestie so this one lives in the Allegro game programming library manual, section 3alleg4, and it's the extended version of the graphics mode selection dialog πŸŽ€


🌈 SYNOPSIS 🌈

#include <allegro.h>

int gfx_mode_select_ex(int *card, int *w, int *h, int *color_depth);

πŸ’… DESCRIPTION πŸ’…

so you know the graphics mode selection dialog? this is her extended sister. the glow-up? she also lets the user pick the color depth. that's it, that's the upgrade, and honestly? iconic. πŸ‘‘

now here's the part where you gotta pay attention, because it works exactly like gfx_mode_select does with suggestions:

the values you've stored at the addresses you pass in β€” like card, w, h, color_depth β€” get used as suggestions for the initial selections in the dialog. cute, right? but if those values can't be found in the lists, it just defaults to the first entry in each list. no drama, no error, just vibes. πŸ¦‹

and if you want to guarantee that the initial selection for each list is the first entry? bestie, initialize the data stored at the addresses you pass to the function to 0 or -1. that's the move. periodt. πŸ’…

then, if the dialog gets OK'd, it stores the selections at the addresses you passed to the function. so you get your answers back right where you put your questions. slay. 🫢


πŸ”₯ RETURN VALUE πŸ”₯

ngl this page isn't gonna tell you directly β€” see the gfx_mode_select_filter function for the return values. go check her out, she's got the receipts. πŸ’€


πŸŽ€ SEE ALSO πŸŽ€


and that's the whole page, bestie β€” brought to you by Allegro version 4.4.3, dated right there in the footer of gfx_mode_select_ex(3alleg4) ✨ mwah, go select some modes πŸ’–