al_set_new_display_option(3alleg5)
β¨ al_set_new_display_option β¨
okay bestie, welcome to the Allegro 5 API manual page for al_set_new_display_option, and yes we are going to make display options make sense together π
πΈ SYNOPSIS πΈ
#include <allegro5/allegro.h>
void al_set_new_display_option(int option, int value, int importance)
π DESCRIPTION π
So basically, this function sets an extra display option that gets used whenever you create new displays on the thread you're calling it from. π«Ά
Quick vibe check: display options are not the same thing as display flags, okay? Options are about the fine details of the context that gets created inside the window itself. Most of the time Allegro doesn't care about them at all β they're just you telling the driver what you want. Like, say you're obsessed with multisampling? This is where you ask for it. β¨
π the importance parameter π
It can be one of these three, and honestly this is the part that matters most:
ALLEGRO_REQUIREβ bestie, this is the strict one. If the setting can't be met, the display will not be created. Periodt. πALLEGRO_SUGGESTβ the chill one. If your setting isn't available, the display gets created anyway with a setting as close as possible to what you asked for. You can peek at what you actually got by callingal_get_display_option(3alleg5)after the display exists. πALLEGRO_DONTCAREβ if you'd previously added a display option with one of the two settings above, it gets removed again. Otherwise this does literally nothing. π
π the supported options π
These are the options you can pass, and no we are not skipping a single one:
ALLEGRO_COLOR_SIZEβ ask for a specific bit depth. Like, to force a 16-bit framebuffer, set this to16. π¨ALLEGRO_RED_SIZE,ALLEGRO_GREEN_SIZE,ALLEGRO_BLUE_SIZE,ALLEGRO_ALPHA_SIZEβ the size in bits of each individual color component.ALLEGRO_RED_SHIFT,ALLEGRO_GREEN_SHIFT,ALLEGRO_BLUE_SHIFT,ALLEGRO_ALPHA_SHIFTβ together with the previous settings, these let you specify the exact pixel layout the display should use. Normally there is no reason to use these. Like, none. Leave them alone bestie. πALLEGRO_ACC_RED_SIZE,ALLEGRO_ACC_GREEN_SIZE,ALLEGRO_ACC_BLUE_SIZE,ALLEGRO_ACC_ALPHA_SIZEβ define the required accumulation buffer size. π§ALLEGRO_STEREOβ whether the display is a stereo display.ALLEGRO_AUX_BUFFERSβ how many auxiliary buffers the display should have.ALLEGRO_DEPTH_SIZEβ how many depth buffer (z-buffer) bits to use. πALLEGRO_STENCIL_SIZEβ how many bits to use for the stencil buffer.ALLEGRO_SAMPLE_BUFFERSβ whether to use multisampling (1) or not (0).ALLEGRO_SAMPLESβ if the above is1, this is the number of samples to use per pixel. Else0.ALLEGRO_RENDER_METHOD:β0if hardware acceleration is not used with this display.ALLEGRO_FLOAT_COLORβ whether to use floating point color components.ALLEGRO_FLOAT_DEPTHβ whether to use a floating point depth buffer.ALLEGRO_SINGLE_BUFFERβ whether the display uses a single buffer (1) or another update method (0).ALLEGRO_SWAP_METHODβ if the above is0, this is set to1to indicate the display is using a copying method to make the next buffer in the flip chain available, or to2to indicate a flipping or other method.ALLEGRO_COMPATIBLE_DISPLAYβ indicates if Allegro's graphics functions can use this display. And if you request a display that isn't useable by Allegro, you can still use, for example, OpenGL to draw graphics. slay π₯ALLEGRO_UPDATE_DISPLAY_REGIONβ set to1if the display is capable of updating just a region, and0if callingal_update_display_region(3alleg5)is equivalent toal_flip_display(3alleg5).ALLEGRO_VSYNCβ set to1to tell the driver to wait for vsync inal_flip_display(3alleg5), or to2to force vsync off. The default of0means Allegro does not try to modify the vsync behavior, so it may be on or off. π
Heads up: even in the case of1or2it is possible to override the vsync behavior in the graphics driver, so you should not rely on it. No cap.
ALLEGRO_MAX_BITMAP_SIZEβ when queried, this returns the maximum size (width as well as height) a bitmap can have for this display. Calls toal_create_bitmap(3alleg5)oral_load_bitmap(3alleg5)for bitmaps larger than this size will fail. It does not apply to memory bitmaps, which always can have arbitrary size (but are slow for drawing). πALLEGRO_SUPPORT_NPOT_BITMAPβ set to1if textures used for bitmaps on this display can have a size which is not a power of two. This is mostly useful if you use Allegro to load textures, since otherwise only power-of-two textures will be used internally as bitmap storage.ALLEGRO_CAN_DRAW_INTO_BITMAPβ set to1if you can useal_set_target_bitmap(3alleg5)on bitmaps of this display to draw into them. If this is not the case, software emulation will be used when drawing into display bitmaps (which can be very slow π).ALLEGRO_SUPPORT_SEPARATE_ALPHAβ this is set to1if theal_set_separate_blender(3alleg5)function is supported. Otherwise the alpha parameters will be ignored.ALLEGRO_AUTO_CONVERT_BITMAPSβ this is on by default. It causes any existing memory bitmaps with theALLEGRO_CONVERT_BITMAPflag to be converted to a display bitmap of the newly created display with the option set. β¨
Since: 5.1.0
ALLEGRO_SUPPORTED_ORIENTATIONSβ this is a bit-combination of the orientations supported by the application. The orientations are the same as foral_get_display_orientation(3alleg5), with the additional possibilities:ALLEGRO_DISPLAY_ORIENTATION_PORTRAITALLEGRO_DISPLAY_ORIENTATION_LANDSCAPEALLEGRO_DISPLAY_ORIENTATION_ALL
PORTRAIT means only the two portrait orientations are supported, LANDSCAPE means only the two landscape orientations, and ALL allows all four orientations. When the orientation changes between a portrait and a landscape orientation, the display needs to be resized. This is done by sending an ALLEGRO_EVENT_DISPLAY_RESIZE(3alleg5) message, which should be handled by calling al_acknowledge_resize(3alleg5). π¦
Since: 5.1.0
ALLEGRO_OPENGL_MAJOR_VERSIONβ request a specific OpenGL major version. π
Since: 5.1.13
ALLEGRO_OPENGL_MINOR_VERSIONβ request a specific OpenGL minor version.
Since: 5.1.13
ALLEGRO_DEFAULT_SHADER_PLATFORMβ specify the shader platform to use for the default shader. SeeALLEGRO_SHADER_PLATFORM(3alleg5). The default isALLEGRO_SHADER_AUTO. π
Since: 5.2.8
π¦ SEE ALSO π¦
and that's the whole page bestie, you ate π
β¨ this one's from the Allegro reference manual, page al_set_new_display_option(3alleg5) β go forth and configure your displays, ily, bye ππ«Ά
π¦ 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