al_set_new_display_flags(3alleg5)
๐ 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 ๐. UnlikeALLEGRO_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 usingALLEGRO_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_FULLSCREENis typically less well supported compared toALLEGRO_FULLSCREEN_WINDOW. Like, genuinely, bestie, choose the other one ๐
ALLEGRO_RESIZABLEโ the display is resizable (only applicable if combined withALLEGRO_WINDOWED). Stretch that thing ๐ชALLEGRO_MAXIMIZEDโ the display window will be maximized (only applicable if combined withALLEGRO_RESIZABLE). Since: 5.1.12ALLEGRO_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 withALLEGRO_OPENGL_3_0will 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 optionALLEGRO_COMPATIBLE_DISPLAYwill be set tofalse. So yeah, drawing stuff just won't work. Plan accordingly ๐ALLEGRO_OPENGL_ES_PROFILEโ used together withALLEGRO_OPENGL, requests that the OpenGL context uses the OpenGL ES profile. A specific version can be requested withal_set_new_display_option(3alleg5). Note: Currently this is only supported by the X11/GLX driver. Since: 5.1.13ALLEGRO_OPENGL_CORE_PROFILEโ used together withALLEGRO_OPENGL, requests that the OpenGL context uses the OpenGL Core profile. A specific version can be requested withal_set_new_display_option(3alleg5). Note: Currently this is only supported by the X11/GLX driver. Since: 5.2.7ALLEGRO_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 useALLEGRO_SHADER(3alleg5)objects. Since: 5.1.6ALLEGRO_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.2ALLEGRO_NOFRAMEโ the original name forALLEGRO_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 callal_init_native_dialog_addon(3alleg5)for it to succeed.ALLEGRO_GTK_TOPLEVELis incompatible withALLEGRO_FULLSCREEN. Since: 5.1.5ALLEGRO_DRAG_AND_DROPโ if a display is created with theALLEGRO_DRAG_AND_DROPflag, it will generateALLEGRO_EVENT_DROPevents 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
- debian trixie: allegro5-doc 2:5.2.10.1+dfsg-1 ยท Zlib
- ubuntu questing: allegro5-doc 2:5.2.10.1+dfsg-1build1
- ubuntu resolute: allegro5-doc 2:5.2.11.3+dfsg-1 ยท Zlib
- ubuntu stonking: allegro5-doc 2:5.2.11.3+dfsg-1 ยท Zlib
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms