GLFW

- Documentation
- Download
- Community

glfw3.h
Go to the documentation of this file.
1 /*************************************************************************
2 * GLFW 3.3 - www.glfw.org
3 * A library for OpenGL, window and input
4 *------------------------------------------------------------------------
5 * Copyright (c) 2002-2006 Marcus Geelnard
6 * Copyright (c) 2006-2019 Camilla Löwy <elmindreda@glfw.org>
7 *
8 * This software is provided 'as-is', without any express or implied
9 * warranty. In no event will the authors be held liable for any damages
10 * arising from the use of this software.
11 *
12 * Permission is granted to anyone to use this software for any purpose,
13 * including commercial applications, and to alter it and redistribute it
14 * freely, subject to the following restrictions:
15 *
16 * 1. The origin of this software must not be misrepresented; you must not
17 * claim that you wrote the original software. If you use this software
18 * in a product, an acknowledgment in the product documentation would
19 * be appreciated but is not required.
20 *
21 * 2. Altered source versions must be plainly marked as such, and must not
22 * be misrepresented as being the original software.
23 *
24 * 3. This notice may not be removed or altered from any source
25 * distribution.
26 *
27 *************************************************************************/
28
29 #ifndef _glfw3_h_
30 #define _glfw3_h_
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36
37 /*************************************************************************
38 * Doxygen documentation
39 *************************************************************************/
40
89 /*************************************************************************
90 * Compiler- and platform-specific preprocessor work
91 *************************************************************************/
92
93 /* If we are we on Windows, we want a single define for it.
94 */
95 #if !defined(_WIN32) && (defined(__WIN32__) || defined(WIN32) || defined(__MINGW32__))
96 #define _WIN32
97 #endif /* _WIN32 */
98
99 /* It is customary to use APIENTRY for OpenGL function pointer declarations on
100 * all platforms. Additionally, the Windows OpenGL header needs APIENTRY.
101 */
102 #ifndef APIENTRY
103 #ifdef _WIN32
104 #define APIENTRY __stdcall
105 #else
106 #define APIENTRY
107 #endif
108 #define GLFW_APIENTRY_DEFINED
109 #endif /* APIENTRY */
110
111 /* Some Windows OpenGL headers need this.
112 */
113 #if !defined(WINGDIAPI) && defined(_WIN32)
114 #define WINGDIAPI __declspec(dllimport)
115 #define GLFW_WINGDIAPI_DEFINED
116 #endif /* WINGDIAPI */
117
118 /* Some Windows GLU headers need this.
119 */
120 #if !defined(CALLBACK) && defined(_WIN32)
121 #define CALLBACK __stdcall
122 #define GLFW_CALLBACK_DEFINED
123 #endif /* CALLBACK */
124
125 /* Include because most Windows GLU headers need wchar_t and
126 * the macOS OpenGL header blocks the definition of ptrdiff_t by glext.h.
127 * Include it unconditionally to avoid surprising side-effects.
128 */
129 #include <stddef.h>
130
131 /* Include because it is needed by Vulkan and related functions.
132 * Include it unconditionally to avoid surprising side-effects.
133 */
134 #include <stdint.h>
135
136 /* Include the chosen OpenGL or OpenGL ES headers.
137 */
138 #if defined(GLFW_INCLUDE_ES1)
139
140 #include <GLES/gl.h>
141 #if defined(GLFW_INCLUDE_GLEXT)
142 #include <GLES/glext.h>
143 #endif
144
145 #elif defined(GLFW_INCLUDE_ES2)
146
147 #include <GLES2/gl2.h>
148 #if defined(GLFW_INCLUDE_GLEXT)
149 #include <GLES2/gl2ext.h>
150 #endif
151
152 #elif defined(GLFW_INCLUDE_ES3)
153
154 #include <GLES3/gl3.h>
155 #if defined(GLFW_INCLUDE_GLEXT)
156 #include <GLES2/gl2ext.h>
157 #endif
158
159 #elif defined(GLFW_INCLUDE_ES31)
160
161 #include <GLES3/gl31.h>
162 #if defined(GLFW_INCLUDE_GLEXT)
163 #include <GLES2/gl2ext.h>
164 #endif
165
166 #elif defined(GLFW_INCLUDE_ES32)
167
168 #include <GLES3/gl32.h>
169 #if defined(GLFW_INCLUDE_GLEXT)
170 #include <GLES2/gl2ext.h>
171 #endif
172
173 #elif defined(GLFW_INCLUDE_GLCOREARB)
174
175 #if defined(__APPLE__)
176
177 #include <OpenGL/gl3.h>
178 #if defined(GLFW_INCLUDE_GLEXT)
179 #include <OpenGL/gl3ext.h>
180 #endif /*GLFW_INCLUDE_GLEXT*/
181
182 #else /*__APPLE__*/
183
184 #include <GL/glcorearb.h>
185
186 #endif /*__APPLE__*/
187
188 #elif !defined(GLFW_INCLUDE_NONE)
189
190 #if defined(__APPLE__)
191
192 #if !defined(GLFW_INCLUDE_GLEXT)
193 #define GL_GLEXT_LEGACY
194 #endif
195 #include <OpenGL/gl.h>
196 #if defined(GLFW_INCLUDE_GLU)
197 #include <OpenGL/glu.h>
198 #endif
199
200 #else /*__APPLE__*/
201
202 #include <GL/gl.h>
203 #if defined(GLFW_INCLUDE_GLEXT)
204 #include <GL/glext.h>
205 #endif
206 #if defined(GLFW_INCLUDE_GLU)
207 #include <GL/glu.h>
208 #endif
209
210 #endif /*__APPLE__*/
211
212 #endif /* OpenGL and OpenGL ES headers */
213
214 #if defined(GLFW_INCLUDE_VULKAN)
215 #include <vulkan/vulkan.h>
216 #endif /* Vulkan header */
217
218 #if defined(GLFW_DLL) && defined(_GLFW_BUILD_DLL)
219 /* GLFW_DLL must be defined by applications that are linking against the DLL
220 * version of the GLFW library. _GLFW_BUILD_DLL is defined by the GLFW
221 * configuration header when compiling the DLL version of the library.
222 */
223 #error "You must not have both GLFW_DLL and _GLFW_BUILD_DLL defined"
224 #endif
225
226 /* GLFWAPI is used to declare public API functions for export
227 * from the DLL / shared library / dynamic library.
228 */
229 #if defined(_WIN32) && defined(_GLFW_BUILD_DLL)
230 /* We are building GLFW as a Win32 DLL */
231 #define GLFWAPI __declspec(dllexport)
232 #elif defined(_WIN32) && defined(GLFW_DLL)
233 /* We are calling GLFW as a Win32 DLL */
234 #define GLFWAPI __declspec(dllimport)
235 #elif defined(__GNUC__) && defined(_GLFW_BUILD_DLL)
236 /* We are building GLFW as a shared / dynamic library */
237 #define GLFWAPI __attribute__((visibility("default")))
238 #else
239 /* We are building or calling GLFW as a static library */
240 #define GLFWAPI
241 #endif
242
243
244 /*************************************************************************
245 * GLFW API tokens
246 *************************************************************************/
247
255 #define GLFW_VERSION_MAJOR 3
256
262 #define GLFW_VERSION_MINOR 3
263
269 #define GLFW_VERSION_REVISION 0
270
280 #define GLFW_TRUE 1
281
289 #define GLFW_FALSE 0
290
299 #define GLFW_RELEASE 0
300
306 #define GLFW_PRESS 1
307
313 #define GLFW_REPEAT 2
314
323 #define GLFW_HAT_CENTERED 0
324 #define GLFW_HAT_UP 1
325 #define GLFW_HAT_RIGHT 2
326 #define GLFW_HAT_DOWN 4
327 #define GLFW_HAT_LEFT 8
328 #define GLFW_HAT_RIGHT_UP (GLFW_HAT_RIGHT | GLFW_HAT_UP)
329 #define GLFW_HAT_RIGHT_DOWN (GLFW_HAT_RIGHT | GLFW_HAT_DOWN)
330 #define GLFW_HAT_LEFT_UP (GLFW_HAT_LEFT | GLFW_HAT_UP)
331 #define GLFW_HAT_LEFT_DOWN (GLFW_HAT_LEFT | GLFW_HAT_DOWN)
332
358 /* The unknown key */
359 #define GLFW_KEY_UNKNOWN -1
360
361 /* Printable keys */
362 #define GLFW_KEY_SPACE 32
363 #define GLFW_KEY_APOSTROPHE 39 /* ' */
364 #define GLFW_KEY_COMMA 44 /* , */
365 #define GLFW_KEY_MINUS 45 /* - */
366 #define GLFW_KEY_PERIOD 46 /* . */
367 #define GLFW_KEY_SLASH 47 /* / */
368 #define GLFW_KEY_0 48
369 #define GLFW_KEY_1 49
370 #define GLFW_KEY_2 50
371 #define GLFW_KEY_3 51
372 #define GLFW_KEY_4 52
373 #define GLFW_KEY_5 53
374 #define GLFW_KEY_6 54
375 #define GLFW_KEY_7 55
376 #define GLFW_KEY_8 56
377 #define GLFW_KEY_9 57
378 #define GLFW_KEY_SEMICOLON 59 /* ; */
379 #define GLFW_KEY_EQUAL 61 /* = */
380 #define GLFW_KEY_A 65
381 #define GLFW_KEY_B 66
382 #define GLFW_KEY_C 67
383 #define GLFW_KEY_D 68
384 #define GLFW_KEY_E 69
385 #define GLFW_KEY_F 70
386 #define GLFW_KEY_G 71
387 #define GLFW_KEY_H 72
388 #define GLFW_KEY_I 73
389 #define GLFW_KEY_J 74
390 #define GLFW_KEY_K 75
391 #define GLFW_KEY_L 76
392 #define GLFW_KEY_M 77
393 #define GLFW_KEY_N 78
394 #define GLFW_KEY_O 79
395 #define GLFW_KEY_P 80
396 #define GLFW_KEY_Q 81
397 #define GLFW_KEY_R 82
398 #define GLFW_KEY_S 83
399 #define GLFW_KEY_T 84
400 #define GLFW_KEY_U 85
401 #define GLFW_KEY_V 86
402 #define GLFW_KEY_W 87
403 #define GLFW_KEY_X 88
404 #define GLFW_KEY_Y 89
405 #define GLFW_KEY_Z 90
406 #define GLFW_KEY_LEFT_BRACKET 91 /* [ */
407 #define GLFW_KEY_BACKSLASH 92 /* \ */
408 #define GLFW_KEY_RIGHT_BRACKET 93 /* ] */
409 #define GLFW_KEY_GRAVE_ACCENT 96 /* ` */
410 #define GLFW_KEY_WORLD_1 161 /* non-US #1 */
411 #define GLFW_KEY_WORLD_2 162 /* non-US #2 */
412
413 /* Function keys */
414 #define GLFW_KEY_ESCAPE 256
415 #define GLFW_KEY_ENTER 257
416 #define GLFW_KEY_TAB 258
417 #define GLFW_KEY_BACKSPACE 259
418 #define GLFW_KEY_INSERT 260
419 #define GLFW_KEY_DELETE 261
420 #define GLFW_KEY_RIGHT 262
421 #define GLFW_KEY_LEFT 263
422 #define GLFW_KEY_DOWN 264
423 #define GLFW_KEY_UP 265
424 #define GLFW_KEY_PAGE_UP 266
425 #define GLFW_KEY_PAGE_DOWN 267
426 #define GLFW_KEY_HOME 268
427 #define GLFW_KEY_END 269
428 #define GLFW_KEY_CAPS_LOCK 280
429 #define GLFW_KEY_SCROLL_LOCK 281
430 #define GLFW_KEY_NUM_LOCK 282
431 #define GLFW_KEY_PRINT_SCREEN 283
432 #define GLFW_KEY_PAUSE 284
433 #define GLFW_KEY_F1 290
434 #define GLFW_KEY_F2 291
435 #define GLFW_KEY_F3 292
436 #define GLFW_KEY_F4 293
437 #define GLFW_KEY_F5 294
438 #define GLFW_KEY_F6 295
439 #define GLFW_KEY_F7 296
440 #define GLFW_KEY_F8 297
441 #define GLFW_KEY_F9 298
442 #define GLFW_KEY_F10 299
443 #define GLFW_KEY_F11 300
444 #define GLFW_KEY_F12 301
445 #define GLFW_KEY_F13 302
446 #define GLFW_KEY_F14 303
447 #define GLFW_KEY_F15 304
448 #define GLFW_KEY_F16 305
449 #define GLFW_KEY_F17 306
450 #define GLFW_KEY_F18 307
451 #define GLFW_KEY_F19 308
452 #define GLFW_KEY_F20 309
453 #define GLFW_KEY_F21 310
454 #define GLFW_KEY_F22 311
455 #define GLFW_KEY_F23 312
456 #define GLFW_KEY_F24 313
457 #define GLFW_KEY_F25 314
458 #define GLFW_KEY_KP_0 320
459 #define GLFW_KEY_KP_1 321
460 #define GLFW_KEY_KP_2 322
461 #define GLFW_KEY_KP_3 323
462 #define GLFW_KEY_KP_4 324
463 #define GLFW_KEY_KP_5 325
464 #define GLFW_KEY_KP_6 326
465 #define GLFW_KEY_KP_7 327
466 #define GLFW_KEY_KP_8 328
467 #define GLFW_KEY_KP_9 329
468 #define GLFW_KEY_KP_DECIMAL 330
469 #define GLFW_KEY_KP_DIVIDE 331
470 #define GLFW_KEY_KP_MULTIPLY 332
471 #define GLFW_KEY_KP_SUBTRACT 333
472 #define GLFW_KEY_KP_ADD 334
473 #define GLFW_KEY_KP_ENTER 335
474 #define GLFW_KEY_KP_EQUAL 336
475 #define GLFW_KEY_LEFT_SHIFT 340
476 #define GLFW_KEY_LEFT_CONTROL 341
477 #define GLFW_KEY_LEFT_ALT 342
478 #define GLFW_KEY_LEFT_SUPER 343
479 #define GLFW_KEY_RIGHT_SHIFT 344
480 #define GLFW_KEY_RIGHT_CONTROL 345
481 #define GLFW_KEY_RIGHT_ALT 346
482 #define GLFW_KEY_RIGHT_SUPER 347
483 #define GLFW_KEY_MENU 348
484
485 #define GLFW_KEY_LAST GLFW_KEY_MENU
486
501 #define GLFW_MOD_SHIFT 0x0001
502
506 #define GLFW_MOD_CONTROL 0x0002
507
511 #define GLFW_MOD_ALT 0x0004
512
516 #define GLFW_MOD_SUPER 0x0008
517
522 #define GLFW_MOD_CAPS_LOCK 0x0010
523
528 #define GLFW_MOD_NUM_LOCK 0x0020
529
539 #define GLFW_MOUSE_BUTTON_1 0
540 #define GLFW_MOUSE_BUTTON_2 1
541 #define GLFW_MOUSE_BUTTON_3 2
542 #define GLFW_MOUSE_BUTTON_4 3
543 #define GLFW_MOUSE_BUTTON_5 4
544 #define GLFW_MOUSE_BUTTON_6 5
545 #define GLFW_MOUSE_BUTTON_7 6
546 #define GLFW_MOUSE_BUTTON_8 7
547 #define GLFW_MOUSE_BUTTON_LAST GLFW_MOUSE_BUTTON_8
548 #define GLFW_MOUSE_BUTTON_LEFT GLFW_MOUSE_BUTTON_1
549 #define GLFW_MOUSE_BUTTON_RIGHT GLFW_MOUSE_BUTTON_2
550 #define GLFW_MOUSE_BUTTON_MIDDLE GLFW_MOUSE_BUTTON_3
551
560 #define GLFW_JOYSTICK_1 0
561 #define GLFW_JOYSTICK_2 1
562 #define GLFW_JOYSTICK_3 2
563 #define GLFW_JOYSTICK_4 3
564 #define GLFW_JOYSTICK_5 4
565 #define GLFW_JOYSTICK_6 5
566 #define GLFW_JOYSTICK_7 6
567 #define GLFW_JOYSTICK_8 7
568 #define GLFW_JOYSTICK_9 8
569 #define GLFW_JOYSTICK_10 9
570 #define GLFW_JOYSTICK_11 10
571 #define GLFW_JOYSTICK_12 11
572 #define GLFW_JOYSTICK_13 12
573 #define GLFW_JOYSTICK_14 13
574 #define GLFW_JOYSTICK_15 14
575 #define GLFW_JOYSTICK_16 15
576 #define GLFW_JOYSTICK_LAST GLFW_JOYSTICK_16
577
586 #define GLFW_GAMEPAD_BUTTON_A 0
587 #define GLFW_GAMEPAD_BUTTON_B 1
588 #define GLFW_GAMEPAD_BUTTON_X 2
589 #define GLFW_GAMEPAD_BUTTON_Y 3
590 #define GLFW_GAMEPAD_BUTTON_LEFT_BUMPER 4
591 #define GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER 5
592 #define GLFW_GAMEPAD_BUTTON_BACK 6
593 #define GLFW_GAMEPAD_BUTTON_START 7
594 #define GLFW_GAMEPAD_BUTTON_GUIDE 8
595 #define GLFW_GAMEPAD_BUTTON_LEFT_THUMB 9
596 #define GLFW_GAMEPAD_BUTTON_RIGHT_THUMB 10
597 #define GLFW_GAMEPAD_BUTTON_DPAD_UP 11
598 #define GLFW_GAMEPAD_BUTTON_DPAD_RIGHT 12
599 #define GLFW_GAMEPAD_BUTTON_DPAD_DOWN 13
600 #define GLFW_GAMEPAD_BUTTON_DPAD_LEFT 14
601 #define GLFW_GAMEPAD_BUTTON_LAST GLFW_GAMEPAD_BUTTON_DPAD_LEFT
602
603 #define GLFW_GAMEPAD_BUTTON_CROSS GLFW_GAMEPAD_BUTTON_A
604 #define GLFW_GAMEPAD_BUTTON_CIRCLE GLFW_GAMEPAD_BUTTON_B
605 #define GLFW_GAMEPAD_BUTTON_SQUARE GLFW_GAMEPAD_BUTTON_X
606 #define GLFW_GAMEPAD_BUTTON_TRIANGLE GLFW_GAMEPAD_BUTTON_Y
607
616 #define GLFW_GAMEPAD_AXIS_LEFT_X 0
617 #define GLFW_GAMEPAD_AXIS_LEFT_Y 1
618 #define GLFW_GAMEPAD_AXIS_RIGHT_X 2
619 #define GLFW_GAMEPAD_AXIS_RIGHT_Y 3
620 #define GLFW_GAMEPAD_AXIS_LEFT_TRIGGER 4
621 #define GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER 5
622 #define GLFW_GAMEPAD_AXIS_LAST GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER
623
638 #define GLFW_NO_ERROR 0
639
647 #define GLFW_NOT_INITIALIZED 0x00010001
648
657 #define GLFW_NO_CURRENT_CONTEXT 0x00010002
658
665 #define GLFW_INVALID_ENUM 0x00010003
666
676 #define GLFW_INVALID_VALUE 0x00010004
677
684 #define GLFW_OUT_OF_MEMORY 0x00010005
685
700 #define GLFW_API_UNAVAILABLE 0x00010006
701
717 #define GLFW_VERSION_UNAVAILABLE 0x00010007
718
728 #define GLFW_PLATFORM_ERROR 0x00010008
729
747 #define GLFW_FORMAT_UNAVAILABLE 0x00010009
748
755 #define GLFW_NO_WINDOW_CONTEXT 0x0001000A
756
765 #define GLFW_FOCUSED 0x00020001
766
770 #define GLFW_ICONIFIED 0x00020002
771
776 #define GLFW_RESIZABLE 0x00020003
777
782 #define GLFW_VISIBLE 0x00020004
783
788 #define GLFW_DECORATED 0x00020005
789
794 #define GLFW_AUTO_ICONIFY 0x00020006
795
800 #define GLFW_FLOATING 0x00020007
801
806 #define GLFW_MAXIMIZED 0x00020008
807
811 #define GLFW_CENTER_CURSOR 0x00020009
812
818 #define GLFW_TRANSPARENT_FRAMEBUFFER 0x0002000A
819
823 #define GLFW_HOVERED 0x0002000B
824
829 #define GLFW_FOCUS_ON_SHOW 0x0002000C
830
835 #define GLFW_RED_BITS 0x00021001
836
840 #define GLFW_GREEN_BITS 0x00021002
841
845 #define GLFW_BLUE_BITS 0x00021003
846
850 #define GLFW_ALPHA_BITS 0x00021004
851
855 #define GLFW_DEPTH_BITS 0x00021005
856
860 #define GLFW_STENCIL_BITS 0x00021006
861
865 #define GLFW_ACCUM_RED_BITS 0x00021007
866
870 #define GLFW_ACCUM_GREEN_BITS 0x00021008
871
875 #define GLFW_ACCUM_BLUE_BITS 0x00021009
876
880 #define GLFW_ACCUM_ALPHA_BITS 0x0002100A
881
885 #define GLFW_AUX_BUFFERS 0x0002100B
886
890 #define GLFW_STEREO 0x0002100C
891
895 #define GLFW_SAMPLES 0x0002100D
896
900 #define GLFW_SRGB_CAPABLE 0x0002100E
901
905 #define GLFW_REFRESH_RATE 0x0002100F
906
910 #define GLFW_DOUBLEBUFFER 0x00021010
911
917 #define GLFW_CLIENT_API 0x00022001
918
923 #define GLFW_CONTEXT_VERSION_MAJOR 0x00022002
924
929 #define GLFW_CONTEXT_VERSION_MINOR 0x00022003
930
935 #define GLFW_CONTEXT_REVISION 0x00022004
936
941 #define GLFW_CONTEXT_ROBUSTNESS 0x00022005
942
947 #define GLFW_OPENGL_FORWARD_COMPAT 0x00022006
948
953 #define GLFW_OPENGL_DEBUG_CONTEXT 0x00022007
954
959 #define GLFW_OPENGL_PROFILE 0x00022008
960
965 #define GLFW_CONTEXT_RELEASE_BEHAVIOR 0x00022009
966
971 #define GLFW_CONTEXT_NO_ERROR 0x0002200A
972
977 #define GLFW_CONTEXT_CREATION_API 0x0002200B
978
981 #define GLFW_SCALE_TO_MONITOR 0x0002200C
982
985 #define GLFW_COCOA_RETINA_FRAMEBUFFER 0x00023001
986
989 #define GLFW_COCOA_FRAME_NAME 0x00023002
990
993 #define GLFW_COCOA_GRAPHICS_SWITCHING 0x00023003
994
997 #define GLFW_X11_CLASS_NAME 0x00024001
998
1001 #define GLFW_X11_INSTANCE_NAME 0x00024002
1002
1004 #define GLFW_NO_API 0
1005 #define GLFW_OPENGL_API 0x00030001
1006 #define GLFW_OPENGL_ES_API 0x00030002
1007
1008 #define GLFW_NO_ROBUSTNESS 0
1009 #define GLFW_NO_RESET_NOTIFICATION 0x00031001
1010 #define GLFW_LOSE_CONTEXT_ON_RESET 0x00031002
1011
1012 #define GLFW_OPENGL_ANY_PROFILE 0
1013 #define GLFW_OPENGL_CORE_PROFILE 0x00032001
1014 #define GLFW_OPENGL_COMPAT_PROFILE 0x00032002
1015
1016 #define GLFW_CURSOR 0x00033001
1017 #define GLFW_STICKY_KEYS 0x00033002
1018 #define GLFW_STICKY_MOUSE_BUTTONS 0x00033003
1019 #define GLFW_LOCK_KEY_MODS 0x00033004
1020 #define GLFW_RAW_MOUSE_MOTION 0x00033005
1021
1022 #define GLFW_CURSOR_NORMAL 0x00034001
1023 #define GLFW_CURSOR_HIDDEN 0x00034002
1024 #define GLFW_CURSOR_DISABLED 0x00034003
1025
1026 #define GLFW_ANY_RELEASE_BEHAVIOR 0
1027 #define GLFW_RELEASE_BEHAVIOR_FLUSH 0x00035001
1028 #define GLFW_RELEASE_BEHAVIOR_NONE 0x00035002
1029
1030 #define GLFW_NATIVE_CONTEXT_API 0x00036001
1031 #define GLFW_EGL_CONTEXT_API 0x00036002
1032 #define GLFW_OSMESA_CONTEXT_API 0x00036003
1033
1046 #define GLFW_ARROW_CURSOR 0x00036001
1047
1051 #define GLFW_IBEAM_CURSOR 0x00036002
1052
1056 #define GLFW_CROSSHAIR_CURSOR 0x00036003
1057
1061 #define GLFW_HAND_CURSOR 0x00036004
1062
1066 #define GLFW_HRESIZE_CURSOR 0x00036005
1067
1071 #define GLFW_VRESIZE_CURSOR 0x00036006
1072
1074 #define GLFW_CONNECTED 0x00040001
1075 #define GLFW_DISCONNECTED 0x00040002
1076
1083 #define GLFW_JOYSTICK_HAT_BUTTONS 0x00050001
1084
1088 #define GLFW_COCOA_CHDIR_RESOURCES 0x00051001
1089
1093 #define GLFW_COCOA_MENUBAR 0x00051002
1094
1096 #define GLFW_DONT_CARE -1
1097
1098
1099 /*************************************************************************
1100 * GLFW API types
1101 *************************************************************************/
1102
1115 typedef void (*GLFWglproc)(void);
1116
1129 typedef void (*GLFWvkproc)(void);
1130
1141 typedef struct GLFWmonitor GLFWmonitor;
1142
1153 typedef struct GLFWwindow GLFWwindow;
1154
1165 typedef struct GLFWcursor GLFWcursor;
1166
1181 typedef void (* GLFWerrorfun)(int,const char*);
1182
1200 typedef void (* GLFWwindowposfun)(GLFWwindow*,int,int);
1201
1218 typedef void (* GLFWwindowsizefun)(GLFWwindow*,int,int);
1219
1234 typedef void (* GLFWwindowclosefun)(GLFWwindow*);
1235
1250 typedef void (* GLFWwindowrefreshfun)(GLFWwindow*);
1251
1267 typedef void (* GLFWwindowfocusfun)(GLFWwindow*,int);
1268
1285 typedef void (* GLFWwindowiconifyfun)(GLFWwindow*,int);
1286
1303 typedef void (* GLFWwindowmaximizefun)(GLFWwindow*,int);
1304
1321 typedef void (* GLFWframebuffersizefun)(GLFWwindow*,int,int);
1322
1339 typedef void (* GLFWwindowcontentscalefun)(GLFWwindow*,float,float);
1340
1360 typedef void (* GLFWmousebuttonfun)(GLFWwindow*,int,int,int);
1361
1379 typedef void (* GLFWcursorposfun)(GLFWwindow*,double,double);
1380
1396 typedef void (* GLFWcursorenterfun)(GLFWwindow*,int);
1397
1413 typedef void (* GLFWscrollfun)(GLFWwindow*,double,double);
1414
1434 typedef void (* GLFWkeyfun)(GLFWwindow*,int,int,int,int);
1435
1451 typedef void (* GLFWcharfun)(GLFWwindow*,unsigned int);
1452
1474 typedef void (* GLFWcharmodsfun)(GLFWwindow*,unsigned int,int);
1475
1491 typedef void (* GLFWdropfun)(GLFWwindow*,int,const char**);
1492
1508 typedef void (* GLFWmonitorfun)(GLFWmonitor*,int);
1509
1526 typedef void (* GLFWjoystickfun)(int,int);
1527
1541 typedef struct GLFWvidmode
1542 {
1545 int width;
1548 int height;
1551 int redBits;
1554 int greenBits;
1557 int blueBits;
1560 int refreshRate;
1561 } GLFWvidmode;
1562
1575 typedef struct GLFWgammaramp
1576 {
1579 unsigned short* red;
1582 unsigned short* green;
1585 unsigned short* blue;
1588 unsigned int size;
1589 } GLFWgammaramp;
1590
1604 typedef struct GLFWimage
1605 {
1608 int width;
1611 int height;
1614 unsigned char* pixels;
1615 } GLFWimage;
1616
1628 typedef struct GLFWgamepadstate
1629 {
1633 unsigned char buttons[15];
1637 float axes[6];
1638 } GLFWgamepadstate;
1639
1640
1641 /*************************************************************************
1642 * GLFW API functions
1643 *************************************************************************/
1644
1677 GLFWAPI int glfwInit(void);
1678
1709 GLFWAPI void glfwTerminate(void);
1710
1741 GLFWAPI void glfwInitHint(int hint, int value);
1742
1768 GLFWAPI void glfwGetVersion(int* major, int* minor, int* rev);
1769
1799 GLFWAPI const char* glfwGetVersionString(void);
1800
1830 GLFWAPI int glfwGetError(const char** description);
1831
1869 GLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun cbfun);
1870
1898 GLFWAPI GLFWmonitor** glfwGetMonitors(int* count);
1899
1922 GLFWAPI GLFWmonitor* glfwGetPrimaryMonitor(void);
1923
1947 GLFWAPI void glfwGetMonitorPos(GLFWmonitor* monitor, int* xpos, int* ypos);
1948
1978 GLFWAPI void glfwGetMonitorWorkarea(GLFWmonitor* monitor, int* xpos, int* ypos, int* width, int* height);
1979
2012 GLFWAPI void glfwGetMonitorPhysicalSize(GLFWmonitor* monitor, int* widthMM, int* heightMM);
2013
2044 GLFWAPI void glfwGetMonitorContentScale(GLFWmonitor* monitor, float* xscale, float* yscale);
2045
2070 GLFWAPI const char* glfwGetMonitorName(GLFWmonitor* monitor);
2071
2096 GLFWAPI void glfwSetMonitorUserPointer(GLFWmonitor* monitor, void* pointer);
2097
2120 GLFWAPI void* glfwGetMonitorUserPointer(GLFWmonitor* monitor);
2121
2143 GLFWAPI GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun cbfun);
2144
2176 GLFWAPI const GLFWvidmode* glfwGetVideoModes(GLFWmonitor* monitor, int* count);
2177
2204 GLFWAPI const GLFWvidmode* glfwGetVideoMode(GLFWmonitor* monitor);
2205
2237 GLFWAPI void glfwSetGamma(GLFWmonitor* monitor, float gamma);
2238
2267 GLFWAPI const GLFWgammaramp* glfwGetGammaRamp(GLFWmonitor* monitor);
2268
2308 GLFWAPI void glfwSetGammaRamp(GLFWmonitor* monitor, const GLFWgammaramp* ramp);
2309
2327 GLFWAPI void glfwDefaultWindowHints(void);
2328
2362 GLFWAPI void glfwWindowHint(int hint, int value);
2363
2400 GLFWAPI void glfwWindowHintString(int hint, const char* value);
2401
2554 GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, const char* title, GLFWmonitor* monitor, GLFWwindow* share);
2555
2583 GLFWAPI void glfwDestroyWindow(GLFWwindow* window);
2584
2603 GLFWAPI int glfwWindowShouldClose(GLFWwindow* window);
2604
2625 GLFWAPI void glfwSetWindowShouldClose(GLFWwindow* window, int value);
2626
2650 GLFWAPI void glfwSetWindowTitle(GLFWwindow* window, const char* title);
2651
2697 GLFWAPI void glfwSetWindowIcon(GLFWwindow* window, int count, const GLFWimage* images);
2698
2729 GLFWAPI void glfwGetWindowPos(GLFWwindow* window, int* xpos, int* ypos);
2730
2764 GLFWAPI void glfwSetWindowPos(GLFWwindow* window, int xpos, int ypos);
2765
2794 GLFWAPI void glfwGetWindowSize(GLFWwindow* window, int* width, int* height);
2795
2837 GLFWAPI void glfwSetWindowSizeLimits(GLFWwindow* window, int minwidth, int minheight, int maxwidth, int maxheight);
2838
2880 GLFWAPI void glfwSetWindowAspectRatio(GLFWwindow* window, int numer, int denom);
2881
2921 GLFWAPI void glfwSetWindowSize(GLFWwindow* window, int width, int height);
2922
2950 GLFWAPI void glfwGetFramebufferSize(GLFWwindow* window, int* width, int* height);
2951
2987 GLFWAPI void glfwGetWindowFrameSize(GLFWwindow* window, int* left, int* top, int* right, int* bottom);
2988
3020 GLFWAPI void glfwGetWindowContentScale(GLFWwindow* window, float* xscale, float* yscale);
3021
3047 GLFWAPI float glfwGetWindowOpacity(GLFWwindow* window);
3048
3076 GLFWAPI void glfwSetWindowOpacity(GLFWwindow* window, float opacity);
3077
3107 GLFWAPI void glfwIconifyWindow(GLFWwindow* window);
3108
3134 GLFWAPI void glfwRestoreWindow(GLFWwindow* window);
3135
3159 GLFWAPI void glfwMaximizeWindow(GLFWwindow* window);
3160
3186 GLFWAPI void glfwShowWindow(GLFWwindow* window);
3187
3208 GLFWAPI void glfwHideWindow(GLFWwindow* window);
3209
3247 GLFWAPI void glfwFocusWindow(GLFWwindow* window);
3248
3274 GLFWAPI void glfwRequestWindowAttention(GLFWwindow* window);
3275
3296 GLFWAPI GLFWmonitor* glfwGetWindowMonitor(GLFWwindow* window);
3297
3355 GLFWAPI void glfwSetWindowMonitor(GLFWwindow* window, GLFWmonitor* monitor, int xpos, int ypos, int width, int height, int refreshRate);
3356
3389 GLFWAPI int glfwGetWindowAttrib(GLFWwindow* window, int attrib);
3390
3426 GLFWAPI void glfwSetWindowAttrib(GLFWwindow* window, int attrib, int value);
3427
3449 GLFWAPI void glfwSetWindowUserPointer(GLFWwindow* window, void* pointer);
3450
3470 GLFWAPI void* glfwGetWindowUserPointer(GLFWwindow* window);
3471
3498 GLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* window, GLFWwindowposfun cbfun);
3499
3523 GLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwindowsizefun cbfun);
3524
3556 GLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwindowclosefun cbfun);
3557
3585 GLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow* window, GLFWwindowrefreshfun cbfun);
3586
3613 GLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* window, GLFWwindowfocusfun cbfun);
3614
3639 GLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* window, GLFWwindowiconifyfun cbfun);
3640
3662 GLFWAPI GLFWwindowmaximizefun glfwSetWindowMaximizeCallback(GLFWwindow* window, GLFWwindowmaximizefun cbfun);
3663
3685 GLFWAPI GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow* window, GLFWframebuffersizefun cbfun);
3686
3709 GLFWAPI GLFWwindowcontentscalefun glfwSetWindowContentScaleCallback(GLFWwindow* window, GLFWwindowcontentscalefun cbfun);
3710
3747 GLFWAPI void glfwPollEvents(void);
3748
3792 GLFWAPI void glfwWaitEvents(void);
3793
3841 GLFWAPI void glfwWaitEventsTimeout(double timeout);
3842
3861 GLFWAPI void glfwPostEmptyEvent(void);
3862
3886 GLFWAPI int glfwGetInputMode(GLFWwindow* window, int mode);
3887
3948 GLFWAPI void glfwSetInputMode(GLFWwindow* window, int mode, int value);
3949
3977 GLFWAPI int glfwRawMouseMotionSupported(void);
3978
4043 GLFWAPI const char* glfwGetKeyName(int key, int scancode);
4044
4067 GLFWAPI int glfwGetKeyScancode(int key);
4068
4107 GLFWAPI int glfwGetKey(GLFWwindow* window, int key);
4108
4136 GLFWAPI int glfwGetMouseButton(GLFWwindow* window, int button);
4137
4174 GLFWAPI void glfwGetCursorPos(GLFWwindow* window, double* xpos, double* ypos);
4175
4214 GLFWAPI void glfwSetCursorPos(GLFWwindow* window, double xpos, double ypos);
4215
4252 GLFWAPI GLFWcursor* glfwCreateCursor(const GLFWimage* image, int xhot, int yhot);
4253
4275 GLFWAPI GLFWcursor* glfwCreateStandardCursor(int shape);
4276
4302 GLFWAPI void glfwDestroyCursor(GLFWcursor* cursor);
4303
4329 GLFWAPI void glfwSetCursor(GLFWwindow* window, GLFWcursor* cursor);
4330
4372 GLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun cbfun);
4373
4408 GLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun cbfun);
4409
4443 GLFWAPI GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow* window, GLFWcharmodsfun cbfun);
4444
4473 GLFWAPI GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* window, GLFWmousebuttonfun cbfun);
4474
4498 GLFWAPI GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow* window, GLFWcursorposfun cbfun);
4499
4522 GLFWAPI GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* window, GLFWcursorenterfun cbfun);
4523
4549 GLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* window, GLFWscrollfun cbfun);
4550
4579 GLFWAPI GLFWdropfun glfwSetDropCallback(GLFWwindow* window, GLFWdropfun cbfun);
4580
4603 GLFWAPI int glfwJoystickPresent(int jid);
4604
4636 GLFWAPI const float* glfwGetJoystickAxes(int jid, int* count);
4637
4677 GLFWAPI const unsigned char* glfwGetJoystickButtons(int jid, int* count);
4678
4734 GLFWAPI const unsigned char* glfwGetJoystickHats(int jid, int* count);
4735
4765 GLFWAPI const char* glfwGetJoystickName(int jid);
4766
4806 GLFWAPI const char* glfwGetJoystickGUID(int jid);
4807
4832 GLFWAPI void glfwSetJoystickUserPointer(int jid, void* pointer);
4833
4856 GLFWAPI void* glfwGetJoystickUserPointer(int jid);
4857
4884 GLFWAPI int glfwJoystickIsGamepad(int jid);
4885
4913 GLFWAPI GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun cbfun);
4914
4947 GLFWAPI int glfwUpdateGamepadMappings(const char* string);
4948
4977 GLFWAPI const char* glfwGetGamepadName(int jid);
4978
5015 GLFWAPI int glfwGetGamepadState(int jid, GLFWgamepadstate* state);
5016
5040 GLFWAPI void glfwSetClipboardString(GLFWwindow* window, const char* string);
5041
5070 GLFWAPI const char* glfwGetClipboardString(GLFWwindow* window);
5071
5097 GLFWAPI double glfwGetTime(void);
5098
5124 GLFWAPI void glfwSetTime(double time);
5125
5146 GLFWAPI uint64_t glfwGetTimerValue(void);
5147
5166 GLFWAPI uint64_t glfwGetTimerFrequency(void);
5167
5204 GLFWAPI void glfwMakeContextCurrent(GLFWwindow* window);
5205
5225 GLFWAPI GLFWwindow* glfwGetCurrentContext(void);
5226
5259 GLFWAPI void glfwSwapBuffers(GLFWwindow* window);
5260
5305 GLFWAPI void glfwSwapInterval(int interval);
5306
5343 GLFWAPI int glfwExtensionSupported(const char* extension);
5344
5385 GLFWAPI GLFWglproc glfwGetProcAddress(const char* procname);
5386
5413 GLFWAPI int glfwVulkanSupported(void);
5414
5460 GLFWAPI const char** glfwGetRequiredInstanceExtensions(uint32_t* count);
5461
5462 #if defined(VK_VERSION_1_0)
5463
5503 GLFWAPI GLFWvkproc glfwGetInstanceProcAddress(VkInstance instance, const char* procname);
5504
5540 GLFWAPI int glfwGetPhysicalDevicePresentationSupport(VkInstance instance, VkPhysicalDevice device, uint32_t queuefamily);
5541
5601 GLFWAPI VkResult glfwCreateWindowSurface(VkInstance instance, GLFWwindow* window, const VkAllocationCallbacks* allocator, VkSurfaceKHR* surface);
5602
5603 #endif /*VK_VERSION_1_0*/
5604
5605
5606 /*************************************************************************
5607 * Global definition cleanup
5608 *************************************************************************/
5609
5610 /* ------------------- BEGIN SYSTEM/COMPILER SPECIFIC -------------------- */
5611
5612 #ifdef GLFW_WINGDIAPI_DEFINED
5613 #undef WINGDIAPI
5614 #undef GLFW_WINGDIAPI_DEFINED
5615 #endif
5616
5617 #ifdef GLFW_CALLBACK_DEFINED
5618 #undef CALLBACK
5619 #undef GLFW_CALLBACK_DEFINED
5620 #endif
5621
5622 /* Some OpenGL related headers need GLAPIENTRY, but it is unconditionally
5623 * defined by some gl.h variants (OpenBSD) so define it after if needed.
5624 */
5625 #ifndef GLAPIENTRY
5626 #define GLAPIENTRY APIENTRY
5627 #endif
5628
5629 /* -------------------- END SYSTEM/COMPILER SPECIFIC --------------------- */
5630
5631
5632 #ifdef __cplusplus
5633 }
5634 #endif
5635
5636 #endif /* _glfw3_h_ */
5637
glfwGetVersion
void glfwGetVersion(int *major, int *minor, int *rev)
Retrieves the version of the GLFW library.
GLFWgamepadstate
Gamepad input state.
Definition: glfw3.h:1628
GLFWvidmode::redBits
int redBits
Definition: glfw3.h:1551
glfwGetWindowSize
void glfwGetWindowSize(GLFWwindow *window, int *width, int *height)
Retrieves the size of the content area of the specified window.
glfwSetWindowSizeLimits
void glfwSetWindowSizeLimits(GLFWwindow *window, int minwidth, int minheight, int maxwidth, int maxheight)
Sets the size limits of the specified window.
GLFWwindowiconifyfun
void(* GLFWwindowiconifyfun)(GLFWwindow *, int)
The function signature for window iconify/restore callbacks.
Definition: glfw3.h:1285
glfwGetInputMode
int glfwGetInputMode(GLFWwindow *window, int mode)
Returns the value of an input option for the specified window.
GLFWvidmode::height
int height
Definition: glfw3.h:1548
glfwSetWindowRefreshCallback
GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow *window, GLFWwindowrefreshfun cbfun)
Sets the refresh callback for the specified window.
glfwSetWindowPosCallback
GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow *window, GLFWwindowposfun cbfun)
Sets the position callback for the specified window.
glfwGetJoystickGUID
const char * glfwGetJoystickGUID(int jid)
Returns the SDL comaptible GUID of the specified joystick.
glfwGetWindowPos
void glfwGetWindowPos(GLFWwindow *window, int *xpos, int *ypos)
Retrieves the position of the content area of the specified window.
glfwGetJoystickUserPointer
void * glfwGetJoystickUserPointer(int jid)
Returns the user pointer of the specified joystick.
GLFWcharmodsfun
void(* GLFWcharmodsfun)(GLFWwindow *, unsigned int, int)
The function signature for Unicode character with modifiers callbacks.
Definition: glfw3.h:1474
glfwGetKeyScancode
int glfwGetKeyScancode(int key)
Returns the platform-specific scancode of the specified key.
GLFWvidmode::blueBits
int blueBits
Definition: glfw3.h:1557
GLFWimage::pixels
unsigned char * pixels
Definition: glfw3.h:1614
GLFWmonitorfun
void(* GLFWmonitorfun)(GLFWmonitor *, int)
The function signature for monitor configuration callbacks.
Definition: glfw3.h:1508
glfwGetWindowUserPointer
void * glfwGetWindowUserPointer(GLFWwindow *window)
Returns the user pointer of the specified window.
glfwGetVideoModes
const GLFWvidmode * glfwGetVideoModes(GLFWmonitor *monitor, int *count)
Returns the available video modes for the specified monitor.
glfwGetGammaRamp
const GLFWgammaramp * glfwGetGammaRamp(GLFWmonitor *monitor)
Returns the current gamma ramp for the specified monitor.
glfwIconifyWindow
void glfwIconifyWindow(GLFWwindow *window)
Iconifies the specified window.
glfwSetErrorCallback
GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun cbfun)
Sets the error callback.
glfwGetTime
double glfwGetTime(void)
Returns the value of the GLFW timer.
glfwSetWindowIconifyCallback
GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow *window, GLFWwindowiconifyfun cbfun)
Sets the iconify callback for the specified window.
glfwGetError
int glfwGetError(const char **description)
Returns and clears the last error for the calling thread.
glfwSetCursorPos
void glfwSetCursorPos(GLFWwindow *window, double xpos, double ypos)
Sets the position of the cursor, relative to the content area of the window.
GLFWvidmode::width
int width
Definition: glfw3.h:1545
glfwGetVersionString
const char * glfwGetVersionString(void)
Returns a string describing the compile-time configuration.
glfwSetWindowSizeCallback
GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow *window, GLFWwindowsizefun cbfun)
Sets the size callback for the specified window.
glfwGetJoystickName
const char * glfwGetJoystickName(int jid)
Returns the name of the specified joystick.
GLFWimage
struct GLFWimage GLFWimage
Image data.
glfwWaitEvents
void glfwWaitEvents(void)
Waits until events are queued and processes them.
GLFWimage::height
int height
Definition: glfw3.h:1611
glfwSetKeyCallback
GLFWkeyfun glfwSetKeyCallback(GLFWwindow *window, GLFWkeyfun cbfun)
Sets the key callback.
glfwGetClipboardString
const char * glfwGetClipboardString(GLFWwindow *window)
Returns the contents of the clipboard as a string.
GLFWdropfun
void(* GLFWdropfun)(GLFWwindow *, int, const char **)
The function signature for file drop callbacks.
Definition: glfw3.h:1491
glfwGetJoystickAxes
const float * glfwGetJoystickAxes(int jid, int *count)
Returns the values of all axes of the specified joystick.
glfwGetMonitorUserPointer
void * glfwGetMonitorUserPointer(GLFWmonitor *monitor)
Returns the user pointer of the specified monitor.
glfwGetProcAddress
GLFWglproc glfwGetProcAddress(const char *procname)
Returns the address of the specified function for the current context.
glfwGetKeyName
const char * glfwGetKeyName(int key, int scancode)
Returns the layout-specific name of the specified printable key.
glfwSetWindowAttrib
void glfwSetWindowAttrib(GLFWwindow *window, int attrib, int value)
Sets an attribute of the specified window.
glfwGetCursorPos
void glfwGetCursorPos(GLFWwindow *window, double *xpos, double *ypos)
Retrieves the position of the cursor relative to the content area of the window.
glfwMaximizeWindow
void glfwMaximizeWindow(GLFWwindow *window)
Maximizes the specified window.
GLFWkeyfun
void(* GLFWkeyfun)(GLFWwindow *, int, int, int, int)
The function signature for keyboard key callbacks.
Definition: glfw3.h:1434
GLFWvidmode::refreshRate
int refreshRate
Definition: glfw3.h:1560
GLFWgammaramp::red
unsigned short * red
Definition: glfw3.h:1579
glfwGetGamepadState
int glfwGetGamepadState(int jid, GLFWgamepadstate *state)
Retrieves the state of the specified joystick remapped as a gamepad.
GLFWmousebuttonfun
void(* GLFWmousebuttonfun)(GLFWwindow *, int, int, int)
The function signature for mouse button callbacks.
Definition: glfw3.h:1360
glfwCreateWindowSurface
VkResult glfwCreateWindowSurface(VkInstance instance, GLFWwindow *window, const VkAllocationCallbacks *allocator, VkSurfaceKHR *surface)
Creates a Vulkan surface for the specified window.
glfwSetDropCallback
GLFWdropfun glfwSetDropCallback(GLFWwindow *window, GLFWdropfun cbfun)
Sets the file drop callback.
GLFWcharfun
void(* GLFWcharfun)(GLFWwindow *, unsigned int)
The function signature for Unicode character callbacks.
Definition: glfw3.h:1451
glfwJoystickIsGamepad
int glfwJoystickIsGamepad(int jid)
Returns whether the specified joystick has a gamepad mapping.
glfwSetCursor
void glfwSetCursor(GLFWwindow *window, GLFWcursor *cursor)
Sets the cursor for the window.
glfwGetMonitors
GLFWmonitor ** glfwGetMonitors(int *count)
Returns the currently connected monitors.
glfwDestroyWindow
void glfwDestroyWindow(GLFWwindow *window)
Destroys the specified window and its context.
glfwSetMonitorUserPointer
void glfwSetMonitorUserPointer(GLFWmonitor *monitor, void *pointer)
Sets the user pointer of the specified monitor.
glfwSetCursorPosCallback
GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow *window, GLFWcursorposfun cbfun)
Sets the cursor position callback.
GLFWgammaramp::green
unsigned short * green
Definition: glfw3.h:1582
glfwUpdateGamepadMappings
int glfwUpdateGamepadMappings(const char *string)
Adds the specified SDL_GameControllerDB gamepad mappings.
glfwSetCharCallback
GLFWcharfun glfwSetCharCallback(GLFWwindow *window, GLFWcharfun cbfun)
Sets the Unicode character callback.
glfwJoystickPresent
int glfwJoystickPresent(int jid)
Returns whether the specified joystick is present.
GLFWvkproc
void(* GLFWvkproc)(void)
Vulkan API function pointer type.
Definition: glfw3.h:1129
glfwGetGamepadName
const char * glfwGetGamepadName(int jid)
Returns the human-readable gamepad name for the specified joystick.
glfwSetWindowTitle
void glfwSetWindowTitle(GLFWwindow *window, const char *title)
Sets the title of the specified window.
GLFWmonitor
struct GLFWmonitor GLFWmonitor
Opaque monitor object.
Definition: glfw3.h:1141
GLFWwindow
struct GLFWwindow GLFWwindow
Opaque window object.
Definition: glfw3.h:1153
glfwGetMonitorPhysicalSize
void glfwGetMonitorPhysicalSize(GLFWmonitor *monitor, int *widthMM, int *heightMM)
Returns the physical size of the monitor.
glfwShowWindow
void glfwShowWindow(GLFWwindow *window)
Makes the specified window visible.
glfwSetWindowSize
void glfwSetWindowSize(GLFWwindow *window, int width, int height)
Sets the size of the content area of the specified window.
GLFWvidmode::greenBits
int greenBits
Definition: glfw3.h:1554
glfwCreateCursor
GLFWcursor * glfwCreateCursor(const GLFWimage *image, int xhot, int yhot)
Creates a custom cursor.
glfwDestroyCursor
void glfwDestroyCursor(GLFWcursor *cursor)
Destroys a cursor.
glfwRequestWindowAttention
void glfwRequestWindowAttention(GLFWwindow *window)
Requests user attention to the specified window.
glfwSwapBuffers
void glfwSwapBuffers(GLFWwindow *window)
Swaps the front and back buffers of the specified window.
glfwSetGamma
void glfwSetGamma(GLFWmonitor *monitor, float gamma)
Generates a gamma ramp and sets it for the specified monitor.
glfwGetJoystickButtons
const unsigned char * glfwGetJoystickButtons(int jid, int *count)
Returns the state of all buttons of the specified joystick.
glfwGetMonitorWorkarea
void glfwGetMonitorWorkarea(GLFWmonitor *monitor, int *xpos, int *ypos, int *width, int *height)
Retrives the work area of the monitor.
glfwSetInputMode
void glfwSetInputMode(GLFWwindow *window, int mode, int value)
Sets an input option for the specified window.
glfwRawMouseMotionSupported
int glfwRawMouseMotionSupported(void)
Returns whether raw mouse motion is supported.
glfwGetVideoMode
const GLFWvidmode * glfwGetVideoMode(GLFWmonitor *monitor)
Returns the current mode of the specified monitor.
glfwSetClipboardString
void glfwSetClipboardString(GLFWwindow *window, const char *string)
Sets the clipboard to the specified string.
glfwGetWindowFrameSize
void glfwGetWindowFrameSize(GLFWwindow *window, int *left, int *top, int *right, int *bottom)
Retrieves the size of the frame of the window.
GLFWcursorposfun
void(* GLFWcursorposfun)(GLFWwindow *, double, double)
The function signature for cursor position callbacks.
Definition: glfw3.h:1379
glfwRestoreWindow
void glfwRestoreWindow(GLFWwindow *window)
Restores the specified window.
glfwGetMouseButton
int glfwGetMouseButton(GLFWwindow *window, int button)
Returns the last reported state of a mouse button for the specified window.
glfwWindowHintString
void glfwWindowHintString(int hint, const char *value)
Sets the specified window hint to the desired value.
glfwGetWindowContentScale
void glfwGetWindowContentScale(GLFWwindow *window, float *xscale, float *yscale)
Retrieves the content scale for the specified window.
GLFWwindowcontentscalefun
void(* GLFWwindowcontentscalefun)(GLFWwindow *, float, float)
The function signature for window content scale callbacks.
Definition: glfw3.h:1339
glfwGetMonitorContentScale
void glfwGetMonitorContentScale(GLFWmonitor *monitor, float *xscale, float *yscale)
Retrieves the content scale for the specified monitor.
GLFWwindowsizefun
void(* GLFWwindowsizefun)(GLFWwindow *, int, int)
The function signature for window resize callbacks.
Definition: glfw3.h:1218
glfwSetWindowMonitor
void glfwSetWindowMonitor(GLFWwindow *window, GLFWmonitor *monitor, int xpos, int ypos, int width, int height, int refreshRate)
Sets the mode, monitor, video mode and placement of a window.
glfwSetTime
void glfwSetTime(double time)
Sets the GLFW timer.
glfwFocusWindow
void glfwFocusWindow(GLFWwindow *window)
Brings the specified window to front and sets input focus.
GLFWgammaramp
struct GLFWgammaramp GLFWgammaramp
Gamma ramp.
glfwInitHint
void glfwInitHint(int hint, int value)
Sets the specified init hint to the desired value.
glfwCreateWindow
GLFWwindow * glfwCreateWindow(int width, int height, const char *title, GLFWmonitor *monitor, GLFWwindow *share)
Creates a window and its associated context.
GLFWgammaramp::size
unsigned int size
Definition: glfw3.h:1588
glfwSetWindowUserPointer
void glfwSetWindowUserPointer(GLFWwindow *window, void *pointer)
Sets the user pointer of the specified window.
glfwSetWindowShouldClose
void glfwSetWindowShouldClose(GLFWwindow *window, int value)
Sets the close flag of the specified window.
glfwGetInstanceProcAddress
GLFWvkproc glfwGetInstanceProcAddress(VkInstance instance, const char *procname)
Returns the address of the specified Vulkan instance function.
glfwPostEmptyEvent
void glfwPostEmptyEvent(void)
Posts an empty event to the event queue.
glfwWaitEventsTimeout
void glfwWaitEventsTimeout(double timeout)
Waits with timeout until events are queued and processes them.
GLFWgamepadstate::buttons
unsigned char buttons[15]
Definition: glfw3.h:1633
glfwSetFramebufferSizeCallback
GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow *window, GLFWframebuffersizefun cbfun)
Sets the framebuffer resize callback for the specified window.
GLFWframebuffersizefun
void(* GLFWframebuffersizefun)(GLFWwindow *, int, int)
The function signature for framebuffer resize callbacks.
Definition: glfw3.h:1321
glfwSetWindowContentScaleCallback
GLFWwindowcontentscalefun glfwSetWindowContentScaleCallback(GLFWwindow *window, GLFWwindowcontentscalefun cbfun)
Sets the window content scale callback for the specified window.
glfwSetJoystickCallback
GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun cbfun)
Sets the joystick configuration callback.
glfwGetPhysicalDevicePresentationSupport
int glfwGetPhysicalDevicePresentationSupport(VkInstance instance, VkPhysicalDevice device, uint32_t queuefamily)
Returns whether the specified queue family can present images.
GLFWwindowposfun
void(* GLFWwindowposfun)(GLFWwindow *, int, int)
The function signature for window position callbacks.
Definition: glfw3.h:1200
glfwGetJoystickHats
const unsigned char * glfwGetJoystickHats(int jid, int *count)
Returns the state of all hats of the specified joystick.
glfwPollEvents
void glfwPollEvents(void)
Processes all pending events.
glfwGetWindowOpacity
float glfwGetWindowOpacity(GLFWwindow *window)
Returns the opacity of the whole window.
GLFWgamepadstate
struct GLFWgamepadstate GLFWgamepadstate
Gamepad input state.
glfwGetTimerValue
uint64_t glfwGetTimerValue(void)
Returns the current value of the raw timer.
glfwHideWindow
void glfwHideWindow(GLFWwindow *window)
Hides the specified window.
glfwGetCurrentContext
GLFWwindow * glfwGetCurrentContext(void)
Returns the window whose context is current on the calling thread.
glfwSetGammaRamp
void glfwSetGammaRamp(GLFWmonitor *monitor, const GLFWgammaramp *ramp)
Sets the current gamma ramp for the specified monitor.
glfwGetTimerFrequency
uint64_t glfwGetTimerFrequency(void)
Returns the frequency, in Hz, of the raw timer.
glfwSetCursorEnterCallback
GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow *window, GLFWcursorenterfun cbfun)
Sets the cursor enter/exit callback.
GLFWimage::width
int width
Definition: glfw3.h:1608
glfwGetWindowMonitor
GLFWmonitor * glfwGetWindowMonitor(GLFWwindow *window)
Returns the monitor that the window uses for full screen mode.
glfwSetMouseButtonCallback
GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow *window, GLFWmousebuttonfun cbfun)
Sets the mouse button callback.
glfwGetPrimaryMonitor
GLFWmonitor * glfwGetPrimaryMonitor(void)
Returns the primary monitor.
glfwGetKey
int glfwGetKey(GLFWwindow *window, int key)
Returns the last reported state of a keyboard key for the specified window.
glfwMakeContextCurrent
void glfwMakeContextCurrent(GLFWwindow *window)
Makes the context of the specified window current for the calling thread.
GLFWgammaramp
Gamma ramp.
Definition: glfw3.h:1575
glfwSetWindowCloseCallback
GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow *window, GLFWwindowclosefun cbfun)
Sets the close callback for the specified window.
GLFWjoystickfun
void(* GLFWjoystickfun)(int, int)
The function signature for joystick configuration callbacks.
Definition: glfw3.h:1526
glfwSetScrollCallback
GLFWscrollfun glfwSetScrollCallback(GLFWwindow *window, GLFWscrollfun cbfun)
Sets the scroll callback.
GLFWgammaramp::blue
unsigned short * blue
Definition: glfw3.h:1585
GLFWvidmode
Video mode type.
Definition: glfw3.h:1541
glfwSetWindowMaximizeCallback
GLFWwindowmaximizefun glfwSetWindowMaximizeCallback(GLFWwindow *window, GLFWwindowmaximizefun cbfun)
Sets the maximize callback for the specified window.
glfwVulkanSupported
int glfwVulkanSupported(void)
Returns whether the Vulkan loader and an ICD have been found.
GLFWcursor
struct GLFWcursor GLFWcursor
Opaque cursor object.
Definition: glfw3.h:1165
glfwSetWindowPos
void glfwSetWindowPos(GLFWwindow *window, int xpos, int ypos)
Sets the position of the content area of the specified window.
glfwExtensionSupported
int glfwExtensionSupported(const char *extension)
Returns whether the specified extension is available.
glfwGetFramebufferSize
void glfwGetFramebufferSize(GLFWwindow *window, int *width, int *height)
Retrieves the size of the framebuffer of the specified window.
GLFWwindowclosefun
void(* GLFWwindowclosefun)(GLFWwindow *)
The function signature for window close callbacks.
Definition: glfw3.h:1234
glfwWindowHint
void glfwWindowHint(int hint, int value)
Sets the specified window hint to the desired value.
glfwCreateStandardCursor
GLFWcursor * glfwCreateStandardCursor(int shape)
Creates a cursor with a standard shape.
glfwSwapInterval
void glfwSwapInterval(int interval)
Sets the swap interval for the current context.
glfwSetCharModsCallback
GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow *window, GLFWcharmodsfun cbfun)
Sets the Unicode character with modifiers callback.
glfwGetRequiredInstanceExtensions
const char ** glfwGetRequiredInstanceExtensions(uint32_t *count)
Returns the Vulkan instance extensions required by GLFW.
GLFWcursorenterfun
void(* GLFWcursorenterfun)(GLFWwindow *, int)
The function signature for cursor enter/leave callbacks.
Definition: glfw3.h:1396
glfwInit
int glfwInit(void)
Initializes the GLFW library.
GLFWimage
Image data.
Definition: glfw3.h:1604
glfwSetJoystickUserPointer
void glfwSetJoystickUserPointer(int jid, void *pointer)
Sets the user pointer of the specified joystick.
GLFWscrollfun
void(* GLFWscrollfun)(GLFWwindow *, double, double)
The function signature for scroll callbacks.
Definition: glfw3.h:1413
glfwGetMonitorPos
void glfwGetMonitorPos(GLFWmonitor *monitor, int *xpos, int *ypos)
Returns the position of the monitor's viewport on the virtual screen.
GLFWwindowmaximizefun
void(* GLFWwindowmaximizefun)(GLFWwindow *, int)
The function signature for window maximize/restore callbacks.
Definition: glfw3.h:1303
glfwSetWindowOpacity
void glfwSetWindowOpacity(GLFWwindow *window, float opacity)
Sets the opacity of the whole window.
GLFWvidmode
struct GLFWvidmode GLFWvidmode
Video mode type.
glfwDefaultWindowHints
void glfwDefaultWindowHints(void)
Resets all window hints to their default values.
GLFWgamepadstate::axes
float axes[6]
Definition: glfw3.h:1637
glfwSetWindowFocusCallback
GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow *window, GLFWwindowfocusfun cbfun)
Sets the focus callback for the specified window.
glfwTerminate
void glfwTerminate(void)
Terminates the GLFW library.
glfwSetWindowIcon
void glfwSetWindowIcon(GLFWwindow *window, int count, const GLFWimage *images)
Sets the icon for the specified window.
glfwSetMonitorCallback
GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun cbfun)
Sets the monitor configuration callback.
GLFWwindowrefreshfun
void(* GLFWwindowrefreshfun)(GLFWwindow *)
The function signature for window content refresh callbacks.
Definition: glfw3.h:1250
GLFWglproc
void(* GLFWglproc)(void)
Client API function pointer type.
Definition: glfw3.h:1115
glfwGetMonitorName
const char * glfwGetMonitorName(GLFWmonitor *monitor)
Returns the name of the specified monitor.
GLFWerrorfun
void(* GLFWerrorfun)(int, const char *)
The function signature for error callbacks.
Definition: glfw3.h:1181
glfwSetWindowAspectRatio
void glfwSetWindowAspectRatio(GLFWwindow *window, int numer, int denom)
Sets the aspect ratio of the specified window.
glfwWindowShouldClose
int glfwWindowShouldClose(GLFWwindow *window)
Checks the close flag of the specified window.
glfwGetWindowAttrib
int glfwGetWindowAttrib(GLFWwindow *window, int attrib)
Returns an attribute of the specified window.
GLFWwindowfocusfun
void(* GLFWwindowfocusfun)(GLFWwindow *, int)
The function signature for window focus/defocus callbacks.
Definition: glfw3.h:1267