1 #ifndef __al_included_allegro5_display_h
2 #define __al_included_allegro5_display_h
3 
4 #include "allegro5/bitmap.h"
5 #include "allegro5/color.h"
6 #include "allegro5/events.h"
7 
8 #ifdef __cplusplus
9    extern "C" {
10 #endif
11 
12 /* Possible bit combinations for the flags parameter of al_create_display. */
13 enum {
14    ALLEGRO_WINDOWED                    = 1 << 0,
15    ALLEGRO_FULLSCREEN                  = 1 << 1,
16    ALLEGRO_OPENGL                      = 1 << 2,
17    ALLEGRO_DIRECT3D_INTERNAL           = 1 << 3,
18    ALLEGRO_RESIZABLE                   = 1 << 4,
19    ALLEGRO_FRAMELESS                   = 1 << 5,
20    ALLEGRO_NOFRAME                     = ALLEGRO_FRAMELESS, /* older synonym */
21    ALLEGRO_GENERATE_EXPOSE_EVENTS      = 1 << 6,
22    ALLEGRO_OPENGL_3_0                  = 1 << 7,
23    ALLEGRO_OPENGL_FORWARD_COMPATIBLE   = 1 << 8,
24    ALLEGRO_FULLSCREEN_WINDOW           = 1 << 9,
25    ALLEGRO_MINIMIZED                   = 1 << 10,
26    ALLEGRO_PROGRAMMABLE_PIPELINE       = 1 << 11,
27    ALLEGRO_GTK_TOPLEVEL_INTERNAL       = 1 << 12,
28    ALLEGRO_MAXIMIZED                   = 1 << 13,
29    ALLEGRO_OPENGL_ES_PROFILE           = 1 << 14,
30 #if defined(ALLEGRO_UNSTABLE) || defined(ALLEGRO_INTERNAL_UNSTABLE) || defined(ALLEGRO_SRC)
31    ALLEGRO_OPENGL_CORE_PROFILE         = 1 << 15,
32 #endif
33 };
34 
35 /* Possible parameters for al_set_display_option.
36  * Make sure to update ALLEGRO_EXTRA_DISPLAY_SETTINGS if you modify
37  * anything here.
38  */
39 enum ALLEGRO_DISPLAY_OPTIONS {
40    ALLEGRO_RED_SIZE = 0,
41    ALLEGRO_GREEN_SIZE = 1,
42    ALLEGRO_BLUE_SIZE = 2,
43    ALLEGRO_ALPHA_SIZE = 3,
44    ALLEGRO_RED_SHIFT = 4,
45    ALLEGRO_GREEN_SHIFT = 5,
46    ALLEGRO_BLUE_SHIFT = 6,
47    ALLEGRO_ALPHA_SHIFT = 7,
48    ALLEGRO_ACC_RED_SIZE = 8,
49    ALLEGRO_ACC_GREEN_SIZE = 9,
50    ALLEGRO_ACC_BLUE_SIZE = 10,
51    ALLEGRO_ACC_ALPHA_SIZE = 11,
52    ALLEGRO_STEREO = 12,
53    ALLEGRO_AUX_BUFFERS = 13,
54    ALLEGRO_COLOR_SIZE = 14,
55    ALLEGRO_DEPTH_SIZE = 15,
56    ALLEGRO_STENCIL_SIZE = 16,
57    ALLEGRO_SAMPLE_BUFFERS = 17,
58    ALLEGRO_SAMPLES = 18,
59    ALLEGRO_RENDER_METHOD = 19,
60    ALLEGRO_FLOAT_COLOR = 20,
61    ALLEGRO_FLOAT_DEPTH = 21,
62    ALLEGRO_SINGLE_BUFFER = 22,
63    ALLEGRO_SWAP_METHOD = 23,
64    ALLEGRO_COMPATIBLE_DISPLAY = 24,
65    ALLEGRO_UPDATE_DISPLAY_REGION = 25,
66    ALLEGRO_VSYNC = 26,
67    ALLEGRO_MAX_BITMAP_SIZE = 27,
68    ALLEGRO_SUPPORT_NPOT_BITMAP = 28,
69    ALLEGRO_CAN_DRAW_INTO_BITMAP = 29,
70    ALLEGRO_SUPPORT_SEPARATE_ALPHA = 30,
71    ALLEGRO_AUTO_CONVERT_BITMAPS = 31,
72    ALLEGRO_SUPPORTED_ORIENTATIONS = 32,
73    ALLEGRO_OPENGL_MAJOR_VERSION = 33,
74    ALLEGRO_OPENGL_MINOR_VERSION = 34,
75    ALLEGRO_DISPLAY_OPTIONS_COUNT
76 };
77 
78 enum
79 {
80    ALLEGRO_DONTCARE,
81    ALLEGRO_REQUIRE,
82    ALLEGRO_SUGGEST
83 };
84 
85 
86 /* Bitflags so they can be used for the ALLEGRO_SUPPORTED_ORIENTATIONS option. */
87 enum ALLEGRO_DISPLAY_ORIENTATION
88 {
89    ALLEGRO_DISPLAY_ORIENTATION_UNKNOWN = 0,
90    ALLEGRO_DISPLAY_ORIENTATION_0_DEGREES = 1,
91    ALLEGRO_DISPLAY_ORIENTATION_90_DEGREES = 2,
92    ALLEGRO_DISPLAY_ORIENTATION_180_DEGREES = 4,
93    ALLEGRO_DISPLAY_ORIENTATION_270_DEGREES = 8,
94    ALLEGRO_DISPLAY_ORIENTATION_PORTRAIT = 5,
95    ALLEGRO_DISPLAY_ORIENTATION_LANDSCAPE = 10,
96    ALLEGRO_DISPLAY_ORIENTATION_ALL = 15,
97    ALLEGRO_DISPLAY_ORIENTATION_FACE_UP = 16,
98    ALLEGRO_DISPLAY_ORIENTATION_FACE_DOWN = 32
99 };
100 
101 
102 /* Formally part of the primitives addon. */
103 enum
104 {
105    _ALLEGRO_PRIM_MAX_USER_ATTR = 10
106 };
107 
108 
109 /* Type: ALLEGRO_DISPLAY
110  */
111 typedef struct ALLEGRO_DISPLAY ALLEGRO_DISPLAY;
112 
113 
114 /* Enum: ALLEGRO_NEW_WINDOW_TITLE_MAX_SIZE
115 */
116 #define ALLEGRO_NEW_WINDOW_TITLE_MAX_SIZE 255
117 
118 AL_FUNC(void, al_set_new_display_refresh_rate, (int refresh_rate));
119 AL_FUNC(void, al_set_new_display_flags, (int flags));
120 AL_FUNC(int,  al_get_new_display_refresh_rate, (void));
121 AL_FUNC(int,  al_get_new_display_flags, (void));
122 
123 AL_FUNC(void, al_set_new_window_title, (const char *title));
124 AL_FUNC(const char *, al_get_new_window_title, (void));
125 
126 AL_FUNC(int, al_get_display_width,  (ALLEGRO_DISPLAY *display));
127 AL_FUNC(int, al_get_display_height, (ALLEGRO_DISPLAY *display));
128 AL_FUNC(int, al_get_display_format, (ALLEGRO_DISPLAY *display));
129 AL_FUNC(int, al_get_display_refresh_rate, (ALLEGRO_DISPLAY *display));
130 AL_FUNC(int, al_get_display_flags,  (ALLEGRO_DISPLAY *display));
131 AL_FUNC(int, al_get_display_orientation, (ALLEGRO_DISPLAY* display));
132 AL_FUNC(bool, al_set_display_flag, (ALLEGRO_DISPLAY *display, int flag, bool onoff));
133 
134 AL_FUNC(ALLEGRO_DISPLAY*, al_create_display, (int w, int h));
135 AL_FUNC(void,             al_destroy_display, (ALLEGRO_DISPLAY *display));
136 AL_FUNC(ALLEGRO_DISPLAY*, al_get_current_display, (void));
137 AL_FUNC(void,            al_set_target_bitmap, (ALLEGRO_BITMAP *bitmap));
138 AL_FUNC(void,            al_set_target_backbuffer, (ALLEGRO_DISPLAY *display));
139 AL_FUNC(ALLEGRO_BITMAP*, al_get_backbuffer,    (ALLEGRO_DISPLAY *display));
140 AL_FUNC(ALLEGRO_BITMAP*, al_get_target_bitmap, (void));
141 
142 AL_FUNC(bool, al_acknowledge_resize, (ALLEGRO_DISPLAY *display));
143 AL_FUNC(bool, al_resize_display,     (ALLEGRO_DISPLAY *display, int width, int height));
144 AL_FUNC(void, al_flip_display,       (void));
145 AL_FUNC(void, al_update_display_region, (int x, int y, int width, int height));
146 AL_FUNC(bool, al_is_compatible_bitmap, (ALLEGRO_BITMAP *bitmap));
147 
148 AL_FUNC(bool, al_wait_for_vsync, (void));
149 
150 AL_FUNC(ALLEGRO_EVENT_SOURCE *, al_get_display_event_source, (ALLEGRO_DISPLAY *display));
151 
152 AL_FUNC(void, al_set_display_icon, (ALLEGRO_DISPLAY *display, ALLEGRO_BITMAP *icon));
153 AL_FUNC(void, al_set_display_icons, (ALLEGRO_DISPLAY *display, int num_icons, ALLEGRO_BITMAP *icons[]));
154 
155 /* Stuff for multihead/window management */
156 AL_FUNC(int, al_get_new_display_adapter, (void));
157 AL_FUNC(void, al_set_new_display_adapter, (int adapter));
158 AL_FUNC(void, al_set_new_window_position, (int x, int y));
159 AL_FUNC(void, al_get_new_window_position, (int *x, int *y));
160 AL_FUNC(void, al_set_window_position, (ALLEGRO_DISPLAY *display, int x, int y));
161 AL_FUNC(void, al_get_window_position, (ALLEGRO_DISPLAY *display, int *x, int *y));
162 AL_FUNC(bool, al_set_window_constraints, (ALLEGRO_DISPLAY *display, int min_w, int min_h, int max_w, int max_h));
163 AL_FUNC(bool, al_get_window_constraints, (ALLEGRO_DISPLAY *display, int *min_w, int *min_h, int *max_w, int *max_h));
164 AL_FUNC(void, al_apply_window_constraints, (ALLEGRO_DISPLAY *display, bool onoff));
165 
166 AL_FUNC(void, al_set_window_title, (ALLEGRO_DISPLAY *display, const char *title));
167 
168 /* Defined in display_settings.c */
169 AL_FUNC(void, al_set_new_display_option, (int option, int value, int importance));
170 AL_FUNC(int, al_get_new_display_option, (int option, int *importance));
171 AL_FUNC(void, al_reset_new_display_options, (void));
172 AL_FUNC(void, al_set_display_option, (ALLEGRO_DISPLAY *display, int option, int value));
173 AL_FUNC(int, al_get_display_option, (ALLEGRO_DISPLAY *display, int option));
174 
175 /*Deferred drawing*/
176 AL_FUNC(void, al_hold_bitmap_drawing, (bool hold));
177 AL_FUNC(bool, al_is_bitmap_drawing_held, (void));
178 
179 /* Miscellaneous */
180 AL_FUNC(void, al_acknowledge_drawing_halt, (ALLEGRO_DISPLAY *display));
181 AL_FUNC(void, al_acknowledge_drawing_resume, (ALLEGRO_DISPLAY *display));
182 #if defined(ALLEGRO_UNSTABLE) || defined(ALLEGRO_INTERNAL_UNSTABLE) || defined(ALLEGRO_SRC)
183 AL_FUNC(void, al_backup_dirty_bitmaps, (ALLEGRO_DISPLAY *display));
184 #endif
185 
186 #ifdef __cplusplus
187    }
188 #endif
189 
190 #endif
191 
192 /* vim: set ts=8 sts=3 sw=3 et: */
193