get_gfx_mode_type(3)
π get_gfx_mode_type β the Allegro manual, but make it cute π
okay bestie, welcome to the Allegro manual page for get_gfx_mode_type(3) β this one's a little function with big main character energy, and I'm gonna walk you through it like we're texting at 2am. π«Ά
β¨ NAME β¨
get_gfx_mode_type β grabs the type info for a specific graphics card. It's literally the Allegro game programming library, and it's giving "let me tell you what this driver actually is." π
πΈ SYNOPSIS πΈ
#include <allegro.h>
int get_gfx_mode_type(int graphics_card);
π¦ DESCRIPTION π¦
so this function lets you figure out what types of operating modes a specific graphics card driver actually operates in. It will tell you whether it's:
- windowed
- fullscreen
- definitely windowed or fullscreen
- and/or a magic driver β¨
The value it hands back is a bitfield made up of these fields:
GFX_TYPE_UNKNOWN GFX_TYPE_WINDOWED GFX_TYPE_FULLSCREEN GFX_TYPE_DEFINITE GFX_TYPE_MAGIC
ngl, the return value is only equivalent to GFX_TYPE_UNKNOWN when it's a driver that's unrecognized on that platform, or when it's a bogus value. So don't read too much into it, okay?
Test for the other types by using a bitwise AND. And here's the tea: if the driver is windowed or fullscreen, it will also have the definite flag set. 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. slay. π₯
Allegro needs to be initialized first. Not optional, bestie, that's the vibe check you have to pass.
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);
π RETURN VALUE π
Returns a bitfield describing the graphics mode type. that's it, that's the whole vibe. π
π SEE ALSO π
and that's a wrap, babe π this was the get_gfx_mode_type(3) page from the Allegro manual, and the whole thing is from Allegro, version 4.4.3. go forth and bitwise-AND responsibly, ily, mwah πβ¨
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms