glfw3.c 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/GLFW/CMakeLists.txt +368 -0
  2. package/GLFW/cocoa_init.m +694 -0
  3. package/GLFW/cocoa_joystick.h +49 -0
  4. package/GLFW/cocoa_joystick.m +485 -0
  5. package/GLFW/cocoa_monitor.m +643 -0
  6. package/GLFW/cocoa_platform.h +302 -0
  7. package/GLFW/cocoa_time.c +57 -0
  8. package/GLFW/cocoa_time.h +35 -0
  9. package/GLFW/cocoa_window.m +2072 -0
  10. package/GLFW/context.c +765 -0
  11. package/GLFW/egl_context.c +911 -0
  12. package/GLFW/glfw.rc.in +30 -0
  13. package/GLFW/glfw3.c +109 -0
  14. package/GLFW/glfw3.h +6564 -0
  15. package/GLFW/glfw3native.h +663 -0
  16. package/GLFW/glx_context.c +719 -0
  17. package/GLFW/init.c +528 -0
  18. package/GLFW/input.c +1505 -0
  19. package/GLFW/internal.h +1022 -0
  20. package/GLFW/linux_joystick.c +436 -0
  21. package/GLFW/linux_joystick.h +64 -0
  22. package/GLFW/mappings.h +1001 -0
  23. package/GLFW/mappings.h.in +82 -0
  24. package/GLFW/monitor.c +548 -0
  25. package/GLFW/nsgl_context.m +384 -0
  26. package/GLFW/null_init.c +264 -0
  27. package/GLFW/null_joystick.c +56 -0
  28. package/GLFW/null_joystick.h +32 -0
  29. package/GLFW/null_monitor.c +160 -0
  30. package/GLFW/null_platform.h +271 -0
  31. package/GLFW/null_window.c +719 -0
  32. package/GLFW/osmesa_context.c +383 -0
  33. package/GLFW/platform.c +214 -0
  34. package/GLFW/platform.h +212 -0
  35. package/GLFW/posix_module.c +53 -0
  36. package/GLFW/posix_poll.c +83 -0
  37. package/GLFW/posix_poll.h +30 -0
  38. package/GLFW/posix_thread.c +107 -0
  39. package/GLFW/posix_thread.h +49 -0
  40. package/GLFW/posix_time.c +65 -0
  41. package/GLFW/posix_time.h +41 -0
  42. package/GLFW/vulkan.c +328 -0
  43. package/GLFW/wgl_context.c +798 -0
  44. package/GLFW/win32_init.c +731 -0
  45. package/GLFW/win32_joystick.c +767 -0
  46. package/GLFW/win32_joystick.h +51 -0
  47. package/GLFW/win32_module.c +51 -0
  48. package/GLFW/win32_monitor.c +569 -0
  49. package/GLFW/win32_platform.h +631 -0
  50. package/GLFW/win32_thread.c +100 -0
  51. package/GLFW/win32_thread.h +53 -0
  52. package/GLFW/win32_time.c +54 -0
  53. package/GLFW/win32_time.h +43 -0
  54. package/GLFW/win32_window.c +2592 -0
  55. package/GLFW/window.c +1172 -0
  56. package/GLFW/wl_init.c +1003 -0
  57. package/GLFW/wl_monitor.c +274 -0
  58. package/GLFW/wl_platform.h +691 -0
  59. package/GLFW/wl_window.c +3308 -0
  60. package/GLFW/x11_init.c +1656 -0
  61. package/GLFW/x11_monitor.c +641 -0
  62. package/GLFW/x11_platform.h +1004 -0
  63. package/GLFW/x11_window.c +3357 -0
  64. package/GLFW/xkb_unicode.c +943 -0
  65. package/GLFW/xkb_unicode.h +30 -0
  66. package/LICENSE +22 -0
  67. package/README.md +236 -0
  68. package/package.json +32 -0
@@ -0,0 +1,1022 @@
1
+ //========================================================================
2
+ // GLFW 3.4 - www.glfw.org
3
+ //------------------------------------------------------------------------
4
+ // Copyright (c) 2002-2006 Marcus Geelnard
5
+ // Copyright (c) 2006-2019 Camilla Löwy <elmindreda@glfw.org>
6
+ //
7
+ // This software is provided 'as-is', without any express or implied
8
+ // warranty. In no event will the authors be held liable for any damages
9
+ // arising from the use of this software.
10
+ //
11
+ // Permission is granted to anyone to use this software for any purpose,
12
+ // including commercial applications, and to alter it and redistribute it
13
+ // freely, subject to the following restrictions:
14
+ //
15
+ // 1. The origin of this software must not be misrepresented; you must not
16
+ // claim that you wrote the original software. If you use this software
17
+ // in a product, an acknowledgment in the product documentation would
18
+ // be appreciated but is not required.
19
+ //
20
+ // 2. Altered source versions must be plainly marked as such, and must not
21
+ // be misrepresented as being the original software.
22
+ //
23
+ // 3. This notice may not be removed or altered from any source
24
+ // distribution.
25
+ //
26
+ //========================================================================
27
+
28
+ #pragma once
29
+
30
+ #if defined(_GLFW_USE_CONFIG_H)
31
+ #include "glfw_config.h"
32
+ #endif
33
+
34
+ #if defined(GLFW_INCLUDE_GLCOREARB) || \
35
+ defined(GLFW_INCLUDE_ES1) || \
36
+ defined(GLFW_INCLUDE_ES2) || \
37
+ defined(GLFW_INCLUDE_ES3) || \
38
+ defined(GLFW_INCLUDE_ES31) || \
39
+ defined(GLFW_INCLUDE_ES32) || \
40
+ defined(GLFW_INCLUDE_NONE) || \
41
+ defined(GLFW_INCLUDE_GLEXT) || \
42
+ defined(GLFW_INCLUDE_GLU) || \
43
+ defined(GLFW_INCLUDE_VULKAN) || \
44
+ defined(GLFW_DLL)
45
+ #error "You must not define any header option macros when compiling GLFW"
46
+ #endif
47
+
48
+ #define GLFW_INCLUDE_NONE
49
+ #include "glfw3.h"
50
+
51
+ #define _GLFW_INSERT_FIRST 0
52
+ #define _GLFW_INSERT_LAST 1
53
+
54
+ #define _GLFW_POLL_PRESENCE 0
55
+ #define _GLFW_POLL_AXES 1
56
+ #define _GLFW_POLL_BUTTONS 2
57
+ #define _GLFW_POLL_ALL (_GLFW_POLL_AXES | _GLFW_POLL_BUTTONS)
58
+
59
+ #define _GLFW_MESSAGE_SIZE 1024
60
+
61
+ typedef int GLFWbool;
62
+ typedef void (*GLFWproc)(void);
63
+
64
+ typedef struct _GLFWerror _GLFWerror;
65
+ typedef struct _GLFWinitconfig _GLFWinitconfig;
66
+ typedef struct _GLFWwndconfig _GLFWwndconfig;
67
+ typedef struct _GLFWctxconfig _GLFWctxconfig;
68
+ typedef struct _GLFWfbconfig _GLFWfbconfig;
69
+ typedef struct _GLFWcontext _GLFWcontext;
70
+ typedef struct _GLFWwindow _GLFWwindow;
71
+ typedef struct _GLFWplatform _GLFWplatform;
72
+ typedef struct _GLFWlibrary _GLFWlibrary;
73
+ typedef struct _GLFWmonitor _GLFWmonitor;
74
+ typedef struct _GLFWcursor _GLFWcursor;
75
+ typedef struct _GLFWmapelement _GLFWmapelement;
76
+ typedef struct _GLFWmapping _GLFWmapping;
77
+ typedef struct _GLFWjoystick _GLFWjoystick;
78
+ typedef struct _GLFWtls _GLFWtls;
79
+ typedef struct _GLFWmutex _GLFWmutex;
80
+
81
+ #ifndef GL_VERSION
82
+ #define GL_VERSION 0x1f02
83
+ #endif
84
+ #ifndef GL_NONE
85
+ #define GL_NONE 0
86
+ #endif
87
+ #ifndef LG_COLOR_BUFFER_BIT
88
+ #define GL_COLOR_BUFFER_BIT 0x00004000
89
+ #endif
90
+ #ifndef LG_UNSIGNED_BYTE
91
+ #define GL_UNSIGNED_BYTE 0x1401
92
+ #endif
93
+ #ifndef GL_EXTENSIONS
94
+ #define GL_EXTENSIONS 0x1f03
95
+ #endif
96
+ #ifndef GL_NUM_EXTENSIONS
97
+ #define GL_NUM_EXTENSIONS 0x821d
98
+ #endif
99
+ #ifndef GL_CONTEXT_FLAGS
100
+ #define GL_CONTEXT_FLAGS 0x821e
101
+ #define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x00000001
102
+ #define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002
103
+ #define GL_CONTEXT_PROFILE_MASK 0x9126
104
+ #define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002
105
+ #define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001
106
+ #define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
107
+ #define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252
108
+ #define GL_NO_RESET_NOTIFICATION_ARB 0x8261
109
+ #define GL_CONTEXT_RELEASE_BEHAVIOR 0x82fb
110
+ #define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH 0x82fc
111
+ #define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008
112
+ #endif
113
+
114
+ typedef int GLint;
115
+ typedef unsigned int GLuint;
116
+ typedef unsigned int GLenum;
117
+ typedef unsigned int GLbitfield;
118
+ typedef unsigned char GLubyte;
119
+
120
+ typedef void (APIENTRY * PFNGLCLEARPROC)(GLbitfield);
121
+ typedef const GLubyte* (APIENTRY * PFNGLGETSTRINGPROC)(GLenum);
122
+ typedef void (APIENTRY * PFNGLGETINTEGERVPROC)(GLenum,GLint*);
123
+ typedef const GLubyte* (APIENTRY * PFNGLGETSTRINGIPROC)(GLenum,GLuint);
124
+
125
+ #define EGL_SUCCESS 0x3000
126
+ #define EGL_NOT_INITIALIZED 0x3001
127
+ #define EGL_BAD_ACCESS 0x3002
128
+ #define EGL_BAD_ALLOC 0x3003
129
+ #define EGL_BAD_ATTRIBUTE 0x3004
130
+ #define EGL_BAD_CONFIG 0x3005
131
+ #define EGL_BAD_CONTEXT 0x3006
132
+ #define EGL_BAD_CURRENT_SURFACE 0x3007
133
+ #define EGL_BAD_DISPLAY 0x3008
134
+ #define EGL_BAD_MATCH 0x3009
135
+ #define EGL_BAD_NATIVE_PIXMAP 0x300a
136
+ #define EGL_BAD_NATIVE_WINDOW 0x300b
137
+ #define EGL_BAD_PARAMETER 0x300c
138
+ #define EGL_BAD_SURFACE 0x300d
139
+ #define EGL_CONTEXT_LOST 0x300e
140
+ #define EGL_COLOR_BUFFER_TYPE 0x303f
141
+ #define EGL_RGB_BUFFER 0x308e
142
+ #define EGL_SURFACE_TYPE 0x3033
143
+ #define EGL_WINDOW_BIT 0x0004
144
+ #define EGL_RENDERABLE_TYPE 0x3040
145
+ #define EGL_OPENGL_ES_BIT 0x0001
146
+ #define EGL_OPENGL_ES2_BIT 0x0004
147
+ #define EGL_OPENGL_BIT 0x0008
148
+ #define EGL_ALPHA_SIZE 0x3021
149
+ #define EGL_BLUE_SIZE 0x3022
150
+ #define EGL_GREEN_SIZE 0x3023
151
+ #define EGL_RED_SIZE 0x3024
152
+ #define EGL_DEPTH_SIZE 0x3025
153
+ #define EGL_STENCIL_SIZE 0x3026
154
+ #define EGL_SAMPLES 0x3031
155
+ #define EGL_OPENGL_ES_API 0x30a0
156
+ #define EGL_OPENGL_API 0x30a2
157
+ #define EGL_NONE 0x3038
158
+ #define EGL_RENDER_BUFFER 0x3086
159
+ #define EGL_SINGLE_BUFFER 0x3085
160
+ #define EGL_EXTENSIONS 0x3055
161
+ #define EGL_CONTEXT_CLIENT_VERSION 0x3098
162
+ #define EGL_NATIVE_VISUAL_ID 0x302e
163
+ #define EGL_NO_SURFACE ((EGLSurface) 0)
164
+ #define EGL_NO_DISPLAY ((EGLDisplay) 0)
165
+ #define EGL_NO_CONTEXT ((EGLContext) 0)
166
+ #define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType) 0)
167
+
168
+ #define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002
169
+ #define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001
170
+ #define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002
171
+ #define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001
172
+ #define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31bd
173
+ #define EGL_NO_RESET_NOTIFICATION_KHR 0x31be
174
+ #define EGL_LOSE_CONTEXT_ON_RESET_KHR 0x31bf
175
+ #define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004
176
+ #define EGL_CONTEXT_MAJOR_VERSION_KHR 0x3098
177
+ #define EGL_CONTEXT_MINOR_VERSION_KHR 0x30fb
178
+ #define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30fd
179
+ #define EGL_CONTEXT_FLAGS_KHR 0x30fc
180
+ #define EGL_CONTEXT_OPENGL_NO_ERROR_KHR 0x31b3
181
+ #define EGL_GL_COLORSPACE_KHR 0x309d
182
+ #define EGL_GL_COLORSPACE_SRGB_KHR 0x3089
183
+ #define EGL_CONTEXT_RELEASE_BEHAVIOR_KHR 0x2097
184
+ #define EGL_CONTEXT_RELEASE_BEHAVIOR_NONE_KHR 0
185
+ #define EGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR 0x2098
186
+ #define EGL_PLATFORM_X11_EXT 0x31d5
187
+ #define EGL_PLATFORM_WAYLAND_EXT 0x31d8
188
+ #define EGL_PRESENT_OPAQUE_EXT 0x31df
189
+ #define EGL_PLATFORM_ANGLE_ANGLE 0x3202
190
+ #define EGL_PLATFORM_ANGLE_TYPE_ANGLE 0x3203
191
+ #define EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE 0x320d
192
+ #define EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE 0x320e
193
+ #define EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE 0x3207
194
+ #define EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE 0x3208
195
+ #define EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE 0x3450
196
+ #define EGL_PLATFORM_ANGLE_TYPE_METAL_ANGLE 0x3489
197
+ #define EGL_PLATFORM_ANGLE_NATIVE_PLATFORM_TYPE_ANGLE 0x348f
198
+
199
+ typedef int EGLint;
200
+ typedef unsigned int EGLBoolean;
201
+ typedef unsigned int EGLenum;
202
+ typedef void* EGLConfig;
203
+ typedef void* EGLContext;
204
+ typedef void* EGLDisplay;
205
+ typedef void* EGLSurface;
206
+
207
+ typedef void* EGLNativeDisplayType;
208
+ typedef void* EGLNativeWindowType;
209
+
210
+ // EGL function pointer typedefs
211
+ typedef EGLBoolean (APIENTRY * PFN_eglGetConfigAttrib)(EGLDisplay,EGLConfig,EGLint,EGLint*);
212
+ typedef EGLBoolean (APIENTRY * PFN_eglGetConfigs)(EGLDisplay,EGLConfig*,EGLint,EGLint*);
213
+ typedef EGLDisplay (APIENTRY * PFN_eglGetDisplay)(EGLNativeDisplayType);
214
+ typedef EGLint (APIENTRY * PFN_eglGetError)(void);
215
+ typedef EGLBoolean (APIENTRY * PFN_eglInitialize)(EGLDisplay,EGLint*,EGLint*);
216
+ typedef EGLBoolean (APIENTRY * PFN_eglTerminate)(EGLDisplay);
217
+ typedef EGLBoolean (APIENTRY * PFN_eglBindAPI)(EGLenum);
218
+ typedef EGLContext (APIENTRY * PFN_eglCreateContext)(EGLDisplay,EGLConfig,EGLContext,const EGLint*);
219
+ typedef EGLBoolean (APIENTRY * PFN_eglDestroySurface)(EGLDisplay,EGLSurface);
220
+ typedef EGLBoolean (APIENTRY * PFN_eglDestroyContext)(EGLDisplay,EGLContext);
221
+ typedef EGLSurface (APIENTRY * PFN_eglCreateWindowSurface)(EGLDisplay,EGLConfig,EGLNativeWindowType,const EGLint*);
222
+ typedef EGLBoolean (APIENTRY * PFN_eglMakeCurrent)(EGLDisplay,EGLSurface,EGLSurface,EGLContext);
223
+ typedef EGLBoolean (APIENTRY * PFN_eglSwapBuffers)(EGLDisplay,EGLSurface);
224
+ typedef EGLBoolean (APIENTRY * PFN_eglSwapInterval)(EGLDisplay,EGLint);
225
+ typedef const char* (APIENTRY * PFN_eglQueryString)(EGLDisplay,EGLint);
226
+ typedef GLFWglproc (APIENTRY * PFN_eglGetProcAddress)(const char*);
227
+ #define eglGetConfigAttrib _glfw.egl.GetConfigAttrib
228
+ #define eglGetConfigs _glfw.egl.GetConfigs
229
+ #define eglGetDisplay _glfw.egl.GetDisplay
230
+ #define eglGetError _glfw.egl.GetError
231
+ #define eglInitialize _glfw.egl.Initialize
232
+ #define eglTerminate _glfw.egl.Terminate
233
+ #define eglBindAPI _glfw.egl.BindAPI
234
+ #define eglCreateContext _glfw.egl.CreateContext
235
+ #define eglDestroySurface _glfw.egl.DestroySurface
236
+ #define eglDestroyContext _glfw.egl.DestroyContext
237
+ #define eglCreateWindowSurface _glfw.egl.CreateWindowSurface
238
+ #define eglMakeCurrent _glfw.egl.MakeCurrent
239
+ #define eglSwapBuffers _glfw.egl.SwapBuffers
240
+ #define eglSwapInterval _glfw.egl.SwapInterval
241
+ #define eglQueryString _glfw.egl.QueryString
242
+ #define eglGetProcAddress _glfw.egl.GetProcAddress
243
+
244
+ typedef EGLDisplay (APIENTRY * PFNEGLGETPLATFORMDISPLAYEXTPROC)(EGLenum,void*,const EGLint*);
245
+ typedef EGLSurface (APIENTRY * PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC)(EGLDisplay,EGLConfig,void*,const EGLint*);
246
+ #define eglGetPlatformDisplayEXT _glfw.egl.GetPlatformDisplayEXT
247
+ #define eglCreatePlatformWindowSurfaceEXT _glfw.egl.CreatePlatformWindowSurfaceEXT
248
+
249
+ #define OSMESA_RGBA 0x1908
250
+ #define OSMESA_FORMAT 0x22
251
+ #define OSMESA_DEPTH_BITS 0x30
252
+ #define OSMESA_STENCIL_BITS 0x31
253
+ #define OSMESA_ACCUM_BITS 0x32
254
+ #define OSMESA_PROFILE 0x33
255
+ #define OSMESA_CORE_PROFILE 0x34
256
+ #define OSMESA_COMPAT_PROFILE 0x35
257
+ #define OSMESA_CONTEXT_MAJOR_VERSION 0x36
258
+ #define OSMESA_CONTEXT_MINOR_VERSION 0x37
259
+
260
+ typedef void* OSMesaContext;
261
+ typedef void (*OSMESAproc)(void);
262
+
263
+ typedef OSMesaContext (GLAPIENTRY * PFN_OSMesaCreateContextExt)(GLenum,GLint,GLint,GLint,OSMesaContext);
264
+ typedef OSMesaContext (GLAPIENTRY * PFN_OSMesaCreateContextAttribs)(const int*,OSMesaContext);
265
+ typedef void (GLAPIENTRY * PFN_OSMesaDestroyContext)(OSMesaContext);
266
+ typedef int (GLAPIENTRY * PFN_OSMesaMakeCurrent)(OSMesaContext,void*,int,int,int);
267
+ typedef int (GLAPIENTRY * PFN_OSMesaGetColorBuffer)(OSMesaContext,int*,int*,int*,void**);
268
+ typedef int (GLAPIENTRY * PFN_OSMesaGetDepthBuffer)(OSMesaContext,int*,int*,int*,void**);
269
+ typedef GLFWglproc (GLAPIENTRY * PFN_OSMesaGetProcAddress)(const char*);
270
+ #define OSMesaCreateContextExt _glfw.osmesa.CreateContextExt
271
+ #define OSMesaCreateContextAttribs _glfw.osmesa.CreateContextAttribs
272
+ #define OSMesaDestroyContext _glfw.osmesa.DestroyContext
273
+ #define OSMesaMakeCurrent _glfw.osmesa.MakeCurrent
274
+ #define OSMesaGetColorBuffer _glfw.osmesa.GetColorBuffer
275
+ #define OSMesaGetDepthBuffer _glfw.osmesa.GetDepthBuffer
276
+ #define OSMesaGetProcAddress _glfw.osmesa.GetProcAddress
277
+
278
+ #define VK_NULL_HANDLE 0
279
+
280
+ typedef void* VkInstance;
281
+ typedef void* VkPhysicalDevice;
282
+ typedef uint64_t VkSurfaceKHR;
283
+ typedef uint32_t VkFlags;
284
+ typedef uint32_t VkBool32;
285
+
286
+ typedef enum VkStructureType
287
+ {
288
+ VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000,
289
+ VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000,
290
+ VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000,
291
+ VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000,
292
+ VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK = 1000123000,
293
+ VK_STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT = 1000217000,
294
+ VK_STRUCTURE_TYPE_MAX_ENUM = 0x7FFFFFFF
295
+ } VkStructureType;
296
+
297
+ typedef enum VkResult
298
+ {
299
+ VK_SUCCESS = 0,
300
+ VK_NOT_READY = 1,
301
+ VK_TIMEOUT = 2,
302
+ VK_EVENT_SET = 3,
303
+ VK_EVENT_RESET = 4,
304
+ VK_INCOMPLETE = 5,
305
+ VK_ERROR_OUT_OF_HOST_MEMORY = -1,
306
+ VK_ERROR_OUT_OF_DEVICE_MEMORY = -2,
307
+ VK_ERROR_INITIALIZATION_FAILED = -3,
308
+ VK_ERROR_DEVICE_LOST = -4,
309
+ VK_ERROR_MEMORY_MAP_FAILED = -5,
310
+ VK_ERROR_LAYER_NOT_PRESENT = -6,
311
+ VK_ERROR_EXTENSION_NOT_PRESENT = -7,
312
+ VK_ERROR_FEATURE_NOT_PRESENT = -8,
313
+ VK_ERROR_INCOMPATIBLE_DRIVER = -9,
314
+ VK_ERROR_TOO_MANY_OBJECTS = -10,
315
+ VK_ERROR_FORMAT_NOT_SUPPORTED = -11,
316
+ VK_ERROR_SURFACE_LOST_KHR = -1000000000,
317
+ VK_SUBOPTIMAL_KHR = 1000001003,
318
+ VK_ERROR_OUT_OF_DATE_KHR = -1000001004,
319
+ VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = -1000003001,
320
+ VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = -1000000001,
321
+ VK_ERROR_VALIDATION_FAILED_EXT = -1000011001,
322
+ VK_RESULT_MAX_ENUM = 0x7FFFFFFF
323
+ } VkResult;
324
+
325
+ typedef struct VkAllocationCallbacks VkAllocationCallbacks;
326
+
327
+ typedef struct VkExtensionProperties
328
+ {
329
+ char extensionName[256];
330
+ uint32_t specVersion;
331
+ } VkExtensionProperties;
332
+
333
+ typedef void (APIENTRY * PFN_vkVoidFunction)(void);
334
+
335
+ typedef PFN_vkVoidFunction (APIENTRY * PFN_vkGetInstanceProcAddr)(VkInstance,const char*);
336
+ typedef VkResult (APIENTRY * PFN_vkEnumerateInstanceExtensionProperties)(const char*,uint32_t*,VkExtensionProperties*);
337
+ #define vkGetInstanceProcAddr _glfw.vk.GetInstanceProcAddr
338
+
339
+ #include "platform.h"
340
+
341
+ #define GLFW_NATIVE_INCLUDE_NONE
342
+ #include "glfw3native.h"
343
+
344
+ // Checks for whether the library has been initialized
345
+ #define _GLFW_REQUIRE_INIT() \
346
+ if (!_glfw.initialized) \
347
+ { \
348
+ _glfwInputError(GLFW_NOT_INITIALIZED, NULL); \
349
+ return; \
350
+ }
351
+ #define _GLFW_REQUIRE_INIT_OR_RETURN(x) \
352
+ if (!_glfw.initialized) \
353
+ { \
354
+ _glfwInputError(GLFW_NOT_INITIALIZED, NULL); \
355
+ return x; \
356
+ }
357
+
358
+ // Swaps the provided pointers
359
+ #define _GLFW_SWAP(type, x, y) \
360
+ { \
361
+ type t; \
362
+ t = x; \
363
+ x = y; \
364
+ y = t; \
365
+ }
366
+
367
+ // Per-thread error structure
368
+ //
369
+ struct _GLFWerror
370
+ {
371
+ _GLFWerror* next;
372
+ int code;
373
+ char description[_GLFW_MESSAGE_SIZE];
374
+ };
375
+
376
+ // Initialization configuration
377
+ //
378
+ // Parameters relating to the initialization of the library
379
+ //
380
+ struct _GLFWinitconfig
381
+ {
382
+ GLFWbool hatButtons;
383
+ int angleType;
384
+ int platformID;
385
+ PFN_vkGetInstanceProcAddr vulkanLoader;
386
+ struct {
387
+ GLFWbool menubar;
388
+ GLFWbool chdir;
389
+ } ns;
390
+ struct {
391
+ GLFWbool xcbVulkanSurface;
392
+ } x11;
393
+ struct {
394
+ int libdecorMode;
395
+ } wl;
396
+ };
397
+
398
+ // Window configuration
399
+ //
400
+ // Parameters relating to the creation of the window but not directly related
401
+ // to the framebuffer. This is used to pass window creation parameters from
402
+ // shared code to the platform API.
403
+ //
404
+ struct _GLFWwndconfig
405
+ {
406
+ int xpos;
407
+ int ypos;
408
+ int width;
409
+ int height;
410
+ const char* title;
411
+ GLFWbool resizable;
412
+ GLFWbool visible;
413
+ GLFWbool decorated;
414
+ GLFWbool focused;
415
+ GLFWbool autoIconify;
416
+ GLFWbool floating;
417
+ GLFWbool maximized;
418
+ GLFWbool centerCursor;
419
+ GLFWbool focusOnShow;
420
+ GLFWbool mousePassthrough;
421
+ GLFWbool scaleToMonitor;
422
+ GLFWbool scaleFramebuffer;
423
+ struct {
424
+ char frameName[256];
425
+ } ns;
426
+ struct {
427
+ char className[256];
428
+ char instanceName[256];
429
+ } x11;
430
+ struct {
431
+ GLFWbool keymenu;
432
+ GLFWbool showDefault;
433
+ } win32;
434
+ struct {
435
+ char appId[256];
436
+ } wl;
437
+ };
438
+
439
+ // Context configuration
440
+ //
441
+ // Parameters relating to the creation of the context but not directly related
442
+ // to the framebuffer. This is used to pass context creation parameters from
443
+ // shared code to the platform API.
444
+ //
445
+ struct _GLFWctxconfig
446
+ {
447
+ int client;
448
+ int source;
449
+ int major;
450
+ int minor;
451
+ GLFWbool forward;
452
+ GLFWbool debug;
453
+ GLFWbool noerror;
454
+ int profile;
455
+ int robustness;
456
+ int release;
457
+ _GLFWwindow* share;
458
+ struct {
459
+ GLFWbool offline;
460
+ } nsgl;
461
+ };
462
+
463
+ // Framebuffer configuration
464
+ //
465
+ // This describes buffers and their sizes. It also contains
466
+ // a platform-specific ID used to map back to the backend API object.
467
+ //
468
+ // It is used to pass framebuffer parameters from shared code to the platform
469
+ // API and also to enumerate and select available framebuffer configs.
470
+ //
471
+ struct _GLFWfbconfig
472
+ {
473
+ int redBits;
474
+ int greenBits;
475
+ int blueBits;
476
+ int alphaBits;
477
+ int depthBits;
478
+ int stencilBits;
479
+ int accumRedBits;
480
+ int accumGreenBits;
481
+ int accumBlueBits;
482
+ int accumAlphaBits;
483
+ int auxBuffers;
484
+ GLFWbool stereo;
485
+ int samples;
486
+ GLFWbool sRGB;
487
+ GLFWbool doublebuffer;
488
+ GLFWbool transparent;
489
+ uintptr_t handle;
490
+ };
491
+
492
+ // Context structure
493
+ //
494
+ struct _GLFWcontext
495
+ {
496
+ int client;
497
+ int source;
498
+ int major, minor, revision;
499
+ GLFWbool forward, debug, noerror;
500
+ int profile;
501
+ int robustness;
502
+ int release;
503
+
504
+ PFNGLGETSTRINGIPROC GetStringi;
505
+ PFNGLGETINTEGERVPROC GetIntegerv;
506
+ PFNGLGETSTRINGPROC GetString;
507
+
508
+ void (*makeCurrent)(_GLFWwindow*);
509
+ void (*swapBuffers)(_GLFWwindow*);
510
+ void (*swapInterval)(int);
511
+ int (*extensionSupported)(const char*);
512
+ GLFWglproc (*getProcAddress)(const char*);
513
+ void (*destroy)(_GLFWwindow*);
514
+
515
+ struct {
516
+ EGLConfig config;
517
+ EGLContext handle;
518
+ EGLSurface surface;
519
+ void* client;
520
+ } egl;
521
+
522
+ struct {
523
+ OSMesaContext handle;
524
+ int width;
525
+ int height;
526
+ void* buffer;
527
+ } osmesa;
528
+
529
+ // This is defined in platform.h
530
+ GLFW_PLATFORM_CONTEXT_STATE
531
+ };
532
+
533
+ // Window and context structure
534
+ //
535
+ struct _GLFWwindow
536
+ {
537
+ struct _GLFWwindow* next;
538
+
539
+ // Window settings and state
540
+ GLFWbool resizable;
541
+ GLFWbool decorated;
542
+ GLFWbool autoIconify;
543
+ GLFWbool floating;
544
+ GLFWbool focusOnShow;
545
+ GLFWbool mousePassthrough;
546
+ GLFWbool shouldClose;
547
+ void* userPointer;
548
+ GLFWbool doublebuffer;
549
+ GLFWvidmode videoMode;
550
+ _GLFWmonitor* monitor;
551
+ _GLFWcursor* cursor;
552
+ char* title;
553
+
554
+ int minwidth, minheight;
555
+ int maxwidth, maxheight;
556
+ int numer, denom;
557
+
558
+ GLFWbool stickyKeys;
559
+ GLFWbool stickyMouseButtons;
560
+ GLFWbool lockKeyMods;
561
+ int cursorMode;
562
+ char mouseButtons[GLFW_MOUSE_BUTTON_LAST + 1];
563
+ char keys[GLFW_KEY_LAST + 1];
564
+ // Virtual cursor position when cursor is disabled
565
+ double virtualCursorPosX, virtualCursorPosY;
566
+ GLFWbool rawMouseMotion;
567
+
568
+ _GLFWcontext context;
569
+
570
+ struct {
571
+ GLFWwindowposfun pos;
572
+ GLFWwindowsizefun size;
573
+ GLFWwindowclosefun close;
574
+ GLFWwindowrefreshfun refresh;
575
+ GLFWwindowfocusfun focus;
576
+ GLFWwindowiconifyfun iconify;
577
+ GLFWwindowmaximizefun maximize;
578
+ GLFWframebuffersizefun fbsize;
579
+ GLFWwindowcontentscalefun scale;
580
+ GLFWmousebuttonfun mouseButton;
581
+ GLFWcursorposfun cursorPos;
582
+ GLFWcursorenterfun cursorEnter;
583
+ GLFWscrollfun scroll;
584
+ GLFWkeyfun key;
585
+ GLFWcharfun character;
586
+ GLFWcharmodsfun charmods;
587
+ GLFWdropfun drop;
588
+ } callbacks;
589
+
590
+ // This is defined in platform.h
591
+ GLFW_PLATFORM_WINDOW_STATE
592
+ };
593
+
594
+ // Monitor structure
595
+ //
596
+ struct _GLFWmonitor
597
+ {
598
+ char name[128];
599
+ void* userPointer;
600
+
601
+ // Physical dimensions in millimeters.
602
+ int widthMM, heightMM;
603
+
604
+ // The window whose video mode is current on this monitor
605
+ _GLFWwindow* window;
606
+
607
+ GLFWvidmode* modes;
608
+ int modeCount;
609
+ GLFWvidmode currentMode;
610
+
611
+ GLFWgammaramp originalRamp;
612
+ GLFWgammaramp currentRamp;
613
+
614
+ // This is defined in platform.h
615
+ GLFW_PLATFORM_MONITOR_STATE
616
+ };
617
+
618
+ // Cursor structure
619
+ //
620
+ struct _GLFWcursor
621
+ {
622
+ _GLFWcursor* next;
623
+ // This is defined in platform.h
624
+ GLFW_PLATFORM_CURSOR_STATE
625
+ };
626
+
627
+ // Gamepad mapping element structure
628
+ //
629
+ struct _GLFWmapelement
630
+ {
631
+ uint8_t type;
632
+ uint8_t index;
633
+ int8_t axisScale;
634
+ int8_t axisOffset;
635
+ };
636
+
637
+ // Gamepad mapping structure
638
+ //
639
+ struct _GLFWmapping
640
+ {
641
+ char name[128];
642
+ char guid[33];
643
+ _GLFWmapelement buttons[15];
644
+ _GLFWmapelement axes[6];
645
+ };
646
+
647
+ // Joystick structure
648
+ //
649
+ struct _GLFWjoystick
650
+ {
651
+ GLFWbool allocated;
652
+ GLFWbool connected;
653
+ float* axes;
654
+ int axisCount;
655
+ unsigned char* buttons;
656
+ int buttonCount;
657
+ unsigned char* hats;
658
+ int hatCount;
659
+ char name[128];
660
+ void* userPointer;
661
+ char guid[33];
662
+ _GLFWmapping* mapping;
663
+
664
+ // This is defined in platform.h
665
+ GLFW_PLATFORM_JOYSTICK_STATE
666
+ };
667
+
668
+ // Thread local storage structure
669
+ //
670
+ struct _GLFWtls
671
+ {
672
+ // This is defined in platform.h
673
+ GLFW_PLATFORM_TLS_STATE
674
+ };
675
+
676
+ // Mutex structure
677
+ //
678
+ struct _GLFWmutex
679
+ {
680
+ // This is defined in platform.h
681
+ GLFW_PLATFORM_MUTEX_STATE
682
+ };
683
+
684
+ // Platform API structure
685
+ //
686
+ struct _GLFWplatform
687
+ {
688
+ int platformID;
689
+ // init
690
+ GLFWbool (*init)(void);
691
+ void (*terminate)(void);
692
+ // input
693
+ void (*getCursorPos)(_GLFWwindow*,double*,double*);
694
+ void (*setCursorPos)(_GLFWwindow*,double,double);
695
+ void (*setCursorMode)(_GLFWwindow*,int);
696
+ void (*setRawMouseMotion)(_GLFWwindow*,GLFWbool);
697
+ GLFWbool (*rawMouseMotionSupported)(void);
698
+ GLFWbool (*createCursor)(_GLFWcursor*,const GLFWimage*,int,int);
699
+ GLFWbool (*createStandardCursor)(_GLFWcursor*,int);
700
+ void (*destroyCursor)(_GLFWcursor*);
701
+ void (*setCursor)(_GLFWwindow*,_GLFWcursor*);
702
+ const char* (*getScancodeName)(int);
703
+ int (*getKeyScancode)(int);
704
+ void (*setClipboardString)(const char*);
705
+ const char* (*getClipboardString)(void);
706
+ GLFWbool (*initJoysticks)(void);
707
+ void (*terminateJoysticks)(void);
708
+ GLFWbool (*pollJoystick)(_GLFWjoystick*,int);
709
+ const char* (*getMappingName)(void);
710
+ void (*updateGamepadGUID)(char*);
711
+ // monitor
712
+ void (*freeMonitor)(_GLFWmonitor*);
713
+ void (*getMonitorPos)(_GLFWmonitor*,int*,int*);
714
+ void (*getMonitorContentScale)(_GLFWmonitor*,float*,float*);
715
+ void (*getMonitorWorkarea)(_GLFWmonitor*,int*,int*,int*,int*);
716
+ GLFWvidmode* (*getVideoModes)(_GLFWmonitor*,int*);
717
+ GLFWbool (*getVideoMode)(_GLFWmonitor*,GLFWvidmode*);
718
+ GLFWbool (*getGammaRamp)(_GLFWmonitor*,GLFWgammaramp*);
719
+ void (*setGammaRamp)(_GLFWmonitor*,const GLFWgammaramp*);
720
+ // window
721
+ GLFWbool (*createWindow)(_GLFWwindow*,const _GLFWwndconfig*,const _GLFWctxconfig*,const _GLFWfbconfig*);
722
+ void (*destroyWindow)(_GLFWwindow*);
723
+ void (*setWindowTitle)(_GLFWwindow*,const char*);
724
+ void (*setWindowIcon)(_GLFWwindow*,int,const GLFWimage*);
725
+ void (*getWindowPos)(_GLFWwindow*,int*,int*);
726
+ void (*setWindowPos)(_GLFWwindow*,int,int);
727
+ void (*getWindowSize)(_GLFWwindow*,int*,int*);
728
+ void (*setWindowSize)(_GLFWwindow*,int,int);
729
+ void (*setWindowSizeLimits)(_GLFWwindow*,int,int,int,int);
730
+ void (*setWindowAspectRatio)(_GLFWwindow*,int,int);
731
+ void (*getFramebufferSize)(_GLFWwindow*,int*,int*);
732
+ void (*getWindowFrameSize)(_GLFWwindow*,int*,int*,int*,int*);
733
+ void (*getWindowContentScale)(_GLFWwindow*,float*,float*);
734
+ void (*iconifyWindow)(_GLFWwindow*);
735
+ void (*restoreWindow)(_GLFWwindow*);
736
+ void (*maximizeWindow)(_GLFWwindow*);
737
+ void (*showWindow)(_GLFWwindow*);
738
+ void (*hideWindow)(_GLFWwindow*);
739
+ void (*requestWindowAttention)(_GLFWwindow*);
740
+ void (*focusWindow)(_GLFWwindow*);
741
+ void (*setWindowMonitor)(_GLFWwindow*,_GLFWmonitor*,int,int,int,int,int);
742
+ GLFWbool (*windowFocused)(_GLFWwindow*);
743
+ GLFWbool (*windowIconified)(_GLFWwindow*);
744
+ GLFWbool (*windowVisible)(_GLFWwindow*);
745
+ GLFWbool (*windowMaximized)(_GLFWwindow*);
746
+ GLFWbool (*windowHovered)(_GLFWwindow*);
747
+ GLFWbool (*framebufferTransparent)(_GLFWwindow*);
748
+ float (*getWindowOpacity)(_GLFWwindow*);
749
+ void (*setWindowResizable)(_GLFWwindow*,GLFWbool);
750
+ void (*setWindowDecorated)(_GLFWwindow*,GLFWbool);
751
+ void (*setWindowFloating)(_GLFWwindow*,GLFWbool);
752
+ void (*setWindowOpacity)(_GLFWwindow*,float);
753
+ void (*setWindowMousePassthrough)(_GLFWwindow*,GLFWbool);
754
+ void (*pollEvents)(void);
755
+ void (*waitEvents)(void);
756
+ void (*waitEventsTimeout)(double);
757
+ void (*postEmptyEvent)(void);
758
+ // EGL
759
+ EGLenum (*getEGLPlatform)(EGLint**);
760
+ EGLNativeDisplayType (*getEGLNativeDisplay)(void);
761
+ EGLNativeWindowType (*getEGLNativeWindow)(_GLFWwindow*);
762
+ // vulkan
763
+ void (*getRequiredInstanceExtensions)(char**);
764
+ GLFWbool (*getPhysicalDevicePresentationSupport)(VkInstance,VkPhysicalDevice,uint32_t);
765
+ VkResult (*createWindowSurface)(VkInstance,_GLFWwindow*,const VkAllocationCallbacks*,VkSurfaceKHR*);
766
+ };
767
+
768
+ // Library global data
769
+ //
770
+ struct _GLFWlibrary
771
+ {
772
+ GLFWbool initialized;
773
+ GLFWallocator allocator;
774
+
775
+ _GLFWplatform platform;
776
+
777
+ struct {
778
+ _GLFWinitconfig init;
779
+ _GLFWfbconfig framebuffer;
780
+ _GLFWwndconfig window;
781
+ _GLFWctxconfig context;
782
+ int refreshRate;
783
+ } hints;
784
+
785
+ _GLFWerror* errorListHead;
786
+ _GLFWcursor* cursorListHead;
787
+ _GLFWwindow* windowListHead;
788
+
789
+ _GLFWmonitor** monitors;
790
+ int monitorCount;
791
+
792
+ GLFWbool joysticksInitialized;
793
+ _GLFWjoystick joysticks[GLFW_JOYSTICK_LAST + 1];
794
+ _GLFWmapping* mappings;
795
+ int mappingCount;
796
+
797
+ _GLFWtls errorSlot;
798
+ _GLFWtls contextSlot;
799
+ _GLFWmutex errorLock;
800
+
801
+ struct {
802
+ uint64_t offset;
803
+ // This is defined in platform.h
804
+ GLFW_PLATFORM_LIBRARY_TIMER_STATE
805
+ } timer;
806
+
807
+ struct {
808
+ EGLenum platform;
809
+ EGLDisplay display;
810
+ EGLint major, minor;
811
+ GLFWbool prefix;
812
+
813
+ GLFWbool KHR_create_context;
814
+ GLFWbool KHR_create_context_no_error;
815
+ GLFWbool KHR_gl_colorspace;
816
+ GLFWbool KHR_get_all_proc_addresses;
817
+ GLFWbool KHR_context_flush_control;
818
+ GLFWbool EXT_client_extensions;
819
+ GLFWbool EXT_platform_base;
820
+ GLFWbool EXT_platform_x11;
821
+ GLFWbool EXT_platform_wayland;
822
+ GLFWbool EXT_present_opaque;
823
+ GLFWbool ANGLE_platform_angle;
824
+ GLFWbool ANGLE_platform_angle_opengl;
825
+ GLFWbool ANGLE_platform_angle_d3d;
826
+ GLFWbool ANGLE_platform_angle_vulkan;
827
+ GLFWbool ANGLE_platform_angle_metal;
828
+
829
+ void* handle;
830
+
831
+ PFN_eglGetConfigAttrib GetConfigAttrib;
832
+ PFN_eglGetConfigs GetConfigs;
833
+ PFN_eglGetDisplay GetDisplay;
834
+ PFN_eglGetError GetError;
835
+ PFN_eglInitialize Initialize;
836
+ PFN_eglTerminate Terminate;
837
+ PFN_eglBindAPI BindAPI;
838
+ PFN_eglCreateContext CreateContext;
839
+ PFN_eglDestroySurface DestroySurface;
840
+ PFN_eglDestroyContext DestroyContext;
841
+ PFN_eglCreateWindowSurface CreateWindowSurface;
842
+ PFN_eglMakeCurrent MakeCurrent;
843
+ PFN_eglSwapBuffers SwapBuffers;
844
+ PFN_eglSwapInterval SwapInterval;
845
+ PFN_eglQueryString QueryString;
846
+ PFN_eglGetProcAddress GetProcAddress;
847
+
848
+ PFNEGLGETPLATFORMDISPLAYEXTPROC GetPlatformDisplayEXT;
849
+ PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC CreatePlatformWindowSurfaceEXT;
850
+ } egl;
851
+
852
+ struct {
853
+ void* handle;
854
+
855
+ PFN_OSMesaCreateContextExt CreateContextExt;
856
+ PFN_OSMesaCreateContextAttribs CreateContextAttribs;
857
+ PFN_OSMesaDestroyContext DestroyContext;
858
+ PFN_OSMesaMakeCurrent MakeCurrent;
859
+ PFN_OSMesaGetColorBuffer GetColorBuffer;
860
+ PFN_OSMesaGetDepthBuffer GetDepthBuffer;
861
+ PFN_OSMesaGetProcAddress GetProcAddress;
862
+
863
+ } osmesa;
864
+
865
+ struct {
866
+ GLFWbool available;
867
+ void* handle;
868
+ char* extensions[2];
869
+ PFN_vkGetInstanceProcAddr GetInstanceProcAddr;
870
+ GLFWbool KHR_surface;
871
+ GLFWbool KHR_win32_surface;
872
+ GLFWbool MVK_macos_surface;
873
+ GLFWbool EXT_metal_surface;
874
+ GLFWbool KHR_xlib_surface;
875
+ GLFWbool KHR_xcb_surface;
876
+ GLFWbool KHR_wayland_surface;
877
+ } vk;
878
+
879
+ struct {
880
+ GLFWmonitorfun monitor;
881
+ GLFWjoystickfun joystick;
882
+ } callbacks;
883
+
884
+ // These are defined in platform.h
885
+ GLFW_PLATFORM_LIBRARY_WINDOW_STATE
886
+ GLFW_PLATFORM_LIBRARY_CONTEXT_STATE
887
+ GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE
888
+ };
889
+
890
+ // Global state shared between compilation units of GLFW
891
+ //
892
+ extern _GLFWlibrary _glfw;
893
+
894
+
895
+ //////////////////////////////////////////////////////////////////////////
896
+ ////// GLFW platform API //////
897
+ //////////////////////////////////////////////////////////////////////////
898
+
899
+ void _glfwPlatformInitTimer(void);
900
+ uint64_t _glfwPlatformGetTimerValue(void);
901
+ uint64_t _glfwPlatformGetTimerFrequency(void);
902
+
903
+ GLFWbool _glfwPlatformCreateTls(_GLFWtls* tls);
904
+ void _glfwPlatformDestroyTls(_GLFWtls* tls);
905
+ void* _glfwPlatformGetTls(_GLFWtls* tls);
906
+ void _glfwPlatformSetTls(_GLFWtls* tls, void* value);
907
+
908
+ GLFWbool _glfwPlatformCreateMutex(_GLFWmutex* mutex);
909
+ void _glfwPlatformDestroyMutex(_GLFWmutex* mutex);
910
+ void _glfwPlatformLockMutex(_GLFWmutex* mutex);
911
+ void _glfwPlatformUnlockMutex(_GLFWmutex* mutex);
912
+
913
+ void* _glfwPlatformLoadModule(const char* path);
914
+ void _glfwPlatformFreeModule(void* module);
915
+ GLFWproc _glfwPlatformGetModuleSymbol(void* module, const char* name);
916
+
917
+
918
+ //////////////////////////////////////////////////////////////////////////
919
+ ////// GLFW event API //////
920
+ //////////////////////////////////////////////////////////////////////////
921
+
922
+ void _glfwInputWindowFocus(_GLFWwindow* window, GLFWbool focused);
923
+ void _glfwInputWindowPos(_GLFWwindow* window, int xpos, int ypos);
924
+ void _glfwInputWindowSize(_GLFWwindow* window, int width, int height);
925
+ void _glfwInputFramebufferSize(_GLFWwindow* window, int width, int height);
926
+ void _glfwInputWindowContentScale(_GLFWwindow* window,
927
+ float xscale, float yscale);
928
+ void _glfwInputWindowIconify(_GLFWwindow* window, GLFWbool iconified);
929
+ void _glfwInputWindowMaximize(_GLFWwindow* window, GLFWbool maximized);
930
+ void _glfwInputWindowDamage(_GLFWwindow* window);
931
+ void _glfwInputWindowCloseRequest(_GLFWwindow* window);
932
+ void _glfwInputWindowMonitor(_GLFWwindow* window, _GLFWmonitor* monitor);
933
+
934
+ void _glfwInputKey(_GLFWwindow* window,
935
+ int key, int scancode, int action, int mods);
936
+ void _glfwInputChar(_GLFWwindow* window,
937
+ uint32_t codepoint, int mods, GLFWbool plain);
938
+ void _glfwInputScroll(_GLFWwindow* window, double xoffset, double yoffset);
939
+ void _glfwInputMouseClick(_GLFWwindow* window, int button, int action, int mods);
940
+ void _glfwInputCursorPos(_GLFWwindow* window, double xpos, double ypos);
941
+ void _glfwInputCursorEnter(_GLFWwindow* window, GLFWbool entered);
942
+ void _glfwInputDrop(_GLFWwindow* window, int count, const char** names);
943
+ void _glfwInputJoystick(_GLFWjoystick* js, int event);
944
+ void _glfwInputJoystickAxis(_GLFWjoystick* js, int axis, float value);
945
+ void _glfwInputJoystickButton(_GLFWjoystick* js, int button, char value);
946
+ void _glfwInputJoystickHat(_GLFWjoystick* js, int hat, char value);
947
+
948
+ void _glfwInputMonitor(_GLFWmonitor* monitor, int action, int placement);
949
+ void _glfwInputMonitorWindow(_GLFWmonitor* monitor, _GLFWwindow* window);
950
+
951
+ #if defined(__GNUC__)
952
+ void _glfwInputError(int code, const char* format, ...)
953
+ __attribute__((format(printf, 2, 3)));
954
+ #else
955
+ void _glfwInputError(int code, const char* format, ...);
956
+ #endif
957
+
958
+
959
+ //////////////////////////////////////////////////////////////////////////
960
+ ////// GLFW internal API //////
961
+ //////////////////////////////////////////////////////////////////////////
962
+
963
+ GLFWbool _glfwSelectPlatform(int platformID, _GLFWplatform* platform);
964
+
965
+ GLFWbool _glfwStringInExtensionString(const char* string, const char* extensions);
966
+ const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired,
967
+ const _GLFWfbconfig* alternatives,
968
+ unsigned int count);
969
+ GLFWbool _glfwRefreshContextAttribs(_GLFWwindow* window,
970
+ const _GLFWctxconfig* ctxconfig);
971
+ GLFWbool _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig);
972
+
973
+ const GLFWvidmode* _glfwChooseVideoMode(_GLFWmonitor* monitor,
974
+ const GLFWvidmode* desired);
975
+ int _glfwCompareVideoModes(const GLFWvidmode* first, const GLFWvidmode* second);
976
+ _GLFWmonitor* _glfwAllocMonitor(const char* name, int widthMM, int heightMM);
977
+ void _glfwFreeMonitor(_GLFWmonitor* monitor);
978
+ void _glfwAllocGammaArrays(GLFWgammaramp* ramp, unsigned int size);
979
+ void _glfwFreeGammaArrays(GLFWgammaramp* ramp);
980
+ void _glfwSplitBPP(int bpp, int* red, int* green, int* blue);
981
+
982
+ void _glfwInitGamepadMappings(void);
983
+ _GLFWjoystick* _glfwAllocJoystick(const char* name,
984
+ const char* guid,
985
+ int axisCount,
986
+ int buttonCount,
987
+ int hatCount);
988
+ void _glfwFreeJoystick(_GLFWjoystick* js);
989
+ void _glfwCenterCursorInContentArea(_GLFWwindow* window);
990
+
991
+ GLFWbool _glfwInitEGL(void);
992
+ void _glfwTerminateEGL(void);
993
+ GLFWbool _glfwCreateContextEGL(_GLFWwindow* window,
994
+ const _GLFWctxconfig* ctxconfig,
995
+ const _GLFWfbconfig* fbconfig);
996
+ #if defined(_GLFW_X11)
997
+ GLFWbool _glfwChooseVisualEGL(const _GLFWwndconfig* wndconfig,
998
+ const _GLFWctxconfig* ctxconfig,
999
+ const _GLFWfbconfig* fbconfig,
1000
+ Visual** visual, int* depth);
1001
+ #endif /*_GLFW_X11*/
1002
+
1003
+ GLFWbool _glfwInitOSMesa(void);
1004
+ void _glfwTerminateOSMesa(void);
1005
+ GLFWbool _glfwCreateContextOSMesa(_GLFWwindow* window,
1006
+ const _GLFWctxconfig* ctxconfig,
1007
+ const _GLFWfbconfig* fbconfig);
1008
+
1009
+ GLFWbool _glfwInitVulkan(int mode);
1010
+ void _glfwTerminateVulkan(void);
1011
+ const char* _glfwGetVulkanResultString(VkResult result);
1012
+
1013
+ size_t _glfwEncodeUTF8(char* s, uint32_t codepoint);
1014
+ char** _glfwParseUriList(char* text, int* count);
1015
+
1016
+ char* _glfw_strdup(const char* source);
1017
+ int _glfw_min(int a, int b);
1018
+ int _glfw_max(int a, int b);
1019
+
1020
+ void* _glfw_calloc(size_t count, size_t size);
1021
+ void* _glfw_realloc(void* pointer, size_t size);
1022
+ void _glfw_free(void* pointer);