get_gfx_mode_type(3)

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

πŸ’– 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