is_windowed_mode(3alleg4)

✨ NAME ✨

is_windowed_mode β€” bestie this one literally just tells you if you're running in windowed mode πŸ’… (also: it's from the Allegro game programming library, mwah)


🌸 SYNOPSIS 🌸

#include <allegro.h>

int is_windowed_mode(void);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so picture this: you called set_gfx_mode() at some point and now you're like… was that a window situation or a full screen takeover situation? πŸ™ˆ You don't have to guess, babes β€” this function exists specifically to detect whether or not set_gfx_mode() selected a windowed mode. vibe check complete βœ…

Here's the little example, straight up:

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 it's giving main character energy? two branches, zero chaos. 🌈


πŸ’– RETURN VALUE πŸ’–

  • returns true if the current graphics mode is a windowed mode πŸͺŸ
  • returns zero if it's a fullscreen mode πŸ–₯️
🚨 okay but fr fr, listen: you should not call this function if you are not in graphics mode. like. don't. it's not a vibe. 😭

πŸŽ€ SEE ALSO πŸŽ€


Allegro version 4.4.3 β€” and that's the whole is_windowed_mode(3alleg4) situation, bestie!! 🫢 tysm for reading, go forth and slay your graphics modes πŸ’œβœ¨πŸŒΈπŸ¦‹