get_gfx_mode_list(3)

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

πŸ’– get_gfx_mode_list β€” Allegro manual, bestie edition πŸ’–

okay so this is get_gfx_mode_list(3), a lil function from the Allegro game programming library, and she's here to tell you every single video mode your graphics driver can actually do. no cap. let's get into it πŸ¦‹


✨ SYNOPSIS ✨

#include <allegro.h>

GFX_MODE_LIST *get_gfx_mode_list(int card);

🌸 DESCRIPTION 🌸

So like, this function tries to build you a whole list of every supported video mode for a certain graphics driver. and the way it hands it to you is through the GFX_MODE_LIST structure, which literally looks like this:

typedef struct GFX_MODE_LIST
{
   int num_modes;
   GFX_MODE *mode;
} GFX_MODE_LIST;

the mode entry? that's the one pointing at the actual list of video modes. main character energy honestly πŸ’…

typedef struct GFX_MODE
{
   int width, height, bpp;
} GFX_MODE;

and the list is terminated with an { 0, 0, 0 } entry β€” so when you hit that triple zero, you've reached the end, periodt. don't keep scrolling bestie, there's nothing after it πŸŽ€

⚠️ big important thing: the card parameter must refer to a _real_ driver. like, an actual one. this function fails if you pass GFX_SAFE, GFX_AUTODETECT, or any other "magic" driver. so no sneaky shortcut vibes here, she needs the real thing πŸ™ˆ

🫢 RETURN VALUE 🫢

She returns a pointer to a list structure of the type GFX_MODE_LIST, or NULL if the request could not be satisfied. that's it. that's the deal. if it's NULL, it's giving "no ❀️" and you gotta deal with it 😭


πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page bestie, you ate it up πŸ’–

this iconic lil manual page was brought to you by Allegro version 4.4.3, filed under get_gfx_mode_list(3) β€” go forth and enumerate those modes, iykyk βœ¨πŸŒˆπŸ’œ

πŸ“¦ where this page comes from