get_gfx_mode_list(3alleg4)
π get_gfx_mode_list β bestie edition π
okay so this one lives in the Allegro manual and it's section 3alleg4 if you're out here doing the whole man thing, slay. let's get into it π«Ά
β¨ NAME β¨
get_gfx_mode_list β obtains a list of available video modes. Allegro game programming library. periodt π
πΈ SYNOPSIS πΈ
#include <allegro.h>
GFX_MODE_LIST *get_gfx_mode_list(int card);
look at her. so simple. so iconic. π
π¦ DESCRIPTION π¦
so what this does is it attempts to create a list of all the supported video modes for a certain graphics driver, okay? and this list is made up from the GFX_MODE_LIST structure, which β and I need you to look at this β has the following definition:
typedef struct GFX_MODE_LIST
{
int num_modes;
GFX_MODE *mode;
} GFX_MODE_LIST;
and the mode entry points to the actual list of video modes. no cap. π
typedef struct GFX_MODE
{
int width, height, bpp;
} GFX_MODE;
so it's giving width, height, and bpp for each one, and the list of video modes is terminated with an { 0, 0, 0 } entry β like a little "that's all bestie" sentinel at the end, iykyk π
β οΈ okay so important one: thecardparameter must refer to a _real_ driver. this function fails if you passGFX_SAFE,GFX_AUTODETECT, or any other "magic" driver. the magic ones? not for this function. she said no thank u π
π RETURN VALUE π
returns a pointer to a list structure of the type GFX_MODE_LIST, or NULL if the request could not be satisfied. so like... check your pointers, bestie, that's the vibe check π
π SEE ALSO π
go read those too, they're all part of the same little friend group π
and that's the whole page, my love β¨ this one's from Allegro, version 4.4.3, and the page itself is get_gfx_mode_list(3alleg4) β go forth and enumerate your video modes, main character energy only πππ
π¦ 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