1al_set_new_display_option(3)Library Functions Manualal_set_new_display_option(3)
2
3
4
6 al_set_new_display_option
7
9 #include <allegro5/allegro.h>
10
11 void al_set_new_display_option(int option, int value, int importance)
12
14 Set an extra display option, to be used when creating new displays on
15 the calling thread. Display options differ from display flags, and
16 specify some details of the context to be created within the window
17 itself. These mainly have no effect on Allegro itself, but you may
18 want to specify them, for example if you want to use multisampling.
19
20 The `importance' parameter can be either:
21
22 · ALLEGRO_REQUIRE - The display will not be created if the setting can
23 not be met.
24
25 · ALLEGRO_SUGGEST - If the setting is not available, the display will
26 be created anyway. FIXME: We need a way to query the settings back
27 from a created display.
28
29 · ALLEGRO_DONTCARE - If you added a display option with one of the
30 above two settings before, it will be removed again. Else this does
31 nothing.
32
33 The supported options are:
34
35 · ALLEGRO_RED_SIZE
36
37 · ALLEGRO_GREEN_SIZE
38
39 · ALLEGRO_BLUE_SIZE
40
41 · ALLEGRO_ALPHA_SIZE
42
43 · ALLEGRO_COLOR_SIZE
44
45 · ALLEGRO_RED_SHIFT
46
47 · ALLEGRO_GREEN_SHIFT
48
49 · ALLEGRO_BLUE_SHIFT
50
51 · ALLEGRO_ALPHA_SHIFT: These settings can be used to specify the pixel
52 layout the display should use.
53
54 · ALLEGRO_ACC_RED_SIZE
55
56 · ALLEGRO_ACC_GREEN_SIZE
57
58 · ALLEGRO_ACC_BLUE_SIZE
59
60 · ALLEGRO_ACC_ALPHA_SIZE: This and the preceding three settings can be
61 used to define the required accumulation buffer size.
62
63 · ALLEGRO_STEREO: Whether the display is a stereo display.
64
65 · ALLEGRO_AUX_BUFFERS: Number of auxiliary buffers the display should
66 have.
67
68 · ALLEGRO_DEPTH_SIZE: How many depth buffer (z-buffer) bits to use.
69
70 · ALLEGRO_STENCIL_SIZE: How many bits to use for the stencil buffer.
71
72 · ALLEGRO_SAMPLE_BUFFERS: Whether to use multisampling (1) or not (0).
73
74 · ALLEGRO_SAMPLES: If the above is 1, the number of samples to use per
75 pixel. Else 0.
76
77 · ALLEGRO_RENDER_METHOD: 0 if hardware acceleration is not used with
78 this display.
79
80 · ALLEGRO_FLOAT_COLOR: Whether to use floating point color components.
81
82 · ALLEGRO_FLOAT_DEPTH: Whether to use a floating point depth buffer.
83
84 · ALLEGRO_SINGLE_BUFFER: Whether the display uses a single buffer (1)
85 or another update method (0).
86
87 · ALLEGRO_SWAP_METHOD: If the above is 0, this is set to 1 to indicate
88 the display is using a copying method to make the next buffer in the
89 flip chain available, or to 2 to indicate a flipping or other method.
90
91 · ALLEGRO_COMPATIBLE_DISPLAY: Indicates if Allegro's graphics functions
92 can use this display. If you request a display not useable by Alle‐
93 gro, you can still use for example OpenGL to draw graphics.
94
95 · ALLEGRO_UPDATE_DISPLAY_REGION: Set to 1 if the display is capable of
96 updating just a region, and 0 if calling al_update_display_region(3)
97 is equivalent to al_flip_display(3).
98
99 · ALLEGRO_VSYNC: Set to 1 to tell the driver to wait for vsync in
100 al_flip_display(3), or to 2 to force vsync off. The default of 0
101 means that Allegro does not try to modify the vsync behavior so it
102 may be on or off. Note that even in the case of 1 or 2 it is possile
103 to override the vsync behavior in the graphics driver so you should
104 not rely on it.
105
106 · ALLEGRO_MAX_BITMAP_SIZE: When queried this returns the maximum size
107 (width as well as height) a bitmap can have for this display. Calls
108 to al_create_bitmap(3) or al_load_bitmap(3) for bitmaps larger than
109 this size will fail. It does not apply to memory bitmaps which
110 always can have arbitrary size (but are slow for drawing).
111
112 · ALLEGRO_SUPPORT_NPOT_BITMAP: Set to 1 if textures used for bitmaps on
113 this display can have a size which is not a power of two. This is
114 mostly useful if you use Allegro to load textures as otherwise only
115 power-of-two textures will be used internally as bitmap storage.
116
117 · ALLEGRO_CAN_DRAW_INTO_BITMAP: Set to 1 if you can use al_set_tar‐
118 get_bitmap(3) on bitmaps of this display to draw into them. If this
119 is not the case software emulation will be used when drawing into
120 display bitmaps (which can be very slow).
121
122 · ALLEGRO_SUPPORT_SEPARATE_ALPHA: This is set to 1 if the al_set_sepa‐
123 rate_blender(3) function is supported. Otherwise the alpha parame‐
124 ters will be ignored.
125
126 FIXME: document them all in detail
127
129 al_set_new_display_flags(3)
130
131
132
133Allegro reference manual al_set_new_display_option(3)