AL_SET_NEW_DISPLAY_FLAGS(3)
π al_set_new_display_flags(3) π
okay bestie, this page is from the Library Functions Manual and itβs giving Allegro 5 API realness. letβs get into it π«Ά
β¨ NAME β¨
al_set_new_display_flags β Allegro 5 API. thatβs the whole name section, no cap π
β¨ SYNOPSIS β¨
#include <allegro5/allegro.h>
void al_set_new_display_flags(int flags)
β¨ DESCRIPTION β¨
so this function sets various flags that get used when new displays are created on the calling thread. flags is a bitfield containing any reasonable combination of the following:
ALLEGRO_WINDOWEDβ prefer a windowed mode. Under multi-head X (not XRandR/TwinView), the use of more than one adapter is impossible due to bugs in X and GLX.al_create_display(3)will fail if more than one adapter is attempted to be used.ALLEGRO_FULLSCREEN_WINDOWβ make the window span the entire screen. UnlikeALLEGRO_FULLSCREEN, this will never attempt to modify the screen resolution. Instead, the pixel dimensions of the created display will be the same as the desktop. The passed width and height are only used if the window is switched out of fullscreen mode later, but theyβll be ignored initially. Under Windows and X11, a fullscreen display created with this flag will behave differently from one created with theALLEGRO_FULLSCREENflag β even if theALLEGRO_FULLSCREENdisplay is passed the desktop dimensions. The exact difference is platform dependent, but some things which may be different is how alt-tab works, how fast you can toggle between fullscreen/windowed mode, or how additional monitors behave while your display is in fullscreen mode. Additionally under X, the use of more than one adapter in multi-head mode or with true Xinerama enabled is impossible due to bugs in X/GLX; creation will fail if more than one adapter is attempted to be used.ALLEGRO_FULLSCREENβ prefer a fullscreen mode. Under X, the use of more than one FULLSCREEN display when using multi-head X, or true Xinerama, is not possible due to bugs in X and GLX; display creation will fail if more than one adapter is attempted to be used.
Note: Prefer usingALLEGRO_FULLSCREEN_WINDOWas it typically provides a better user experience β 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.
ALLEGRO_RESIZABLEβ the display is resizable (only applicable if combined withALLEGRO_WINDOWED).ALLEGRO_MAXIMIZEDβ the display window will be maximized (only applicable if combined withALLEGRO_RESIZABLE). Since:5.1.12.ALLEGRO_OPENGLβ require the driver to provide an initialized OpenGL context after returning successfully.ALLEGRO_OPENGL_3_0β require the driver to provide an initialized OpenGL context compatible with OpenGL version3.0.ALLEGRO_OPENGL_FORWARD_COMPATIBLEβ if this flag is set, the OpenGL context created withALLEGRO_OPENGL_3_0will be forward compatible only, meaning that all of the OpenGL API declared deprecated in OpenGL3.0will 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.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(3). Note: Currently this is only supported by the X11/GLX driver. Since:5.1.13.ALLEGRO_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(3). Note: Currently this is only supported by the X11/GLX driver. Since:5.2.7.ALLEGRO_DIRECT3Dβ require the driver to do rendering with Direct3D and provide a Direct3D device.ALLEGRO_PROGRAMMABLE_PIPELINEβ require a programmable graphics pipeline. This flag is required to useALLEGRO_SHADER(3)objects. Since:5.1.6.ALLEGRO_FRAMELESSβ try 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 is supported or not. Since:5.0.7,5.1.2.ALLEGRO_NOFRAMEβ original name forALLEGRO_FRAMELESS. This works with older versions of Allegro.ALLEGRO_GENERATE_EXPOSE_EVENTSβ let the display generate expose events.ALLEGRO_GTK_TOPLEVELβ create 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(3)for it to succeed.ALLEGRO_GTK_TOPLEVELis incompatible withALLEGRO_FULLSCREEN. Since:5.1.5.ALLEGRO_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. Since:5.2.9.
[Unstable API]: This is an experimental feature and currently only works for the X11 backend.
0 can be used for default values. π«
π SEE ALSO π
π thatβs the whole page, bestie β from the Allegro reference manual, for al_set_new_display_flags(3). no date on the original footer, so Iβm not inventing one. slay and happy display-making! π
π¦ where this page comes from
- arch rolling: allegro 5.2.11.3-2 Β· Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms