al_set_new_display_flags(3alleg5)

๐Ÿ“ฆ
version 5.2.11.3 ยท 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

๐Ÿ’– NAME ๐Ÿ’–

al_set_new_display_flags โ€” a Allegro 5 API function, straight out of the 3alleg5 manual section. It's the little gremlin that decides what vibe every new display on your thread is gonna have โœจ


๐Ÿ“œ SYNOPSIS ๐Ÿ“œ

#include <allegro5/allegro.h>

void al_set_new_display_flags(int flags)

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

Okay so bestie, here's the tea โ˜•: this function sets all the flags that get used when you create new displays on the calling thread. The flags argument is a bitfield โ€” meaning you smoosh together any reasonable combination of the following constants with | and let it cook. ๐Ÿ“

Here's the full roster, no skips, no cuts, we're doing all of them ๐Ÿ‘‘

  • ALLEGRO_WINDOWED โ€” you're saying "prefer a windowed mode, pls". ๐ŸชŸ Heads up though: under multi-head X (and not XRandR/TwinView), using more than one adapter is literally impossible because of bugs in X and GLX. al_create_display(3alleg5) will fail if more than one adapter is attempted to be used. ๐Ÿ’€
  • ALLEGRO_FULLSCREEN_WINDOW โ€” makes the window span the entire screen ๐ŸŒˆ. Unlike ALLEGRO_FULLSCREEN, this one will never attempt to modify the screen resolution, periodt. Instead, the pixel dimensions of the created display will be exactly the same as the desktop. The width and height you pass in are only used if the window is later switched out of fullscreen mode โ€” initially they get ignored entirely, sorry babe ๐Ÿ™ˆ.

Under Windows and X11, a fullscreen display created with this flag behaves differently from one created with the ALLEGRO_FULLSCREEN flag โ€” even if the ALLEGRO_FULLSCREEN display is handed the desktop dimensions. The exact difference is platform dependent, but the things that may differ include: how alt-tab works, how fast you can toggle between fullscreen/windowed mode, and how additional monitors behave while your display is in fullscreen mode. It's giving "mystery meat" and the mystery is your OS ๐Ÿซ .

Also, under X, using more than one adapter in multi-head mode or with true Xinerama enabled is impossible because of bugs in X/GLX โ€” creation will fail if more than one adapter is attempted to be used.

  • ALLEGRO_FULLSCREEN โ€” you're saying "prefer a fullscreen mode". Under X, using more than one FULLSCREEN display when using multi-head X or true Xinerama is not possible because of bugs in X and GLX โ€” display creation will fail if more than one adapter is attempted to be used. ๐Ÿ˜ญ
Note: Prefer using ALLEGRO_FULLSCREEN_WINDOW โ€” it typically provides a better user experience because the monitor doesn't change resolution, and switching away from your game via Alt-Tab works smoothly. ALLEGRO_FULLSCREEN is typically less well supported compared to ALLEGRO_FULLSCREEN_WINDOW. Like, genuinely, bestie, choose the other one ๐Ÿ’…
  • ALLEGRO_RESIZABLE โ€” the display is resizable (only applicable if combined with ALLEGRO_WINDOWED). Stretch that thing ๐Ÿช„
  • ALLEGRO_MAXIMIZED โ€” the display window will be maximized (only applicable if combined with ALLEGRO_RESIZABLE). Since: 5.1.12
  • ALLEGRO_OPENGL โ€” requires the driver to provide an initialized OpenGL context after returning successfully. No context, no deal ๐ŸŽ€
  • ALLEGRO_OPENGL_3_0 โ€” requires the driver to provide an initialized OpenGL context compatible with OpenGL version 3.0. โญ
  • ALLEGRO_OPENGL_FORWARD_COMPATIBLE โ€” if this flag is set, the OpenGL context created with ALLEGRO_OPENGL_3_0 will be forward compatible only, meaning all of the OpenGL API declared deprecated in OpenGL 3.0 will not be supported. Currently, a display created with this flag will not be compatible with Allegro drawing routines โ€” the display option ALLEGRO_COMPATIBLE_DISPLAY will be set to false. So yeah, drawing stuff just won't work. Plan accordingly ๐Ÿ™
  • ALLEGRO_OPENGL_ES_PROFILE โ€” used together with ALLEGRO_OPENGL, requests that the OpenGL context uses the OpenGL ES profile. A specific version can be requested with al_set_new_display_option(3alleg5). Note: Currently this is only supported by the X11/GLX driver. Since: 5.1.13
  • ALLEGRO_OPENGL_CORE_PROFILE โ€” used together with ALLEGRO_OPENGL, requests that the OpenGL context uses the OpenGL Core profile. A specific version can be requested with al_set_new_display_option(3alleg5). Note: Currently this is only supported by the X11/GLX driver. Since: 5.2.7
  • ALLEGRO_DIRECT3D โ€” requires the driver to do rendering with Direct3D and provide a Direct3D device. ๐ŸŽฎ
  • ALLEGRO_PROGRAMMABLE_PIPELINE โ€” requires a programmable graphics pipeline. This flag is required to use ALLEGRO_SHADER(3alleg5) objects. Since: 5.1.6
  • ALLEGRO_FRAMELESS โ€” tries to create a window without a frame (i.e. no border or titlebar). This usually does nothing for fullscreen modes, and even in windowed modes it depends on the underlying platform whether it's supported or not. Fingers crossed ๐Ÿคž Since: 5.0.7, 5.1.2
  • ALLEGRO_NOFRAME โ€” the original name for ALLEGRO_FRAMELESS. This works with older versions of Allegro. Vintage era, we respect it ๐Ÿงš
  • ALLEGRO_GENERATE_EXPOSE_EVENTS โ€” lets the display generate expose events.
  • ALLEGRO_GTK_TOPLEVEL โ€” creates a GTK toplevel window for the display, on X. This flag is conditionally defined by the native dialog addon. You must call al_init_native_dialog_addon(3alleg5) for it to succeed. ALLEGRO_GTK_TOPLEVEL is incompatible with ALLEGRO_FULLSCREEN. Since: 5.1.5
  • ALLEGRO_DRAG_AND_DROP โ€” if a display is created with the ALLEGRO_DRAG_AND_DROP flag, it will generate ALLEGRO_EVENT_DROP events when files or text are dropped over the display. ๐Ÿ—‚๏ธโœจ
[Unstable API]: This is an experimental feature and currently only works for the X11 backend.

Since: 5.2.9

And finally: 0 can be used for default values. Zero, the humble icon, ate ๐Ÿซถ


๐Ÿ‘€ SEE ALSO ๐Ÿ‘€


And that's the whole page, bestie ๐Ÿ’œ This was al_set_new_display_flags(3alleg5), from the Allegro reference manual โ€” go set some flags, you've got this ๐Ÿ‘‘๐ŸŒธ

๐Ÿ“ฆ where this page comes from