is_windowed_mode(3)

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

πŸ’– is_windowed_mode πŸ’–

okay bestie, so this is a page from the Allegro manual (the game programming library, yes THAT one, she's iconic) and we're talking about is_windowed_mode β€” the little function that tells you if you're running in windowed mode πŸͺŸβœ¨


🌸 NAME 🌸

is_windowed_mode β€” tells you if you are running in windowed mode. Part of the Allegro game programming library πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <allegro.h>

int is_windowed_mode(void);

no cap, that's the whole vibe πŸ’…


✨ DESCRIPTION ✨

so like, this function is your girl for detecting whether or not set_gfx_mode() selected a windowed mode 🫢 it's literally just a lil vibe check on your graphics mode.

here's the moment, the example, the main character scene:

if (set_gfx_mode(GFX_AUTODETECT, 640, 480, 0, 0) != 0)
   abort_on_error("Couldn't set graphic mode!");
if (is_windowed_mode()) {
   /* Windowed mode stuff. */
} else {
   /* Fullscreen mode stuff. */
}

see how she's branching? windowed mode stuff in one lane, fullscreen mode stuff in the other 🌈 you get to decide what goes where, the function just tells you which reality you're in 😌


πŸ‘‘ RETURN VALUE πŸ‘‘

  • returns true if the current graphics mode is a windowed mode πŸͺŸ
  • returns zero if it is a fullscreen mode πŸ–₯️
🚨 okay important bestie: you should not call this function if you are not in graphics mode. like, don't. she needs a graphics mode to vibe with, fr fr. no graphics mode, no answer πŸ’€

πŸ”₯ SEE ALSO πŸ”₯


that's the whole page, periodt πŸ’œ go forth and check your windows responsibly, you absolute legend πŸ‘‘

~ from the Allegro manual, version 4.4.3 β€” mwah, love u, bye πŸŽ€πŸ’–

πŸ“¦ where this page comes from