1 
2 //          Copyright 2018 - 2021 Michael D. Parker
3 // Distributed under the Boost Software License, Version 1.0.
4 //    (See accompanying file LICENSE_1_0.txt or copy at
5 //          http://www.boost.org/LICENSE_1_0.txt)
6 
7 module bindbc.glfw.types;
8 
9 enum GLFWSupport {
10     noLibrary,
11     badLibrary,
12     glfw30      = 30,
13     glfw31      = 31,
14     glfw32      = 32,
15     glfw33      = 33,
16 }
17 
18 enum GLFW_VERSION_MAJOR = 3;
19 
20 version(GLFW_33) {
21     enum GLFW_VERSION_MINOR = 3;
22     enum GLFW_VERSION_REVISION = 0;
23     enum glfwSupport = GLFWSupport.glfw33;
24 }
25 else version(GLFW_32) {
26     enum GLFW_VERSION_MINOR = 2;
27     enum GLFW_VERSION_REVISION = 1;
28     enum glfwSupport = GLFWSupport.glfw32;
29 }
30 else version(GLFW_31) {
31     enum GLFW_VERSION_MINOR = 1;
32     enum GLFW_VERSION_REVISION = 2;
33     enum glfwSupport = GLFWSupport.glfw31;
34 }
35 else {
36     enum GLFW_VERSION_MINOR = 0;
37     enum GLFW_VERSION_REVISION = 4;
38     enum glfwSupport = GLFWSupport.glfw30;
39 }
40 
41 enum {
42     GLFW_FALSE,
43     GLFW_TRUE,
44 }
45 
46 enum {
47     GLFW_RELEASE = 0,
48     GLFW_PRESS = 1,
49     GLFW_REPEAT = 2,
50 }
51 
52 // Added in GLFW 3.3
53 enum {
54     GLFW_HAT_CENTERED = 0,
55     GLFW_HAT_UP = 1,
56     GLFW_HAT_RIGHT = 2,
57     GLFW_HAT_DOWN = 4,
58     GLFW_HAT_LEFT = 8,
59     GLFW_HAT_RIGHT_UP = (GLFW_HAT_RIGHT | GLFW_HAT_UP),
60     GLFW_HAT_RIGHT_DOWN = (GLFW_HAT_RIGHT | GLFW_HAT_DOWN),
61     GLFW_HAT_LEFT_UP = (GLFW_HAT_LEFT  | GLFW_HAT_UP),
62     GLFW_HAT_LEFT_DOWN = (GLFW_HAT_LEFT  | GLFW_HAT_DOWN),
63 }
64 
65 enum {
66     GLFW_KEY_UNKNOWN = -1,
67     GLFW_KEY_SPACE = 32,
68     GLFW_KEY_APOSTROPHE = 39,
69     GLFW_KEY_COMMA = 44,
70     GLFW_KEY_MINUS = 45,
71     GLFW_KEY_PERIOD = 46,
72     GLFW_KEY_SLASH = 47,
73     GLFW_KEY_0 = 48,
74     GLFW_KEY_1 = 49,
75     GLFW_KEY_2 = 50,
76     GLFW_KEY_3 = 51,
77     GLFW_KEY_4 = 52,
78     GLFW_KEY_5 = 53,
79     GLFW_KEY_6 = 54,
80     GLFW_KEY_7 = 55,
81     GLFW_KEY_8 = 56,
82     GLFW_KEY_9 = 57,
83     GLFW_KEY_SEMICOLON = 59,
84     GLFW_KEY_EQUAL = 61,
85     GLFW_KEY_A = 65,
86     GLFW_KEY_B = 66,
87     GLFW_KEY_C = 67,
88     GLFW_KEY_D = 68,
89     GLFW_KEY_E = 69,
90     GLFW_KEY_F = 70,
91     GLFW_KEY_G = 71,
92     GLFW_KEY_H = 72,
93     GLFW_KEY_I = 73,
94     GLFW_KEY_J = 74,
95     GLFW_KEY_K = 75,
96     GLFW_KEY_L = 76,
97     GLFW_KEY_M = 77,
98     GLFW_KEY_N = 78,
99     GLFW_KEY_O = 79,
100     GLFW_KEY_P = 80,
101     GLFW_KEY_Q = 81,
102     GLFW_KEY_R = 82,
103     GLFW_KEY_S = 83,
104     GLFW_KEY_T = 84,
105     GLFW_KEY_U = 85,
106     GLFW_KEY_V = 86,
107     GLFW_KEY_W = 87,
108     GLFW_KEY_X = 88,
109     GLFW_KEY_Y = 89,
110     GLFW_KEY_Z = 90,
111     GLFW_KEY_LEFT_BRACKET = 91,
112     GLFW_KEY_BACKSLASH = 92,
113     GLFW_KEY_RIGHT_BRACKET = 93,
114     GLFW_KEY_GRAVE_ACCENT = 96,
115     GLFW_KEY_WORLD_1 = 161,
116     GLFW_KEY_WORLD_2 = 162,
117 
118     GLFW_KEY_ESCAPE = 256,
119     GLFW_KEY_ENTER = 257,
120     GLFW_KEY_TAB = 258,
121     GLFW_KEY_BACKSPACE = 259,
122     GLFW_KEY_INSERT = 260,
123     GLFW_KEY_DELETE = 261,
124     GLFW_KEY_RIGHT = 262,
125     GLFW_KEY_LEFT = 263,
126     GLFW_KEY_DOWN = 264,
127     GLFW_KEY_UP = 265,
128     GLFW_KEY_PAGE_UP = 266,
129     GLFW_KEY_PAGE_DOWN = 267,
130     GLFW_KEY_HOME = 268,
131     GLFW_KEY_END = 269,
132     GLFW_KEY_CAPS_LOCK = 280,
133     GLFW_KEY_SCROLL_LOCK = 281,
134     GLFW_KEY_NUM_LOCK = 282,
135     GLFW_KEY_PRINT_SCREEN = 283,
136     GLFW_KEY_PAUSE = 284,
137     GLFW_KEY_F1 = 290,
138     GLFW_KEY_F2 = 291,
139     GLFW_KEY_F3 = 292,
140     GLFW_KEY_F4 = 293,
141     GLFW_KEY_F5 = 294,
142     GLFW_KEY_F6 = 295,
143     GLFW_KEY_F7 = 296,
144     GLFW_KEY_F8 = 297,
145     GLFW_KEY_F9 = 298,
146     GLFW_KEY_F10 = 299,
147     GLFW_KEY_F11 = 300,
148     GLFW_KEY_F12 = 301,
149     GLFW_KEY_F13 = 302,
150     GLFW_KEY_F14 = 303,
151     GLFW_KEY_F15 = 304,
152     GLFW_KEY_F16 = 305,
153     GLFW_KEY_F17 = 306,
154     GLFW_KEY_F18 = 307,
155     GLFW_KEY_F19 = 308,
156     GLFW_KEY_F20 = 309,
157     GLFW_KEY_F21 = 310,
158     GLFW_KEY_F22 = 311,
159     GLFW_KEY_F23 = 312,
160     GLFW_KEY_F24 = 313,
161     GLFW_KEY_F25 = 314,
162     GLFW_KEY_KP_0 = 320,
163     GLFW_KEY_KP_1 = 321,
164     GLFW_KEY_KP_2 = 322,
165     GLFW_KEY_KP_3 = 323,
166     GLFW_KEY_KP_4 = 324,
167     GLFW_KEY_KP_5 = 325,
168     GLFW_KEY_KP_6 = 326,
169     GLFW_KEY_KP_7 = 327,
170     GLFW_KEY_KP_8 = 328,
171     GLFW_KEY_KP_9 = 329,
172     GLFW_KEY_KP_DECIMAL = 330,
173     GLFW_KEY_KP_DIVIDE = 331,
174     GLFW_KEY_KP_MULTIPLY = 332,
175     GLFW_KEY_KP_SUBTRACT = 333,
176     GLFW_KEY_KP_ADD = 334,
177     GLFW_KEY_KP_ENTER = 335,
178     GLFW_KEY_KP_EQUAL = 336,
179     GLFW_KEY_LEFT_SHIFT = 340,
180     GLFW_KEY_LEFT_CONTROL = 341,
181     GLFW_KEY_LEFT_ALT = 342,
182     GLFW_KEY_LEFT_SUPER = 343,
183     GLFW_KEY_RIGHT_SHIFT = 344,
184     GLFW_KEY_RIGHT_CONTROL = 345,
185     GLFW_KEY_RIGHT_ALT = 346,
186     GLFW_KEY_RIGHT_SUPER = 347,
187     GLFW_KEY_MENU = 348,
188     GLFW_KEY_LAST = GLFW_KEY_MENU,
189 
190     GLFW_KEY_ESC = GLFW_KEY_ESCAPE,
191     GLFW_KEY_DEL = GLFW_KEY_DELETE,
192     GLFW_KEY_PAGEUP = GLFW_KEY_PAGE_UP,
193     GLFW_KEY_PAGEDOWN = GLFW_KEY_PAGE_DOWN,
194     GLFW_KEY_KP_NUM_LOCK = GLFW_KEY_NUM_LOCK,
195     GLFW_KEY_LCTRL = GLFW_KEY_LEFT_CONTROL,
196     GLFW_KEY_LSHIFT = GLFW_KEY_LEFT_SHIFT,
197     GLFW_KEY_LALT = GLFW_KEY_LEFT_ALT,
198     GLFW_KEY_LSUPER = GLFW_KEY_LEFT_SUPER,
199     GLFW_KEY_RCTRL = GLFW_KEY_RIGHT_CONTROL,
200     GLFW_KEY_RSHIFT = GLFW_KEY_RIGHT_SHIFT,
201     GLFW_KEY_RALT = GLFW_KEY_RIGHT_ALT,
202     GLFW_KEY_RSUPER = GLFW_KEY_RIGHT_SUPER,
203 }
204 
205 enum {
206     GLFW_MOD_SHIFT = 0x0001,
207     GLFW_MOD_CONTROL = 0x0002,
208     GLFW_MOD_ALT = 0x0004,
209     GLFW_MOD_SUPER = 0x0008,
210     GLFW_MOD_CAPS_LOCK = 0x0010,        // Added in GLFW 3.3
211     GLFW_MOD_NUM_LOCK = 0x0020,         // ditto
212 }
213 
214 enum {
215     GLFW_MOUSE_BUTTON_1 = 0,
216     GLFW_MOUSE_BUTTON_2 = 1,
217     GLFW_MOUSE_BUTTON_3 = 2,
218     GLFW_MOUSE_BUTTON_4 = 3,
219     GLFW_MOUSE_BUTTON_5 = 4,
220     GLFW_MOUSE_BUTTON_6 = 5,
221     GLFW_MOUSE_BUTTON_7 = 6,
222     GLFW_MOUSE_BUTTON_8 = 7,
223     GLFW_MOUSE_BUTTON_LAST = GLFW_MOUSE_BUTTON_8,
224     GLFW_MOUSE_BUTTON_LEFT = GLFW_MOUSE_BUTTON_1,
225     GLFW_MOUSE_BUTTON_RIGHT = GLFW_MOUSE_BUTTON_2,
226     GLFW_MOUSE_BUTTON_MIDDLE = GLFW_MOUSE_BUTTON_3,
227 }
228 
229 enum {
230     GLFW_JOYSTICK_1 = 0,
231     GLFW_JOYSTICK_2 = 1,
232     GLFW_JOYSTICK_3 = 2,
233     GLFW_JOYSTICK_4 = 3,
234     GLFW_JOYSTICK_5 = 4,
235     GLFW_JOYSTICK_6 = 5,
236     GLFW_JOYSTICK_7 = 6,
237     GLFW_JOYSTICK_8 = 7,
238     GLFW_JOYSTICK_9 = 8,
239     GLFW_JOYSTICK_10 = 9,
240     GLFW_JOYSTICK_11 = 10,
241     GLFW_JOYSTICK_12 = 11,
242     GLFW_JOYSTICK_13 = 12,
243     GLFW_JOYSTICK_14 = 13,
244     GLFW_JOYSTICK_15 = 14,
245     GLFW_JOYSTICK_16 = 15,
246     GLFW_JOYSTICK_LAST = GLFW_JOYSTICK_16,
247 }
248 
249 // Added in GLFW 3.3
250 enum {
251     GLFW_GAMEPAD_BUTTON_A = 0,
252     GLFW_GAMEPAD_BUTTON_B = 1,
253     GLFW_GAMEPAD_BUTTON_X = 2,
254     GLFW_GAMEPAD_BUTTON_Y = 3,
255     GLFW_GAMEPAD_BUTTON_LEFT_BUMPER = 4,
256     GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER = 5,
257     GLFW_GAMEPAD_BUTTON_BACK = 6,
258     GLFW_GAMEPAD_BUTTON_START = 7,
259     GLFW_GAMEPAD_BUTTON_GUIDE = 8,
260     GLFW_GAMEPAD_BUTTON_LEFT_THUMB = 9,
261     GLFW_GAMEPAD_BUTTON_RIGHT_THUMB = 10,
262     GLFW_GAMEPAD_BUTTON_DPAD_UP = 11,
263     GLFW_GAMEPAD_BUTTON_DPAD_RIGHT = 12,
264     GLFW_GAMEPAD_BUTTON_DPAD_DOWN = 13,
265     GLFW_GAMEPAD_BUTTON_DPAD_LEFT = 14,
266     GLFW_GAMEPAD_BUTTON_LAST = GLFW_GAMEPAD_BUTTON_DPAD_LEFT,
267 
268     GLFW_GAMEPAD_BUTTON_CROSS = GLFW_GAMEPAD_BUTTON_A,
269     GLFW_GAMEPAD_BUTTON_CIRCLE = GLFW_GAMEPAD_BUTTON_B,
270     GLFW_GAMEPAD_BUTTON_SQUARE = GLFW_GAMEPAD_BUTTON_X,
271     GLFW_GAMEPAD_BUTTON_TRIANGLE = GLFW_GAMEPAD_BUTTON_Y,
272 }
273 
274 // Added in GLFW 3.3
275 enum {
276     GLFW_GAMEPAD_AXIS_LEFT_X = 0,
277     GLFW_GAMEPAD_AXIS_LEFT_Y = 1,
278     GLFW_GAMEPAD_AXIS_RIGHT_X = 2,
279     GLFW_GAMEPAD_AXIS_RIGHT_Y = 3,
280     GLFW_GAMEPAD_AXIS_LEFT_TRIGGER = 4,
281     GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER = 5,
282     GLFW_GAMEPAD_AXIS_LAST = GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER,
283 }
284 
285 enum {
286     GLFW_NO_ERROR = 0,                      // Added in GLFW 3.3
287     GLFW_NOT_INITIALIZED = 0x00010001,
288     GLFW_NO_CURRENT_CONTEXT = 0x00010002,
289     GLFW_INVALID_ENUM = 0x00010003,
290     GLFW_INVALID_VALUE = 0x00010004,
291     GLFW_OUT_OF_MEMORY = 0x00010005,
292     GLFW_API_UNAVAILABLE = 0x00010006,
293     GLFW_VERSION_UNAVAILABLE = 0x00010007,
294     GLFW_PLATFORM_ERROR = 0x00010008,
295     GLFW_FORMAT_UNAVAILABLE = 0x00010009,
296     GLFW_NO_WINDOW_CONTEXT = 0x0001000A,    // Added in GLFW 3.2
297 }
298 
299 enum {
300     GLFW_FOCUSED = 0x00020001,
301     GLFW_ICONIFIED = 0x00020002,
302     GLFW_RESIZABLE = 0x00020003,
303     GLFW_VISIBLE = 0x00020004,
304     GLFW_DECORATED = 0x00020005,
305     GLFW_AUTO_ICONIFY = 0x00020006,     // Added in GLFW 3.1
306     GLFW_FLOATING = 0x00020007,         // ditto
307     GLFW_MAXIMIZED = 0x00020008,        // Added in GLFW 3.2
308     GLFW_CENTER_CURSOR = 0x00020009,    // Added in GLFW 3.3
309     GLFW_TRANSPARENT_FRAMEBUFFER = 0x0002000A, // ditto
310     GLFW_HOVERED = 0x0002000B,          // ditto
311     GLFW_FOCUS_ON_SHOW = 0x0002000C,    // ditto
312 }
313 
314 enum {
315     GLFW_RED_BITS = 0x00021001,
316     GLFW_GREEN_BITS = 0x00021002,
317     GLFW_BLUE_BITS = 0x00021003,
318     GLFW_ALPHA_BITS = 0x00021004,
319     GLFW_DEPTH_BITS = 0x00021005,
320     GLFW_STENCIL_BITS = 0x00021006,
321     GLFW_ACCUM_RED_BITS = 0x00021007,
322     GLFW_ACCUM_GREEN_BITS = 0x00021008,
323     GLFW_ACCUM_BLUE_BITS = 0x00021009,
324     GLFW_ACCUM_ALPHA_BITS = 0x0002100A,
325     GLFW_AUX_BUFFERS = 0x0002100B,
326     GLFW_STEREO = 0x0002100C,
327     GLFW_SAMPLES = 0x0002100D,
328     GLFW_SRGB_CAPABLE = 0x0002100E,
329     GLFW_REFRESH_RATE = 0x0002100F,
330     GLFW_DOUBLEBUFFER = 0x00021010,     // Added in GLFW 3.1
331 }
332 
333 enum {
334     GLFW_CLIENT_API = 0x00022001,
335     GLFW_CONTEXT_VERSION_MAJOR = 0x00022002,
336     GLFW_CONTEXT_VERSION_MINOR = 0x00022003,
337     GLFW_CONTEXT_REVISION = 0x00022004,
338     GLFW_CONTEXT_ROBUSTNESS = 0x00022005,
339     GLFW_OPENGL_FORWARD_COMPAT = 0x00022006,
340     GLFW_OPENGL_DEBUG_CONTEXT = 0x00022007,
341     GLFW_OPENGL_PROFILE = 0x00022008,
342     GLFW_CONTEXT_RELEASE_BEHAVIOR = 0x00022009, // Added in GLFW 3.1
343     GLFW_CONTEXT_NO_ERROR = 0x0002200A,         // Added in GLFW 3.2
344     GLFW_CONTEXT_CREATION_API = 0x0002200B,     // ditto
345     GLFW_SCALE_TO_MONITOR = 0x0002200C,         // Added in GLFW 3.3
346     GLFW_COCOA_RETINA_FRAMEBUFFER = 0x00023001, // ditto
347     GLFW_COCOA_FRAME_NAME = 0x00023002,         // ditto
348     GLFW_COCOA_GRAPHICS_SWITCHING = 0x00023003, // ditto
349     GLFW_X11_CLASS_NAME = 0x00024001,           // ditto
350     GLFW_X11_INSTANCE_NAME = 0x00024002,        // ditto
351 }
352 
353 enum {
354     GLFW_NO_API = 0,                    // Added in GLFW 3.2
355     GLFW_OPENGL_API    = 0x00030001,
356     GLFW_OPENGL_ES_API = 0x00030002,
357 
358     GLFW_NO_ROBUSTNESS = 0,
359     GLFW_NO_RESET_NOTIFICATION = 0x00031001,
360     GLFW_LOSE_CONTEXT_ON_RESET = 0x00031002,
361 
362     GLFW_OPENGL_ANY_PROFILE = 0,
363     GLFW_OPENGL_CORE_PROFILE = 0x00032001,
364     GLFW_OPENGL_COMPAT_PROFILE = 0x00032002,
365 
366     GLFW_CURSOR = 0x00033001,
367     GLFW_STICKY_KEYS = 0x00033002,
368     GLFW_STICKY_MOUSE_BUTTONS = 0x00033003,
369     GLFW_LOCK_KEY_MODS = 0x00033004,        // Added in GLFW 3.3
370     GLFW_RAW_MOUSE_MOTION = 0x00033005,     // ditto
371 
372     GLFW_CURSOR_NORMAL = 0x00034001,
373     GLFW_CURSOR_HIDDEN = 0x00034002,
374     GLFW_CURSOR_DISABLED = 0x00034003,
375 
376     GLFW_ANY_RELEASE_BEHAVIOR = 0,              // Added in GLFW 3.1
377     GLFW_RELEASE_BEHAVIOR_FLUSH = 0x00035001,   // ditto
378     GLFW_RELEASE_BEHAVIOR_NONE = 0x00035002,    // ditto
379 
380     GLFW_NATIVE_CONTEXT_API = 0x00036001,       // Added in GLFW 3.1
381     GLFW_EGL_CONTEXT_API = 0x00036002,          // ditto
382     GLFW_OSMESA_CONTEXT_API = 0x00036003,       // Added in GLFW 3.3
383 
384     GLFW_ARROW_CURSOR = 0x00036001,             // Added in GLFW 3.1
385     GLFW_IBEAM_CURSOR = 0x00036002,             // ditto
386     GLFW_CROSSHAIR_CURSOR = 0x00036003,         // ditto
387     GLFW_HAND_CURSOR = 0x00036004,              // ditto
388     GLFW_HRESIZE_CURSOR = 0x00036005,           // ditto
389     GLFW_VRESIZE_CURSOR = 0x00036006,           // ditto
390 
391     GLFW_CONNECTED = 0x00040001,
392     GLFW_DISCONNECTED = 0x00040002,
393 
394     GLFW_JOYSTICK_HAT_BUTTONS = 0x00050001,     // Added in GLFW 3.3
395     GLFW_COCOA_CHDIR_RESOURCES = 0x00051001,    // ditto
396     GLFW_COCOA_MENUBAR = 0x00051002,            // ditto
397 }
398 
399 enum GLFW_DONT_CARE = -1;       // Added in GLFW 3.1
400 
401 extern(C) @nogc nothrow {
402     alias GLFWglproc = void function();
403     static if(glfwSupport >= GLFWSupport.glfw32) alias GLFWvkproc = void function();
404 }
405 
406 struct GLFWmonitor;
407 struct GLFWwindow;
408 static if(glfwSupport >= GLFWSupport.glfw31) struct GLFWcursor;
409 
410 version(BindGLFW_NoGC_Callbacks) {
411     extern(C) @nogc nothrow {
412         alias GLFWerrorfun = void function(int,const(char)*);
413         alias GLFWwindowposfun = void function(GLFWwindow*,int,int);
414         alias GLFWwindowsizefun = void function(GLFWwindow*,int,int);
415         alias GLFWwindowclosefun = void function(GLFWwindow*);
416         alias GLFWwindowrefreshfun = void function(GLFWwindow*);
417         alias GLFWwindowfocusfun = void function(GLFWwindow*,int);
418         alias GLFWwindowiconifyfun = void function(GLFWwindow*,int);
419         static if(glfwSupport >= GLFWSupport.glfw33) alias GLFWwindowmaximizefun = void function(GLFWwindow*,int);
420         alias GLFWframebuffersizefun = void function(GLFWwindow*,int,int);
421         static if(glfwSupport >= GLFWSupport.glfw33) alias GLFWwindowcontentscalefun = void function(GLFWwindow*,float,float);
422         alias GLFWmousebuttonfun = void function(GLFWwindow*,int,int,int);
423         alias GLFWcursorposfun = void function(GLFWwindow*,double,double);
424         alias GLFWcursorenterfun = void function(GLFWwindow*,int);
425         alias GLFWscrollfun = void function(GLFWwindow*,double,double);
426         alias GLFWkeyfun = void function(GLFWwindow*,int,int,int,int);
427         alias GLFWcharfun = void function(GLFWwindow*,uint);
428         static if(glfwSupport >= GLFWSupport.glfw31) {
429             alias GLFWcharmodsfun = void function(GLFWwindow*,uint,int);
430             alias GLFWdropfun = void function(GLFWwindow*,int,const(char*)*);
431         }
432         alias GLFWmonitorfun = void function(GLFWmonitor*,int);
433         static if(glfwSupport >= GLFWSupport.glfw32) alias GLFWjoystickfun = void function(int,int);
434     }
435 }
436 else {
437     extern(C) nothrow {
438         alias GLFWerrorfun = void function(int,const(char)*);
439         alias GLFWwindowposfun = void function(GLFWwindow*,int,int);
440         alias GLFWwindowsizefun = void function(GLFWwindow*,int,int);
441         alias GLFWwindowclosefun = void function(GLFWwindow*);
442         alias GLFWwindowrefreshfun = void function(GLFWwindow*);
443         alias GLFWwindowfocusfun = void function(GLFWwindow*,int);
444         alias GLFWwindowiconifyfun = void function(GLFWwindow*,int);
445         static if(glfwSupport >= GLFWSupport.glfw33) alias GLFWwindowmaximizefun = void function(GLFWwindow*,int);
446         alias GLFWframebuffersizefun = void function(GLFWwindow*,int,int);
447         static if(glfwSupport >= GLFWSupport.glfw33) alias GLFWwindowcontentscalefun = void function(GLFWwindow*,float,float);
448         alias GLFWmousebuttonfun = void function(GLFWwindow*,int,int,int);
449         alias GLFWcursorposfun = void function(GLFWwindow*,double,double);
450         alias GLFWcursorenterfun = void function(GLFWwindow*,int);
451         alias GLFWscrollfun = void function(GLFWwindow*,double,double);
452         alias GLFWkeyfun = void function(GLFWwindow*,int,int,int,int);
453         alias GLFWcharfun = void function(GLFWwindow*,uint);
454         static if(glfwSupport >= GLFWSupport.glfw31) {
455             alias GLFWcharmodsfun = void function(GLFWwindow*,uint,int);
456             alias GLFWdropfun = void function(GLFWwindow*,int,const(char*)*);
457         }
458         alias GLFWmonitorfun = void function(GLFWmonitor*,int);
459         static if(glfwSupport >= GLFWSupport.glfw32) alias GLFWjoystickfun = void function(int,int);
460     }
461 }
462 
463 struct GLFWvidmode {
464     int width;
465     int height;
466     int redBits;
467     int greenBits;
468     int blueBits;
469     int refreshRate;
470 }
471 
472 struct GLFWgammaramp {
473     ushort* red;
474     ushort* green;
475     ushort* blue;
476     uint size;
477 }
478 
479 static if(glfwSupport >= GLFWSupport.glfw31) {
480     struct GLFWimage {
481         int width;
482         int height;
483         ubyte* pixels;
484     }
485 }
486 
487 static if(glfwSupport >= GLFWSupport.glfw33) {
488     struct GLFWgamepadstate {
489         ubyte[15] buttons;
490         float[6] axes;
491     }
492 }