]> git.sesse.net Git - pistorm/blob - raylib_pi4_test/external/glfw/src/egl_context.h
Update raylib files and Makefile for Pi 4 testing
[pistorm] / raylib_pi4_test / external / glfw / src / egl_context.h
1 //========================================================================
2 // GLFW 3.4 EGL - www.glfw.org
3 //------------------------------------------------------------------------
4 // Copyright (c) 2002-2006 Marcus Geelnard
5 // Copyright (c) 2006-2017 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 #if defined(_GLFW_WIN32)
29  #define EGLAPIENTRY __stdcall
30 #else
31  #define EGLAPIENTRY
32 #endif
33
34 #define EGL_SUCCESS 0x3000
35 #define EGL_NOT_INITIALIZED 0x3001
36 #define EGL_BAD_ACCESS 0x3002
37 #define EGL_BAD_ALLOC 0x3003
38 #define EGL_BAD_ATTRIBUTE 0x3004
39 #define EGL_BAD_CONFIG 0x3005
40 #define EGL_BAD_CONTEXT 0x3006
41 #define EGL_BAD_CURRENT_SURFACE 0x3007
42 #define EGL_BAD_DISPLAY 0x3008
43 #define EGL_BAD_MATCH 0x3009
44 #define EGL_BAD_NATIVE_PIXMAP 0x300a
45 #define EGL_BAD_NATIVE_WINDOW 0x300b
46 #define EGL_BAD_PARAMETER 0x300c
47 #define EGL_BAD_SURFACE 0x300d
48 #define EGL_CONTEXT_LOST 0x300e
49 #define EGL_COLOR_BUFFER_TYPE 0x303f
50 #define EGL_RGB_BUFFER 0x308e
51 #define EGL_SURFACE_TYPE 0x3033
52 #define EGL_WINDOW_BIT 0x0004
53 #define EGL_RENDERABLE_TYPE 0x3040
54 #define EGL_OPENGL_ES_BIT 0x0001
55 #define EGL_OPENGL_ES2_BIT 0x0004
56 #define EGL_OPENGL_BIT 0x0008
57 #define EGL_ALPHA_SIZE 0x3021
58 #define EGL_BLUE_SIZE 0x3022
59 #define EGL_GREEN_SIZE 0x3023
60 #define EGL_RED_SIZE 0x3024
61 #define EGL_DEPTH_SIZE 0x3025
62 #define EGL_STENCIL_SIZE 0x3026
63 #define EGL_SAMPLES 0x3031
64 #define EGL_OPENGL_ES_API 0x30a0
65 #define EGL_OPENGL_API 0x30a2
66 #define EGL_NONE 0x3038
67 #define EGL_EXTENSIONS 0x3055
68 #define EGL_CONTEXT_CLIENT_VERSION 0x3098
69 #define EGL_NATIVE_VISUAL_ID 0x302e
70 #define EGL_NO_SURFACE ((EGLSurface) 0)
71 #define EGL_NO_DISPLAY ((EGLDisplay) 0)
72 #define EGL_NO_CONTEXT ((EGLContext) 0)
73 #define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType) 0)
74
75 #define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002
76 #define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001
77 #define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002
78 #define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001
79 #define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31bd
80 #define EGL_NO_RESET_NOTIFICATION_KHR 0x31be
81 #define EGL_LOSE_CONTEXT_ON_RESET_KHR 0x31bf
82 #define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004
83 #define EGL_CONTEXT_MAJOR_VERSION_KHR 0x3098
84 #define EGL_CONTEXT_MINOR_VERSION_KHR 0x30fb
85 #define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30fd
86 #define EGL_CONTEXT_FLAGS_KHR 0x30fc
87 #define EGL_CONTEXT_OPENGL_NO_ERROR_KHR 0x31b3
88 #define EGL_GL_COLORSPACE_KHR 0x309d
89 #define EGL_GL_COLORSPACE_SRGB_KHR 0x3089
90 #define EGL_CONTEXT_RELEASE_BEHAVIOR_KHR 0x2097
91 #define EGL_CONTEXT_RELEASE_BEHAVIOR_NONE_KHR 0
92 #define EGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR 0x2098
93 #define EGL_PLATFORM_X11_EXT 0x31d5
94 #define EGL_PLATFORM_WAYLAND_EXT 0x31d8
95 #define EGL_PLATFORM_ANGLE_ANGLE 0x3202
96 #define EGL_PLATFORM_ANGLE_TYPE_ANGLE 0x3203
97 #define EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE 0x320d
98 #define EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE 0x320e
99 #define EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE 0x3207
100 #define EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE 0x3208
101 #define EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE 0x3450
102 #define EGL_PLATFORM_ANGLE_TYPE_METAL_ANGLE 0x3489
103 #define EGL_PLATFORM_ANGLE_NATIVE_PLATFORM_TYPE_ANGLE 0x348f
104
105 typedef int EGLint;
106 typedef unsigned int EGLBoolean;
107 typedef unsigned int EGLenum;
108 typedef void* EGLConfig;
109 typedef void* EGLContext;
110 typedef void* EGLDisplay;
111 typedef void* EGLSurface;
112
113 typedef void* EGLNativeDisplayType;
114 typedef void* EGLNativeWindowType;
115
116 // EGL function pointer typedefs
117 typedef EGLBoolean (EGLAPIENTRY * PFN_eglGetConfigAttrib)(EGLDisplay,EGLConfig,EGLint,EGLint*);
118 typedef EGLBoolean (EGLAPIENTRY * PFN_eglGetConfigs)(EGLDisplay,EGLConfig*,EGLint,EGLint*);
119 typedef EGLDisplay (EGLAPIENTRY * PFN_eglGetDisplay)(EGLNativeDisplayType);
120 typedef EGLint (EGLAPIENTRY * PFN_eglGetError)(void);
121 typedef EGLBoolean (EGLAPIENTRY * PFN_eglInitialize)(EGLDisplay,EGLint*,EGLint*);
122 typedef EGLBoolean (EGLAPIENTRY * PFN_eglTerminate)(EGLDisplay);
123 typedef EGLBoolean (EGLAPIENTRY * PFN_eglBindAPI)(EGLenum);
124 typedef EGLContext (EGLAPIENTRY * PFN_eglCreateContext)(EGLDisplay,EGLConfig,EGLContext,const EGLint*);
125 typedef EGLBoolean (EGLAPIENTRY * PFN_eglDestroySurface)(EGLDisplay,EGLSurface);
126 typedef EGLBoolean (EGLAPIENTRY * PFN_eglDestroyContext)(EGLDisplay,EGLContext);
127 typedef EGLSurface (EGLAPIENTRY * PFN_eglCreateWindowSurface)(EGLDisplay,EGLConfig,EGLNativeWindowType,const EGLint*);
128 typedef EGLBoolean (EGLAPIENTRY * PFN_eglMakeCurrent)(EGLDisplay,EGLSurface,EGLSurface,EGLContext);
129 typedef EGLBoolean (EGLAPIENTRY * PFN_eglSwapBuffers)(EGLDisplay,EGLSurface);
130 typedef EGLBoolean (EGLAPIENTRY * PFN_eglSwapInterval)(EGLDisplay,EGLint);
131 typedef const char* (EGLAPIENTRY * PFN_eglQueryString)(EGLDisplay,EGLint);
132 typedef GLFWglproc (EGLAPIENTRY * PFN_eglGetProcAddress)(const char*);
133 #define eglGetConfigAttrib _glfw.egl.GetConfigAttrib
134 #define eglGetConfigs _glfw.egl.GetConfigs
135 #define eglGetDisplay _glfw.egl.GetDisplay
136 #define eglGetError _glfw.egl.GetError
137 #define eglInitialize _glfw.egl.Initialize
138 #define eglTerminate _glfw.egl.Terminate
139 #define eglBindAPI _glfw.egl.BindAPI
140 #define eglCreateContext _glfw.egl.CreateContext
141 #define eglDestroySurface _glfw.egl.DestroySurface
142 #define eglDestroyContext _glfw.egl.DestroyContext
143 #define eglCreateWindowSurface _glfw.egl.CreateWindowSurface
144 #define eglMakeCurrent _glfw.egl.MakeCurrent
145 #define eglSwapBuffers _glfw.egl.SwapBuffers
146 #define eglSwapInterval _glfw.egl.SwapInterval
147 #define eglQueryString _glfw.egl.QueryString
148 #define eglGetProcAddress _glfw.egl.GetProcAddress
149
150 typedef EGLDisplay (EGLAPIENTRY * PFNEGLGETPLATFORMDISPLAYEXTPROC)(EGLenum,void*,const EGLint*);
151 typedef EGLSurface (EGLAPIENTRY * PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC)(EGLDisplay,EGLConfig,void*,const EGLint*);
152 #define eglGetPlatformDisplayEXT _glfw.egl.GetPlatformDisplayEXT
153 #define eglCreatePlatformWindowSurfaceEXT _glfw.egl.CreatePlatformWindowSurfaceEXT
154
155 // EGL-specific per-context data
156 //
157 typedef struct _GLFWcontextEGL
158 {
159    EGLConfig        config;
160    EGLContext       handle;
161    EGLSurface       surface;
162
163    void*            client;
164
165 } _GLFWcontextEGL;
166
167 // EGL-specific global data
168 //
169 typedef struct _GLFWlibraryEGL
170 {
171     EGLenum         platform;
172     EGLDisplay      display;
173     EGLint          major, minor;
174     GLFWbool        prefix;
175
176     GLFWbool        KHR_create_context;
177     GLFWbool        KHR_create_context_no_error;
178     GLFWbool        KHR_gl_colorspace;
179     GLFWbool        KHR_get_all_proc_addresses;
180     GLFWbool        KHR_context_flush_control;
181     GLFWbool        EXT_client_extensions;
182     GLFWbool        EXT_platform_base;
183     GLFWbool        EXT_platform_x11;
184     GLFWbool        EXT_platform_wayland;
185     GLFWbool        ANGLE_platform_angle;
186     GLFWbool        ANGLE_platform_angle_opengl;
187     GLFWbool        ANGLE_platform_angle_d3d;
188     GLFWbool        ANGLE_platform_angle_vulkan;
189     GLFWbool        ANGLE_platform_angle_metal;
190
191     void*           handle;
192
193     PFN_eglGetConfigAttrib      GetConfigAttrib;
194     PFN_eglGetConfigs           GetConfigs;
195     PFN_eglGetDisplay           GetDisplay;
196     PFN_eglGetError             GetError;
197     PFN_eglInitialize           Initialize;
198     PFN_eglTerminate            Terminate;
199     PFN_eglBindAPI              BindAPI;
200     PFN_eglCreateContext        CreateContext;
201     PFN_eglDestroySurface       DestroySurface;
202     PFN_eglDestroyContext       DestroyContext;
203     PFN_eglCreateWindowSurface  CreateWindowSurface;
204     PFN_eglMakeCurrent          MakeCurrent;
205     PFN_eglSwapBuffers          SwapBuffers;
206     PFN_eglSwapInterval         SwapInterval;
207     PFN_eglQueryString          QueryString;
208     PFN_eglGetProcAddress       GetProcAddress;
209
210     PFNEGLGETPLATFORMDISPLAYEXTPROC GetPlatformDisplayEXT;
211     PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC CreatePlatformWindowSurfaceEXT;
212
213 } _GLFWlibraryEGL;
214
215
216 GLFWbool _glfwInitEGL(void);
217 void _glfwTerminateEGL(void);
218 GLFWbool _glfwCreateContextEGL(_GLFWwindow* window,
219                                const _GLFWctxconfig* ctxconfig,
220                                const _GLFWfbconfig* fbconfig);
221 #if defined(_GLFW_X11)
222 GLFWbool _glfwChooseVisualEGL(const _GLFWwndconfig* wndconfig,
223                               const _GLFWctxconfig* ctxconfig,
224                               const _GLFWfbconfig* fbconfig,
225                               Visual** visual, int* depth);
226 #endif /*_GLFW_X11*/
227