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

Generated with cgit - Back to sebastiano.tronto.net