get_gfx_mode_type(3alleg4)
๐ get_gfx_mode_type ๐
okay bestie, so this one lives in the Allegro manual (yes, the Allegro game programming library, the one that makes graphics happen ๐จโจ) and it's called get_gfx_mode_type. She's a lil function with a big job and honestly? she ate.
๐ธ SYNOPSIS ๐ธ
#include <allegro.h>
int get_gfx_mode_type(int graphics_card);
like, one include, one call, zero drama. we love a low-maintenance icon. ๐ซถ
โจ DESCRIPTION โจ
okay so here's the vibe: this function lets you figure out the types of operating modes that a specific graphics card driver operates in. like, is this driver a windowed girlie? a fullscreen girlie? is she definitely one of those?? is she a magic driver?? ๐ฎ this function will literally tell you. no cap.
The value it hands back is a bitfield, and that bitfield is made up of these fields:
GFX_TYPE_UNKNOWNGFX_TYPE_WINDOWEDGFX_TYPE_FULLSCREENGFX_TYPE_DEFINITEGFX_TYPE_MAGIC
okay important!! the return value will only be equivalent to GFX_TYPE_UNKNOWN when it's a driver that's unrecognized on that platform, or when it's just a bogus value. ๐
Test for the other types by using a bitwise AND. and here's the cute part โ if the driver is windowed or fullscreen, it will also have the DEFINITE flag set. so you get a lil bonus flag, as a treat ๐
for example:
int gfx_type = get_gfx_mode_type(GFX_AUTODETECT_WINDOWED);
in that case, gfx_type would have the GFX_TYPE_WINDOWED, GFX_TYPE_DEFINITE, and GFX_TYPE_MAGIC flags set. all three!! main character bitfield energy, honestly ๐
also, before you do literally any of this: Allegro needs to be initialized first. don't skip that step bestie, that's the whole thing.
Example:
/* Accept the use of only windowed drivers in our selection dialog */
int accept_windowed(int card , int w , int h , int color_depth)
{
if (get_gfx_mode_type(card) & GFX_TYPE_WINDOWED)
return 0;
return 1;
}
/* In main: */
gfx_mode_select_filter(&card, &w, &h, &color_depth, accept_windowed);
look at that callback go. she's filtering. she's returning. she's serving โจ
๐ RETURN VALUE ๐
Returns a bitfield describing the graphics mode type. that's it, that's the tea โ๐
๐ฆ SEE ALSO ๐ฆ
gfx_mode_select_filter(3alleg4)get_gfx_mode(3alleg4)set_gfx_mode(3alleg4)is_windowed_mode(3alleg4)
go read those too, they're all in the same friend group fr fr ๐ซ
and that's the whole page, bestie!! this was Allegro, version 4.4.3 โ mwah, love that for us. stay initialized out there ๐โจ๐๐ฆ๐ธ
๐ฆ 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