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