]> git.sesse.net Git - pistorm/blob - raylib/external/glfw/src/internal.h
Update raylib files and Makefile for Pi 4 testing
[pistorm] / raylib / external / glfw / src / internal.h
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 "../include/GLFW/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
63 typedef struct _GLFWerror       _GLFWerror;
64 typedef struct _GLFWinitconfig  _GLFWinitconfig;
65 typedef struct _GLFWwndconfig   _GLFWwndconfig;
66 typedef struct _GLFWctxconfig   _GLFWctxconfig;
67 typedef struct _GLFWfbconfig    _GLFWfbconfig;
68 typedef struct _GLFWcontext     _GLFWcontext;
69 typedef struct _GLFWwindow      _GLFWwindow;
70 typedef struct _GLFWlibrary     _GLFWlibrary;
71 typedef struct _GLFWmonitor     _GLFWmonitor;
72 typedef struct _GLFWcursor      _GLFWcursor;
73 typedef struct _GLFWmapelement  _GLFWmapelement;
74 typedef struct _GLFWmapping     _GLFWmapping;
75 typedef struct _GLFWjoystick    _GLFWjoystick;
76 typedef struct _GLFWtls         _GLFWtls;
77 typedef struct _GLFWmutex       _GLFWmutex;
78
79 typedef void (* _GLFWmakecontextcurrentfun)(_GLFWwindow*);
80 typedef void (* _GLFWswapbuffersfun)(_GLFWwindow*);
81 typedef void (* _GLFWswapintervalfun)(int);
82 typedef int (* _GLFWextensionsupportedfun)(const char*);
83 typedef GLFWglproc (* _GLFWgetprocaddressfun)(const char*);
84 typedef void (* _GLFWdestroycontextfun)(_GLFWwindow*);
85
86 #define GL_VERSION 0x1f02
87 #define GL_NONE 0
88 #define GL_COLOR_BUFFER_BIT 0x00004000
89 #define GL_UNSIGNED_BYTE 0x1401
90 #define GL_EXTENSIONS 0x1f03
91 #define GL_NUM_EXTENSIONS 0x821d
92 #define GL_CONTEXT_FLAGS 0x821e
93 #define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x00000001
94 #define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002
95 #define GL_CONTEXT_PROFILE_MASK 0x9126
96 #define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002
97 #define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001
98 #define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
99 #define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252
100 #define GL_NO_RESET_NOTIFICATION_ARB 0x8261
101 #define GL_CONTEXT_RELEASE_BEHAVIOR 0x82fb
102 #define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH 0x82fc
103 #define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008
104
105 typedef int GLint;
106 typedef unsigned int GLuint;
107 typedef unsigned int GLenum;
108 typedef unsigned int GLbitfield;
109 typedef unsigned char GLubyte;
110
111 typedef void (APIENTRY * PFNGLCLEARPROC)(GLbitfield);
112 typedef const GLubyte* (APIENTRY * PFNGLGETSTRINGPROC)(GLenum);
113 typedef void (APIENTRY * PFNGLGETINTEGERVPROC)(GLenum,GLint*);
114 typedef const GLubyte* (APIENTRY * PFNGLGETSTRINGIPROC)(GLenum,GLuint);
115
116 #define VK_NULL_HANDLE 0
117
118 typedef void* VkInstance;
119 typedef void* VkPhysicalDevice;
120 typedef uint64_t VkSurfaceKHR;
121 typedef uint32_t VkFlags;
122 typedef uint32_t VkBool32;
123
124 typedef enum VkStructureType
125 {
126     VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000,
127     VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000,
128     VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000,
129     VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000,
130     VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK = 1000123000,
131     VK_STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT = 1000217000,
132     VK_STRUCTURE_TYPE_MAX_ENUM = 0x7FFFFFFF
133 } VkStructureType;
134
135 typedef enum VkResult
136 {
137     VK_SUCCESS = 0,
138     VK_NOT_READY = 1,
139     VK_TIMEOUT = 2,
140     VK_EVENT_SET = 3,
141     VK_EVENT_RESET = 4,
142     VK_INCOMPLETE = 5,
143     VK_ERROR_OUT_OF_HOST_MEMORY = -1,
144     VK_ERROR_OUT_OF_DEVICE_MEMORY = -2,
145     VK_ERROR_INITIALIZATION_FAILED = -3,
146     VK_ERROR_DEVICE_LOST = -4,
147     VK_ERROR_MEMORY_MAP_FAILED = -5,
148     VK_ERROR_LAYER_NOT_PRESENT = -6,
149     VK_ERROR_EXTENSION_NOT_PRESENT = -7,
150     VK_ERROR_FEATURE_NOT_PRESENT = -8,
151     VK_ERROR_INCOMPATIBLE_DRIVER = -9,
152     VK_ERROR_TOO_MANY_OBJECTS = -10,
153     VK_ERROR_FORMAT_NOT_SUPPORTED = -11,
154     VK_ERROR_SURFACE_LOST_KHR = -1000000000,
155     VK_SUBOPTIMAL_KHR = 1000001003,
156     VK_ERROR_OUT_OF_DATE_KHR = -1000001004,
157     VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = -1000003001,
158     VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = -1000000001,
159     VK_ERROR_VALIDATION_FAILED_EXT = -1000011001,
160     VK_RESULT_MAX_ENUM = 0x7FFFFFFF
161 } VkResult;
162
163 typedef struct VkAllocationCallbacks VkAllocationCallbacks;
164
165 typedef struct VkExtensionProperties
166 {
167     char            extensionName[256];
168     uint32_t        specVersion;
169 } VkExtensionProperties;
170
171 typedef void (APIENTRY * PFN_vkVoidFunction)(void);
172
173 #if defined(_GLFW_VULKAN_STATIC)
174   PFN_vkVoidFunction vkGetInstanceProcAddr(VkInstance,const char*);
175   VkResult vkEnumerateInstanceExtensionProperties(const char*,uint32_t*,VkExtensionProperties*);
176 #else
177   typedef PFN_vkVoidFunction (APIENTRY * PFN_vkGetInstanceProcAddr)(VkInstance,const char*);
178   typedef VkResult (APIENTRY * PFN_vkEnumerateInstanceExtensionProperties)(const char*,uint32_t*,VkExtensionProperties*);
179   #define vkEnumerateInstanceExtensionProperties _glfw.vk.EnumerateInstanceExtensionProperties
180   #define vkGetInstanceProcAddr _glfw.vk.GetInstanceProcAddr
181 #endif
182
183 #if defined(_GLFW_COCOA)
184  #include "cocoa_platform.h"
185 #elif defined(_GLFW_WIN32)
186  #include "win32_platform.h"
187 #elif defined(_GLFW_X11)
188  #include "x11_platform.h"
189 #elif defined(_GLFW_WAYLAND)
190  #include "wl_platform.h"
191 #elif defined(_GLFW_OSMESA)
192  #include "null_platform.h"
193 #else
194  #error "No supported window creation API selected"
195 #endif
196
197 #include "egl_context.h"
198 #include "osmesa_context.h"
199
200 // Constructs a version number string from the public header macros
201 #define _GLFW_CONCAT_VERSION(m, n, r) #m "." #n "." #r
202 #define _GLFW_MAKE_VERSION(m, n, r) _GLFW_CONCAT_VERSION(m, n, r)
203 #define _GLFW_VERSION_NUMBER _GLFW_MAKE_VERSION(GLFW_VERSION_MAJOR, \
204                                                 GLFW_VERSION_MINOR, \
205                                                 GLFW_VERSION_REVISION)
206
207 // Checks for whether the library has been initialized
208 #define _GLFW_REQUIRE_INIT()                         \
209     if (!_glfw.initialized)                          \
210     {                                                \
211         _glfwInputError(GLFW_NOT_INITIALIZED, NULL); \
212         return;                                      \
213     }
214 #define _GLFW_REQUIRE_INIT_OR_RETURN(x)              \
215     if (!_glfw.initialized)                          \
216     {                                                \
217         _glfwInputError(GLFW_NOT_INITIALIZED, NULL); \
218         return x;                                    \
219     }
220
221 // Swaps the provided pointers
222 #define _GLFW_SWAP_POINTERS(x, y) \
223     {                             \
224         void* t;                  \
225         t = x;                    \
226         x = y;                    \
227         y = t;                    \
228     }
229
230 // Per-thread error structure
231 //
232 struct _GLFWerror
233 {
234     _GLFWerror*     next;
235     int             code;
236     char            description[_GLFW_MESSAGE_SIZE];
237 };
238
239 // Initialization configuration
240 //
241 // Parameters relating to the initialization of the library
242 //
243 struct _GLFWinitconfig
244 {
245     GLFWbool      hatButtons;
246     int           angleType;
247     struct {
248         GLFWbool  menubar;
249         GLFWbool  chdir;
250     } ns;
251 };
252
253 // Window configuration
254 //
255 // Parameters relating to the creation of the window but not directly related
256 // to the framebuffer.  This is used to pass window creation parameters from
257 // shared code to the platform API.
258 //
259 struct _GLFWwndconfig
260 {
261     int           width;
262     int           height;
263     const char*   title;
264     GLFWbool      resizable;
265     GLFWbool      visible;
266     GLFWbool      decorated;
267     GLFWbool      focused;
268     GLFWbool      autoIconify;
269     GLFWbool      floating;
270     GLFWbool      maximized;
271     GLFWbool      centerCursor;
272     GLFWbool      focusOnShow;
273     GLFWbool      mousePassthrough;
274     GLFWbool      scaleToMonitor;
275     struct {
276         GLFWbool  retina;
277         char      frameName[256];
278     } ns;
279     struct {
280         char      className[256];
281         char      instanceName[256];
282     } x11;
283     struct {
284         GLFWbool  keymenu;
285     } win32;
286 };
287
288 // Context configuration
289 //
290 // Parameters relating to the creation of the context but not directly related
291 // to the framebuffer.  This is used to pass context creation parameters from
292 // shared code to the platform API.
293 //
294 struct _GLFWctxconfig
295 {
296     int           client;
297     int           source;
298     int           major;
299     int           minor;
300     GLFWbool      forward;
301     GLFWbool      debug;
302     GLFWbool      noerror;
303     int           profile;
304     int           robustness;
305     int           release;
306     _GLFWwindow*  share;
307     struct {
308         GLFWbool  offline;
309     } nsgl;
310 };
311
312 // Framebuffer configuration
313 //
314 // This describes buffers and their sizes.  It also contains
315 // a platform-specific ID used to map back to the backend API object.
316 //
317 // It is used to pass framebuffer parameters from shared code to the platform
318 // API and also to enumerate and select available framebuffer configs.
319 //
320 struct _GLFWfbconfig
321 {
322     int         redBits;
323     int         greenBits;
324     int         blueBits;
325     int         alphaBits;
326     int         depthBits;
327     int         stencilBits;
328     int         accumRedBits;
329     int         accumGreenBits;
330     int         accumBlueBits;
331     int         accumAlphaBits;
332     int         auxBuffers;
333     GLFWbool    stereo;
334     int         samples;
335     GLFWbool    sRGB;
336     GLFWbool    doublebuffer;
337     GLFWbool    transparent;
338     uintptr_t   handle;
339 };
340
341 // Context structure
342 //
343 struct _GLFWcontext
344 {
345     int                 client;
346     int                 source;
347     int                 major, minor, revision;
348     GLFWbool            forward, debug, noerror;
349     int                 profile;
350     int                 robustness;
351     int                 release;
352
353     PFNGLGETSTRINGIPROC GetStringi;
354     PFNGLGETINTEGERVPROC GetIntegerv;
355     PFNGLGETSTRINGPROC  GetString;
356
357     _GLFWmakecontextcurrentfun  makeCurrent;
358     _GLFWswapbuffersfun         swapBuffers;
359     _GLFWswapintervalfun        swapInterval;
360     _GLFWextensionsupportedfun  extensionSupported;
361     _GLFWgetprocaddressfun      getProcAddress;
362     _GLFWdestroycontextfun      destroy;
363
364     // This is defined in the context API's context.h
365     _GLFW_PLATFORM_CONTEXT_STATE;
366     // This is defined in egl_context.h
367     _GLFWcontextEGL egl;
368     // This is defined in osmesa_context.h
369     _GLFWcontextOSMesa osmesa;
370 };
371
372 // Window and context structure
373 //
374 struct _GLFWwindow
375 {
376     struct _GLFWwindow* next;
377
378     // Window settings and state
379     GLFWbool            resizable;
380     GLFWbool            decorated;
381     GLFWbool            autoIconify;
382     GLFWbool            floating;
383     GLFWbool            focusOnShow;
384     GLFWbool            mousePassthrough;
385     GLFWbool            shouldClose;
386     void*               userPointer;
387     GLFWvidmode         videoMode;
388     _GLFWmonitor*       monitor;
389     _GLFWcursor*        cursor;
390
391     int                 minwidth, minheight;
392     int                 maxwidth, maxheight;
393     int                 numer, denom;
394
395     GLFWbool            stickyKeys;
396     GLFWbool            stickyMouseButtons;
397     GLFWbool            lockKeyMods;
398     int                 cursorMode;
399     char                mouseButtons[GLFW_MOUSE_BUTTON_LAST + 1];
400     char                keys[GLFW_KEY_LAST + 1];
401     // Virtual cursor position when cursor is disabled
402     double              virtualCursorPosX, virtualCursorPosY;
403     GLFWbool            rawMouseMotion;
404
405     _GLFWcontext        context;
406
407     struct {
408         GLFWwindowposfun        pos;
409         GLFWwindowsizefun       size;
410         GLFWwindowclosefun      close;
411         GLFWwindowrefreshfun    refresh;
412         GLFWwindowfocusfun      focus;
413         GLFWwindowiconifyfun    iconify;
414         GLFWwindowmaximizefun   maximize;
415         GLFWframebuffersizefun  fbsize;
416         GLFWwindowcontentscalefun scale;
417         GLFWmousebuttonfun      mouseButton;
418         GLFWcursorposfun        cursorPos;
419         GLFWcursorenterfun      cursorEnter;
420         GLFWscrollfun           scroll;
421         GLFWkeyfun              key;
422         GLFWcharfun             character;
423         GLFWcharmodsfun         charmods;
424         GLFWdropfun             drop;
425     } callbacks;
426
427     // This is defined in the window API's platform.h
428     _GLFW_PLATFORM_WINDOW_STATE;
429 };
430
431 // Monitor structure
432 //
433 struct _GLFWmonitor
434 {
435     char*           name;
436     void*           userPointer;
437
438     // Physical dimensions in millimeters.
439     int             widthMM, heightMM;
440
441     // The window whose video mode is current on this monitor
442     _GLFWwindow*    window;
443
444     GLFWvidmode*    modes;
445     int             modeCount;
446     GLFWvidmode     currentMode;
447
448     GLFWgammaramp   originalRamp;
449     GLFWgammaramp   currentRamp;
450
451     // This is defined in the window API's platform.h
452     _GLFW_PLATFORM_MONITOR_STATE;
453 };
454
455 // Cursor structure
456 //
457 struct _GLFWcursor
458 {
459     _GLFWcursor*    next;
460
461     // This is defined in the window API's platform.h
462     _GLFW_PLATFORM_CURSOR_STATE;
463 };
464
465 // Gamepad mapping element structure
466 //
467 struct _GLFWmapelement
468 {
469     uint8_t         type;
470     uint8_t         index;
471     int8_t          axisScale;
472     int8_t          axisOffset;
473 };
474
475 // Gamepad mapping structure
476 //
477 struct _GLFWmapping
478 {
479     char            name[128];
480     char            guid[33];
481     _GLFWmapelement buttons[15];
482     _GLFWmapelement axes[6];
483 };
484
485 // Joystick structure
486 //
487 struct _GLFWjoystick
488 {
489     GLFWbool        present;
490     float*          axes;
491     int             axisCount;
492     unsigned char*  buttons;
493     int             buttonCount;
494     unsigned char*  hats;
495     int             hatCount;
496     char*           name;
497     void*           userPointer;
498     char            guid[33];
499     _GLFWmapping*   mapping;
500
501     // This is defined in the joystick API's joystick.h
502     _GLFW_PLATFORM_JOYSTICK_STATE;
503 };
504
505 // Thread local storage structure
506 //
507 struct _GLFWtls
508 {
509     // This is defined in the platform's thread.h
510     _GLFW_PLATFORM_TLS_STATE;
511 };
512
513 // Mutex structure
514 //
515 struct _GLFWmutex
516 {
517     // This is defined in the platform's thread.h
518     _GLFW_PLATFORM_MUTEX_STATE;
519 };
520
521 // Library global data
522 //
523 struct _GLFWlibrary
524 {
525     GLFWbool            initialized;
526
527     struct {
528         _GLFWinitconfig init;
529         _GLFWfbconfig   framebuffer;
530         _GLFWwndconfig  window;
531         _GLFWctxconfig  context;
532         int             refreshRate;
533     } hints;
534
535     _GLFWerror*         errorListHead;
536     _GLFWcursor*        cursorListHead;
537     _GLFWwindow*        windowListHead;
538
539     _GLFWmonitor**      monitors;
540     int                 monitorCount;
541
542     GLFWbool            joysticksInitialized;
543     _GLFWjoystick       joysticks[GLFW_JOYSTICK_LAST + 1];
544     _GLFWmapping*       mappings;
545     int                 mappingCount;
546
547     _GLFWtls            errorSlot;
548     _GLFWtls            contextSlot;
549     _GLFWmutex          errorLock;
550
551     struct {
552         uint64_t        offset;
553         // This is defined in the platform's time.h
554         _GLFW_PLATFORM_LIBRARY_TIMER_STATE;
555     } timer;
556
557     struct {
558         GLFWbool        available;
559         void*           handle;
560         char*           extensions[2];
561 #if !defined(_GLFW_VULKAN_STATIC)
562         PFN_vkEnumerateInstanceExtensionProperties EnumerateInstanceExtensionProperties;
563         PFN_vkGetInstanceProcAddr GetInstanceProcAddr;
564 #endif
565         GLFWbool        KHR_surface;
566 #if defined(_GLFW_WIN32)
567         GLFWbool        KHR_win32_surface;
568 #elif defined(_GLFW_COCOA)
569         GLFWbool        MVK_macos_surface;
570         GLFWbool        EXT_metal_surface;
571 #elif defined(_GLFW_X11)
572         GLFWbool        KHR_xlib_surface;
573         GLFWbool        KHR_xcb_surface;
574 #elif defined(_GLFW_WAYLAND)
575         GLFWbool        KHR_wayland_surface;
576 #endif
577     } vk;
578
579     struct {
580         GLFWmonitorfun  monitor;
581         GLFWjoystickfun joystick;
582     } callbacks;
583
584     // This is defined in the window API's platform.h
585     _GLFW_PLATFORM_LIBRARY_WINDOW_STATE;
586     // This is defined in the context API's context.h
587     _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE;
588     // This is defined in the platform's joystick.h
589     _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE;
590     // This is defined in egl_context.h
591     _GLFWlibraryEGL egl;
592     // This is defined in osmesa_context.h
593     _GLFWlibraryOSMesa osmesa;
594 };
595
596 // Global state shared between compilation units of GLFW
597 //
598 extern _GLFWlibrary _glfw;
599
600
601 //////////////////////////////////////////////////////////////////////////
602 //////                       GLFW platform API                      //////
603 //////////////////////////////////////////////////////////////////////////
604
605 int _glfwPlatformInit(void);
606 void _glfwPlatformTerminate(void);
607 const char* _glfwPlatformGetVersionString(void);
608
609 void _glfwPlatformGetCursorPos(_GLFWwindow* window, double* xpos, double* ypos);
610 void _glfwPlatformSetCursorPos(_GLFWwindow* window, double xpos, double ypos);
611 void _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode);
612 void _glfwPlatformSetRawMouseMotion(_GLFWwindow *window, GLFWbool enabled);
613 GLFWbool _glfwPlatformRawMouseMotionSupported(void);
614 int _glfwPlatformCreateCursor(_GLFWcursor* cursor,
615                               const GLFWimage* image, int xhot, int yhot);
616 int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape);
617 void _glfwPlatformDestroyCursor(_GLFWcursor* cursor);
618 void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor);
619
620 const char* _glfwPlatformGetScancodeName(int scancode);
621 int _glfwPlatformGetKeyScancode(int key);
622
623 void _glfwPlatformFreeMonitor(_GLFWmonitor* monitor);
624 void _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor, int* xpos, int* ypos);
625 void _glfwPlatformGetMonitorContentScale(_GLFWmonitor* monitor,
626                                          float* xscale, float* yscale);
627 void _glfwPlatformGetMonitorWorkarea(_GLFWmonitor* monitor, int* xpos, int* ypos, int *width, int *height);
628 GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* count);
629 void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode* mode);
630 GLFWbool _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp);
631 void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp);
632
633 void _glfwPlatformSetClipboardString(const char* string);
634 const char* _glfwPlatformGetClipboardString(void);
635
636 GLFWbool _glfwPlatformInitJoysticks(void);
637 void _glfwPlatformTerminateJoysticks(void);
638 int _glfwPlatformPollJoystick(_GLFWjoystick* js, int mode);
639 void _glfwPlatformUpdateGamepadGUID(char* guid);
640
641 uint64_t _glfwPlatformGetTimerValue(void);
642 uint64_t _glfwPlatformGetTimerFrequency(void);
643
644 int _glfwPlatformCreateWindow(_GLFWwindow* window,
645                               const _GLFWwndconfig* wndconfig,
646                               const _GLFWctxconfig* ctxconfig,
647                               const _GLFWfbconfig* fbconfig);
648 void _glfwPlatformDestroyWindow(_GLFWwindow* window);
649 void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title);
650 void _glfwPlatformSetWindowIcon(_GLFWwindow* window,
651                                 int count, const GLFWimage* images);
652 void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos);
653 void _glfwPlatformSetWindowPos(_GLFWwindow* window, int xpos, int ypos);
654 void _glfwPlatformGetWindowSize(_GLFWwindow* window, int* width, int* height);
655 void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height);
656 void _glfwPlatformSetWindowSizeLimits(_GLFWwindow* window,
657                                       int minwidth, int minheight,
658                                       int maxwidth, int maxheight);
659 void _glfwPlatformSetWindowAspectRatio(_GLFWwindow* window, int numer, int denom);
660 void _glfwPlatformGetFramebufferSize(_GLFWwindow* window, int* width, int* height);
661 void _glfwPlatformGetWindowFrameSize(_GLFWwindow* window,
662                                      int* left, int* top,
663                                      int* right, int* bottom);
664 void _glfwPlatformGetWindowContentScale(_GLFWwindow* window,
665                                         float* xscale, float* yscale);
666 void _glfwPlatformIconifyWindow(_GLFWwindow* window);
667 void _glfwPlatformRestoreWindow(_GLFWwindow* window);
668 void _glfwPlatformMaximizeWindow(_GLFWwindow* window);
669 void _glfwPlatformShowWindow(_GLFWwindow* window);
670 void _glfwPlatformHideWindow(_GLFWwindow* window);
671 void _glfwPlatformRequestWindowAttention(_GLFWwindow* window);
672 void _glfwPlatformFocusWindow(_GLFWwindow* window);
673 void _glfwPlatformSetWindowMonitor(_GLFWwindow* window, _GLFWmonitor* monitor,
674                                    int xpos, int ypos, int width, int height,
675                                    int refreshRate);
676 int _glfwPlatformWindowFocused(_GLFWwindow* window);
677 int _glfwPlatformWindowIconified(_GLFWwindow* window);
678 int _glfwPlatformWindowVisible(_GLFWwindow* window);
679 int _glfwPlatformWindowMaximized(_GLFWwindow* window);
680 int _glfwPlatformWindowHovered(_GLFWwindow* window);
681 int _glfwPlatformFramebufferTransparent(_GLFWwindow* window);
682 float _glfwPlatformGetWindowOpacity(_GLFWwindow* window);
683 void _glfwPlatformSetWindowResizable(_GLFWwindow* window, GLFWbool enabled);
684 void _glfwPlatformSetWindowDecorated(_GLFWwindow* window, GLFWbool enabled);
685 void _glfwPlatformSetWindowFloating(_GLFWwindow* window, GLFWbool enabled);
686 void _glfwPlatformSetWindowMousePassthrough(_GLFWwindow* window, GLFWbool enabled);
687 void _glfwPlatformSetWindowOpacity(_GLFWwindow* window, float opacity);
688
689 void _glfwPlatformPollEvents(void);
690 void _glfwPlatformWaitEvents(void);
691 void _glfwPlatformWaitEventsTimeout(double timeout);
692 void _glfwPlatformPostEmptyEvent(void);
693
694 EGLenum _glfwPlatformGetEGLPlatform(EGLint** attribs);
695 EGLNativeDisplayType _glfwPlatformGetEGLNativeDisplay(void);
696 EGLNativeWindowType _glfwPlatformGetEGLNativeWindow(_GLFWwindow* window);
697
698 void _glfwPlatformGetRequiredInstanceExtensions(char** extensions);
699 int _glfwPlatformGetPhysicalDevicePresentationSupport(VkInstance instance,
700                                                       VkPhysicalDevice device,
701                                                       uint32_t queuefamily);
702 VkResult _glfwPlatformCreateWindowSurface(VkInstance instance,
703                                           _GLFWwindow* window,
704                                           const VkAllocationCallbacks* allocator,
705                                           VkSurfaceKHR* surface);
706
707 GLFWbool _glfwPlatformCreateTls(_GLFWtls* tls);
708 void _glfwPlatformDestroyTls(_GLFWtls* tls);
709 void* _glfwPlatformGetTls(_GLFWtls* tls);
710 void _glfwPlatformSetTls(_GLFWtls* tls, void* value);
711
712 GLFWbool _glfwPlatformCreateMutex(_GLFWmutex* mutex);
713 void _glfwPlatformDestroyMutex(_GLFWmutex* mutex);
714 void _glfwPlatformLockMutex(_GLFWmutex* mutex);
715 void _glfwPlatformUnlockMutex(_GLFWmutex* mutex);
716
717
718 //////////////////////////////////////////////////////////////////////////
719 //////                         GLFW event API                       //////
720 //////////////////////////////////////////////////////////////////////////
721
722 void _glfwInputWindowFocus(_GLFWwindow* window, GLFWbool focused);
723 void _glfwInputWindowPos(_GLFWwindow* window, int xpos, int ypos);
724 void _glfwInputWindowSize(_GLFWwindow* window, int width, int height);
725 void _glfwInputFramebufferSize(_GLFWwindow* window, int width, int height);
726 void _glfwInputWindowContentScale(_GLFWwindow* window,
727                                   float xscale, float yscale);
728 void _glfwInputWindowIconify(_GLFWwindow* window, GLFWbool iconified);
729 void _glfwInputWindowMaximize(_GLFWwindow* window, GLFWbool maximized);
730 void _glfwInputWindowDamage(_GLFWwindow* window);
731 void _glfwInputWindowCloseRequest(_GLFWwindow* window);
732 void _glfwInputWindowMonitor(_GLFWwindow* window, _GLFWmonitor* monitor);
733
734 void _glfwInputKey(_GLFWwindow* window,
735                    int key, int scancode, int action, int mods);
736 void _glfwInputChar(_GLFWwindow* window,
737                     unsigned int codepoint, int mods, GLFWbool plain);
738 void _glfwInputScroll(_GLFWwindow* window, double xoffset, double yoffset);
739 void _glfwInputMouseClick(_GLFWwindow* window, int button, int action, int mods);
740 void _glfwInputCursorPos(_GLFWwindow* window, double xpos, double ypos);
741 void _glfwInputCursorEnter(_GLFWwindow* window, GLFWbool entered);
742 void _glfwInputDrop(_GLFWwindow* window, int count, const char** names);
743 void _glfwInputJoystick(_GLFWjoystick* js, int event);
744 void _glfwInputJoystickAxis(_GLFWjoystick* js, int axis, float value);
745 void _glfwInputJoystickButton(_GLFWjoystick* js, int button, char value);
746 void _glfwInputJoystickHat(_GLFWjoystick* js, int hat, char value);
747
748 void _glfwInputMonitor(_GLFWmonitor* monitor, int action, int placement);
749 void _glfwInputMonitorWindow(_GLFWmonitor* monitor, _GLFWwindow* window);
750
751 #if defined(__GNUC__)
752 void _glfwInputError(int code, const char* format, ...)
753     __attribute__((format(printf, 2, 3)));
754 #else
755 void _glfwInputError(int code, const char* format, ...);
756 #endif
757
758
759 //////////////////////////////////////////////////////////////////////////
760 //////                       GLFW internal API                      //////
761 //////////////////////////////////////////////////////////////////////////
762
763 GLFWbool _glfwStringInExtensionString(const char* string, const char* extensions);
764 const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired,
765                                          const _GLFWfbconfig* alternatives,
766                                          unsigned int count);
767 GLFWbool _glfwRefreshContextAttribs(_GLFWwindow* window,
768                                     const _GLFWctxconfig* ctxconfig);
769 GLFWbool _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig);
770
771 const GLFWvidmode* _glfwChooseVideoMode(_GLFWmonitor* monitor,
772                                         const GLFWvidmode* desired);
773 int _glfwCompareVideoModes(const GLFWvidmode* first, const GLFWvidmode* second);
774 _GLFWmonitor* _glfwAllocMonitor(const char* name, int widthMM, int heightMM);
775 void _glfwFreeMonitor(_GLFWmonitor* monitor);
776 void _glfwAllocGammaArrays(GLFWgammaramp* ramp, unsigned int size);
777 void _glfwFreeGammaArrays(GLFWgammaramp* ramp);
778 void _glfwSplitBPP(int bpp, int* red, int* green, int* blue);
779
780 _GLFWjoystick* _glfwAllocJoystick(const char* name,
781                                   const char* guid,
782                                   int axisCount,
783                                   int buttonCount,
784                                   int hatCount);
785 void _glfwFreeJoystick(_GLFWjoystick* js);
786 void _glfwCenterCursorInContentArea(_GLFWwindow* window);
787
788 GLFWbool _glfwInitVulkan(int mode);
789 void _glfwTerminateVulkan(void);
790 const char* _glfwGetVulkanResultString(VkResult result);
791
792 char* _glfw_strdup(const char* source);
793 float _glfw_fminf(float a, float b);
794 float _glfw_fmaxf(float a, float b);
795