Wise&mystical  1.0
Project about Europe
Loading...
Searching...
No Matches
egl_context.c
Go to the documentation of this file.
1//========================================================================
2// GLFW 3.4 EGL - 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// Please use C89 style variable declarations in this file because VS 2010
28//========================================================================
29
30#include "internal.h"
31
32#include <stdio.h>
33#include <string.h>
34#include <stdlib.h>
35#include <assert.h>
36
37
38// Return a description of the specified EGL error
39//
40static const char* getEGLErrorString(EGLint error)
41{
42 switch (error)
43 {
44 case EGL_SUCCESS:
45 return "Success";
47 return "EGL is not or could not be initialized";
48 case EGL_BAD_ACCESS:
49 return "EGL cannot access a requested resource";
50 case EGL_BAD_ALLOC:
51 return "EGL failed to allocate resources for the requested operation";
53 return "An unrecognized attribute or attribute value was passed in the attribute list";
54 case EGL_BAD_CONTEXT:
55 return "An EGLContext argument does not name a valid EGL rendering context";
56 case EGL_BAD_CONFIG:
57 return "An EGLConfig argument does not name a valid EGL frame buffer configuration";
59 return "The current surface of the calling thread is a window, pixel buffer or pixmap that is no longer valid";
60 case EGL_BAD_DISPLAY:
61 return "An EGLDisplay argument does not name a valid EGL display connection";
62 case EGL_BAD_SURFACE:
63 return "An EGLSurface argument does not name a valid surface configured for GL rendering";
64 case EGL_BAD_MATCH:
65 return "Arguments are inconsistent";
67 return "One or more argument values are invalid";
69 return "A NativePixmapType argument does not refer to a valid native pixmap";
71 return "A NativeWindowType argument does not refer to a valid native window";
73 return "The application must destroy all contexts and reinitialise";
74 default:
75 return "ERROR: UNKNOWN EGL ERROR";
76 }
77}
78
79// Returns the specified attribute of the specified EGLConfig
80//
81static int getEGLConfigAttrib(EGLConfig config, int attrib)
82{
83 int value;
84 eglGetConfigAttrib(_glfw.egl.display, config, attrib, &value);
85 return value;
86}
87
88// Return the EGLConfig most closely matching the specified hints
89//
90static GLFWbool chooseEGLConfig(const _GLFWctxconfig* ctxconfig,
91 const _GLFWfbconfig* desired,
92 EGLConfig* result)
93{
94 EGLConfig* nativeConfigs;
95 _GLFWfbconfig* usableConfigs;
96 const _GLFWfbconfig* closest;
97 int i, nativeCount, usableCount;
98
99 eglGetConfigs(_glfw.egl.display, NULL, 0, &nativeCount);
100 if (!nativeCount)
101 {
102 _glfwInputError(GLFW_API_UNAVAILABLE, "EGL: No EGLConfigs returned");
103 return GLFW_FALSE;
104 }
105
106 nativeConfigs = calloc(nativeCount, sizeof(EGLConfig));
107 eglGetConfigs(_glfw.egl.display, nativeConfigs, nativeCount, &nativeCount);
108
109 usableConfigs = calloc(nativeCount, sizeof(_GLFWfbconfig));
110 usableCount = 0;
111
112 for (i = 0; i < nativeCount; i++)
113 {
114 const EGLConfig n = nativeConfigs[i];
115 _GLFWfbconfig* u = usableConfigs + usableCount;
116
117 // Only consider RGB(A) EGLConfigs
118 if (getEGLConfigAttrib(n, EGL_COLOR_BUFFER_TYPE) != EGL_RGB_BUFFER)
119 continue;
120
121 // Only consider window EGLConfigs
122 if (!(getEGLConfigAttrib(n, EGL_SURFACE_TYPE) & EGL_WINDOW_BIT))
123 continue;
124
125#if defined(_GLFW_X11)
126 {
127 XVisualInfo vi = {0};
128
129 // Only consider EGLConfigs with associated Visuals
130 vi.visualid = getEGLConfigAttrib(n, EGL_NATIVE_VISUAL_ID);
131 if (!vi.visualid)
132 continue;
133
134 if (desired->transparent)
135 {
136 int count;
137 XVisualInfo* vis =
138 XGetVisualInfo(_glfw.x11.display, VisualIDMask, &vi, &count);
139 if (vis)
140 {
141 u->transparent = _glfwIsVisualTransparentX11(vis[0].visual);
142 XFree(vis);
143 }
144 }
145 }
146#endif // _GLFW_X11
147
148 if (ctxconfig->client == GLFW_OPENGL_ES_API)
149 {
150 if (ctxconfig->major == 1)
151 {
152 if (!(getEGLConfigAttrib(n, EGL_RENDERABLE_TYPE) & EGL_OPENGL_ES_BIT))
153 continue;
154 }
155 else
156 {
157 if (!(getEGLConfigAttrib(n, EGL_RENDERABLE_TYPE) & EGL_OPENGL_ES2_BIT))
158 continue;
159 }
160 }
161 else if (ctxconfig->client == GLFW_OPENGL_API)
162 {
163 if (!(getEGLConfigAttrib(n, EGL_RENDERABLE_TYPE) & EGL_OPENGL_BIT))
164 continue;
165 }
166
167 u->redBits = getEGLConfigAttrib(n, EGL_RED_SIZE);
168 u->greenBits = getEGLConfigAttrib(n, EGL_GREEN_SIZE);
169 u->blueBits = getEGLConfigAttrib(n, EGL_BLUE_SIZE);
170
171 u->alphaBits = getEGLConfigAttrib(n, EGL_ALPHA_SIZE);
172 u->depthBits = getEGLConfigAttrib(n, EGL_DEPTH_SIZE);
173 u->stencilBits = getEGLConfigAttrib(n, EGL_STENCIL_SIZE);
174
175 u->samples = getEGLConfigAttrib(n, EGL_SAMPLES);
176 u->doublebuffer = desired->doublebuffer;
177
178 u->handle = (uintptr_t) n;
179 usableCount++;
180 }
181
182 closest = _glfwChooseFBConfig(desired, usableConfigs, usableCount);
183 if (closest)
184 *result = (EGLConfig) closest->handle;
185
186 free(nativeConfigs);
187 free(usableConfigs);
188
189 return closest != NULL;
190}
191
192static void makeContextCurrentEGL(_GLFWwindow* window)
193{
194 if (window)
195 {
197 window->context.egl.surface,
198 window->context.egl.surface,
199 window->context.egl.handle))
200 {
202 "EGL: Failed to make context current: %s",
203 getEGLErrorString(eglGetError()));
204 return;
205 }
206 }
207 else
208 {
213 {
215 "EGL: Failed to clear current context: %s",
216 getEGLErrorString(eglGetError()));
217 return;
218 }
219 }
220
222}
223
224static void swapBuffersEGL(_GLFWwindow* window)
225{
226 if (window != _glfwPlatformGetTls(&_glfw.contextSlot))
227 {
229 "EGL: The context must be current on the calling thread when swapping buffers");
230 return;
231 }
232
234}
235
236static void swapIntervalEGL(int interval)
237{
238 eglSwapInterval(_glfw.egl.display, interval);
239}
240
241static int extensionSupportedEGL(const char* extension)
242{
243 const char* extensions = eglQueryString(_glfw.egl.display, EGL_EXTENSIONS);
244 if (extensions)
245 {
246 if (_glfwStringInExtensionString(extension, extensions))
247 return GLFW_TRUE;
248 }
249
250 return GLFW_FALSE;
251}
252
253static GLFWglproc getProcAddressEGL(const char* procname)
254{
256
257 if (window->context.egl.client)
258 {
260 procname);
261 if (proc)
262 return proc;
263 }
264
265 return eglGetProcAddress(procname);
266}
267
268static void destroyContextEGL(_GLFWwindow* window)
269{
270#if defined(_GLFW_X11)
271 // NOTE: Do not unload libGL.so.1 while the X11 display is still open,
272 // as it will make XCloseDisplay segfault
273 if (window->context.client != GLFW_OPENGL_API)
274#endif // _GLFW_X11
275 {
276 if (window->context.egl.client)
277 {
279 window->context.egl.client = NULL;
280 }
281 }
282
283 if (window->context.egl.surface)
284 {
287 }
288
289 if (window->context.egl.handle)
290 {
293 }
294}
295
296
300
301// Initialize EGL
302//
304{
305 int i;
306 EGLint* attribs = NULL;
307 const char* extensions;
308 const char* sonames[] =
309 {
310#if defined(_GLFW_EGL_LIBRARY)
311 _GLFW_EGL_LIBRARY,
312#elif defined(_GLFW_WIN32)
313 "libEGL.dll",
314 "EGL.dll",
315#elif defined(_GLFW_COCOA)
316 "libEGL.dylib",
317#elif defined(__CYGWIN__)
318 "libEGL-1.so",
319#else
320 "libEGL.so.1",
321#endif
322 NULL
323 };
324
325 if (_glfw.egl.handle)
326 return GLFW_TRUE;
327
328 for (i = 0; sonames[i]; i++)
329 {
330 _glfw.egl.handle = _glfw_dlopen(sonames[i]);
331 if (_glfw.egl.handle)
332 break;
333 }
334
335 if (!_glfw.egl.handle)
336 {
337 _glfwInputError(GLFW_API_UNAVAILABLE, "EGL: Library not found");
338 return GLFW_FALSE;
339 }
340
341 _glfw.egl.prefix = (strncmp(sonames[i], "lib", 3) == 0);
342
344 _glfw_dlsym(_glfw.egl.handle, "eglGetConfigAttrib");
346 _glfw_dlsym(_glfw.egl.handle, "eglGetConfigs");
348 _glfw_dlsym(_glfw.egl.handle, "eglGetDisplay");
350 _glfw_dlsym(_glfw.egl.handle, "eglGetError");
352 _glfw_dlsym(_glfw.egl.handle, "eglInitialize");
354 _glfw_dlsym(_glfw.egl.handle, "eglTerminate");
356 _glfw_dlsym(_glfw.egl.handle, "eglBindAPI");
358 _glfw_dlsym(_glfw.egl.handle, "eglCreateContext");
360 _glfw_dlsym(_glfw.egl.handle, "eglDestroySurface");
362 _glfw_dlsym(_glfw.egl.handle, "eglDestroyContext");
364 _glfw_dlsym(_glfw.egl.handle, "eglCreateWindowSurface");
366 _glfw_dlsym(_glfw.egl.handle, "eglMakeCurrent");
368 _glfw_dlsym(_glfw.egl.handle, "eglSwapBuffers");
370 _glfw_dlsym(_glfw.egl.handle, "eglSwapInterval");
372 _glfw_dlsym(_glfw.egl.handle, "eglQueryString");
374 _glfw_dlsym(_glfw.egl.handle, "eglGetProcAddress");
375
379 !_glfw.egl.GetError ||
382 !_glfw.egl.BindAPI ||
392 {
394 "EGL: Failed to load required entry points");
395
397 return GLFW_FALSE;
398 }
399
401 if (extensions && eglGetError() == EGL_SUCCESS)
403
405 {
407 _glfwStringInExtensionString("EGL_EXT_platform_base", extensions);
409 _glfwStringInExtensionString("EGL_EXT_platform_x11", extensions);
411 _glfwStringInExtensionString("EGL_EXT_platform_wayland", extensions);
413 _glfwStringInExtensionString("EGL_ANGLE_platform_angle", extensions);
415 _glfwStringInExtensionString("EGL_ANGLE_platform_angle_opengl", extensions);
417 _glfwStringInExtensionString("EGL_ANGLE_platform_angle_d3d", extensions);
419 _glfwStringInExtensionString("EGL_ANGLE_platform_angle_vulkan", extensions);
421 _glfwStringInExtensionString("EGL_ANGLE_platform_angle_metal", extensions);
422 }
423
425 {
427 eglGetProcAddress("eglGetPlatformDisplayEXT");
429 eglGetProcAddress("eglCreatePlatformWindowSurfaceEXT");
430 }
431
433 if (_glfw.egl.platform)
434 {
438 attribs);
439 }
440 else
442
443 free(attribs);
444
446 {
448 "EGL: Failed to get EGL display: %s",
449 getEGLErrorString(eglGetError()));
450
452 return GLFW_FALSE;
453 }
454
456 {
458 "EGL: Failed to initialize EGL: %s",
459 getEGLErrorString(eglGetError()));
460
462 return GLFW_FALSE;
463 }
464
466 extensionSupportedEGL("EGL_KHR_create_context");
468 extensionSupportedEGL("EGL_KHR_create_context_no_error");
470 extensionSupportedEGL("EGL_KHR_gl_colorspace");
472 extensionSupportedEGL("EGL_KHR_get_all_proc_addresses");
474 extensionSupportedEGL("EGL_KHR_context_flush_control");
475
476 return GLFW_TRUE;
477}
478
479// Terminate EGL
480//
482{
483 if (_glfw.egl.display)
484 {
487 }
488
489 if (_glfw.egl.handle)
490 {
493 }
494}
495
496#define setAttrib(a, v) \
497{ \
498 assert(((size_t) index + 1) < sizeof(attribs) / sizeof(attribs[0])); \
499 attribs[index++] = a; \
500 attribs[index++] = v; \
501}
502
503// Create the OpenGL or OpenGL ES context
504//
506 const _GLFWctxconfig* ctxconfig,
507 const _GLFWfbconfig* fbconfig)
508{
509 EGLint attribs[40];
510 EGLConfig config;
511 EGLContext share = NULL;
512 EGLNativeWindowType native;
513 int index = 0;
514
515 if (!_glfw.egl.display)
516 {
517 _glfwInputError(GLFW_API_UNAVAILABLE, "EGL: API not available");
518 return GLFW_FALSE;
519 }
520
521 if (ctxconfig->share)
522 share = ctxconfig->share->context.egl.handle;
523
524 if (!chooseEGLConfig(ctxconfig, fbconfig, &config))
525 {
527 "EGL: Failed to find a suitable EGLConfig");
528 return GLFW_FALSE;
529 }
530
531 if (ctxconfig->client == GLFW_OPENGL_ES_API)
532 {
534 {
536 "EGL: Failed to bind OpenGL ES: %s",
537 getEGLErrorString(eglGetError()));
538 return GLFW_FALSE;
539 }
540 }
541 else
542 {
544 {
546 "EGL: Failed to bind OpenGL: %s",
547 getEGLErrorString(eglGetError()));
548 return GLFW_FALSE;
549 }
550 }
551
553 {
554 int mask = 0, flags = 0;
555
556 if (ctxconfig->client == GLFW_OPENGL_API)
557 {
558 if (ctxconfig->forward)
560
561 if (ctxconfig->profile == GLFW_OPENGL_CORE_PROFILE)
563 else if (ctxconfig->profile == GLFW_OPENGL_COMPAT_PROFILE)
565 }
566
567 if (ctxconfig->debug)
569
570 if (ctxconfig->robustness)
571 {
572 if (ctxconfig->robustness == GLFW_NO_RESET_NOTIFICATION)
573 {
576 }
577 else if (ctxconfig->robustness == GLFW_LOSE_CONTEXT_ON_RESET)
578 {
581 }
582
584 }
585
586 if (ctxconfig->noerror)
587 {
590 }
591
592 if (ctxconfig->major != 1 || ctxconfig->minor != 0)
593 {
596 }
597
598 if (mask)
600
601 if (flags)
603 }
604 else
605 {
606 if (ctxconfig->client == GLFW_OPENGL_ES_API)
608 }
609
611 {
612 if (ctxconfig->release == GLFW_RELEASE_BEHAVIOR_NONE)
613 {
616 }
617 else if (ctxconfig->release == GLFW_RELEASE_BEHAVIOR_FLUSH)
618 {
621 }
622 }
623
625
627 config, share, attribs);
628
629 if (window->context.egl.handle == EGL_NO_CONTEXT)
630 {
632 "EGL: Failed to create context: %s",
633 getEGLErrorString(eglGetError()));
634 return GLFW_FALSE;
635 }
636
637 // Set up attributes for surface creation
638 index = 0;
639
640 if (fbconfig->sRGB)
641 {
644 }
645
646 if (!fbconfig->doublebuffer)
648
650
651 native = _glfwPlatformGetEGLNativeWindow(window);
652 // HACK: ANGLE does not implement eglCreatePlatformWindowSurfaceEXT
653 // despite reporting EGL_EXT_platform_base
655 {
656 window->context.egl.surface =
657 eglCreatePlatformWindowSurfaceEXT(_glfw.egl.display, config, native, attribs);
658 }
659 else
660 {
661 window->context.egl.surface =
662 eglCreateWindowSurface(_glfw.egl.display, config, native, attribs);
663 }
664
665 if (window->context.egl.surface == EGL_NO_SURFACE)
666 {
668 "EGL: Failed to create window surface: %s",
669 getEGLErrorString(eglGetError()));
670 return GLFW_FALSE;
671 }
672
673 window->context.egl.config = config;
674
675 // Load the appropriate client library
677 {
678 int i;
679 const char** sonames;
680 const char* es1sonames[] =
681 {
682#if defined(_GLFW_GLESV1_LIBRARY)
683 _GLFW_GLESV1_LIBRARY,
684#elif defined(_GLFW_WIN32)
685 "GLESv1_CM.dll",
686 "libGLES_CM.dll",
687#elif defined(_GLFW_COCOA)
688 "libGLESv1_CM.dylib",
689#else
690 "libGLESv1_CM.so.1",
691 "libGLES_CM.so.1",
692#endif
693 NULL
694 };
695 const char* es2sonames[] =
696 {
697#if defined(_GLFW_GLESV2_LIBRARY)
698 _GLFW_GLESV2_LIBRARY,
699#elif defined(_GLFW_WIN32)
700 "GLESv2.dll",
701 "libGLESv2.dll",
702#elif defined(_GLFW_COCOA)
703 "libGLESv2.dylib",
704#elif defined(__CYGWIN__)
705 "libGLESv2-2.so",
706#else
707 "libGLESv2.so.2",
708#endif
709 NULL
710 };
711 const char* glsonames[] =
712 {
713#if defined(_GLFW_OPENGL_LIBRARY)
714 _GLFW_OPENGL_LIBRARY,
715#elif defined(_GLFW_WIN32)
716#elif defined(_GLFW_COCOA)
717#else
718 "libGL.so.1",
719#endif
720 NULL
721 };
722
723 if (ctxconfig->client == GLFW_OPENGL_ES_API)
724 {
725 if (ctxconfig->major == 1)
726 sonames = es1sonames;
727 else
728 sonames = es2sonames;
729 }
730 else
731 sonames = glsonames;
732
733 for (i = 0; sonames[i]; i++)
734 {
735 // HACK: Match presence of lib prefix to increase chance of finding
736 // a matching pair in the jungle that is Win32 EGL/GLES
737 if (_glfw.egl.prefix != (strncmp(sonames[i], "lib", 3) == 0))
738 continue;
739
740 window->context.egl.client = _glfw_dlopen(sonames[i]);
741 if (window->context.egl.client)
742 break;
743 }
744
745 if (!window->context.egl.client)
746 {
748 "EGL: Failed to load client library");
749 return GLFW_FALSE;
750 }
751 }
752
753 window->context.makeCurrent = makeContextCurrentEGL;
754 window->context.swapBuffers = swapBuffersEGL;
755 window->context.swapInterval = swapIntervalEGL;
756 window->context.extensionSupported = extensionSupportedEGL;
757 window->context.getProcAddress = getProcAddressEGL;
758 window->context.destroy = destroyContextEGL;
759
760 return GLFW_TRUE;
761}
762
763#undef setAttrib
764
765// Returns the Visual and depth of the chosen EGLConfig
766//
767#if defined(_GLFW_X11)
768GLFWbool _glfwChooseVisualEGL(const _GLFWwndconfig* wndconfig,
769 const _GLFWctxconfig* ctxconfig,
770 const _GLFWfbconfig* fbconfig,
771 Visual** visual, int* depth)
772{
773 XVisualInfo* result;
774 XVisualInfo desired;
775 EGLConfig native;
776 EGLint visualID = 0, count = 0;
777 const long vimask = VisualScreenMask | VisualIDMask;
778
779 if (!chooseEGLConfig(ctxconfig, fbconfig, &native))
780 {
782 "EGL: Failed to find a suitable EGLConfig");
783 return GLFW_FALSE;
784 }
785
787 EGL_NATIVE_VISUAL_ID, &visualID);
788
789 desired.screen = _glfw.x11.screen;
790 desired.visualid = visualID;
791
792 result = XGetVisualInfo(_glfw.x11.display, vimask, &desired, &count);
793 if (!result)
794 {
796 "EGL: Failed to retrieve Visual for EGLConfig");
797 return GLFW_FALSE;
798 }
799
800 *visual = result->visual;
801 *depth = result->depth;
802
803 XFree(result);
804 return GLFW_TRUE;
805}
806#endif // _GLFW_X11
807
808
812
814{
816 return _glfw.egl.display;
817}
818
820{
821 _GLFWwindow* window = (_GLFWwindow*) handle;
823
824 if (window->context.client == GLFW_NO_API)
825 {
827 return EGL_NO_CONTEXT;
828 }
829
830 return window->context.egl.handle;
831}
832
834{
835 _GLFWwindow* window = (_GLFWwindow*) handle;
837
838 if (window->context.client == GLFW_NO_API)
839 {
841 return EGL_NO_SURFACE;
842 }
843
844 return window->context.egl.surface;
845}
846
#define _glfw_dlopen(name)
#define _glfw_dlsym(handle, name)
#define _glfw_dlclose(handle)
EGLenum _glfwPlatformGetEGLPlatform(EGLint **attribs)
EGLNativeWindowType _glfwPlatformGetEGLNativeWindow(_GLFWwindow *window)
EGLNativeDisplayType _glfwPlatformGetEGLNativeDisplay(void)
GLFWbool _glfwStringInExtensionString(const char *string, const char *extensions)
Definition: context.c:578
const _GLFWfbconfig * _glfwChooseFBConfig(const _GLFWfbconfig *desired, const _GLFWfbconfig *alternatives, unsigned int count)
Definition: context.c:178
#define setAttrib(a, v)
Definition: egl_context.c:496
void _glfwTerminateEGL(void)
Definition: egl_context.c:481
GLFWAPI EGLDisplay glfwGetEGLDisplay(void)
Definition: egl_context.c:813
GLFWbool _glfwInitEGL(void)
Definition: egl_context.c:303
GLFWbool _glfwCreateContextEGL(_GLFWwindow *window, const _GLFWctxconfig *ctxconfig, const _GLFWfbconfig *fbconfig)
Definition: egl_context.c:505
GLFWAPI EGLSurface glfwGetEGLSurface(GLFWwindow *handle)
Definition: egl_context.c:833
GLFWAPI EGLContext glfwGetEGLContext(GLFWwindow *handle)
Definition: egl_context.c:819
#define eglCreateContext
Definition: egl_context.h:142
#define eglMakeCurrent
Definition: egl_context.h:146
#define EGL_BAD_NATIVE_PIXMAP
Definition: egl_context.h:44
#define eglSwapInterval
Definition: egl_context.h:148
#define EGL_OPENGL_ES_BIT
Definition: egl_context.h:54
EGLBoolean(EGLAPIENTRY * PFN_eglSwapInterval)(EGLDisplay, EGLint)
Definition: egl_context.h:132
#define EGL_WINDOW_BIT
Definition: egl_context.h:52
#define EGL_SAMPLES
Definition: egl_context.h:63
EGLint(EGLAPIENTRY * PFN_eglGetError)(void)
Definition: egl_context.h:122
#define EGL_NO_CONTEXT
Definition: egl_context.h:74
#define EGL_NATIVE_VISUAL_ID
Definition: egl_context.h:71
#define EGL_CONTEXT_RELEASE_BEHAVIOR_NONE_KHR
Definition: egl_context.h:93
void * EGLSurface
Definition: egl_context.h:113
#define eglSwapBuffers
Definition: egl_context.h:147
#define eglCreatePlatformWindowSurfaceEXT
Definition: egl_context.h:155
#define EGL_RENDERABLE_TYPE
Definition: egl_context.h:53
#define EGL_BAD_CONFIG
Definition: egl_context.h:39
#define EGL_GL_COLORSPACE_SRGB_KHR
Definition: egl_context.h:91
#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR
Definition: egl_context.h:81
#define EGL_BAD_SURFACE
Definition: egl_context.h:47
#define EGL_ALPHA_SIZE
Definition: egl_context.h:57
#define EGL_NO_DISPLAY
Definition: egl_context.h:73
#define eglGetConfigs
Definition: egl_context.h:136
EGLSurface(EGLAPIENTRY * PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC)(EGLDisplay, EGLConfig, void *, const EGLint *)
Definition: egl_context.h:153
#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR
Definition: egl_context.h:80
#define EGL_BAD_PARAMETER
Definition: egl_context.h:46
#define eglTerminate
Definition: egl_context.h:140
#define EGL_OPENGL_API
Definition: egl_context.h:65
#define EGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR
Definition: egl_context.h:94
#define EGL_SINGLE_BUFFER
Definition: egl_context.h:68
void * EGLContext
Definition: egl_context.h:111
#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR
Definition: egl_context.h:77
#define eglGetDisplay
Definition: egl_context.h:137
#define EGL_NOT_INITIALIZED
Definition: egl_context.h:35
#define EGL_BAD_CURRENT_SURFACE
Definition: egl_context.h:41
#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR
Definition: egl_context.h:84
#define EGL_BAD_CONTEXT
Definition: egl_context.h:40
#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR
Definition: egl_context.h:78
#define EGL_OPENGL_BIT
Definition: egl_context.h:56
EGLSurface(EGLAPIENTRY * PFN_eglCreateWindowSurface)(EGLDisplay, EGLConfig, EGLNativeWindowType, const EGLint *)
Definition: egl_context.h:129
#define EGL_CONTEXT_MINOR_VERSION_KHR
Definition: egl_context.h:86
void * EGLConfig
Definition: egl_context.h:110
#define EGL_OPENGL_ES2_BIT
Definition: egl_context.h:55
#define EGL_NONE
Definition: egl_context.h:66
EGLBoolean(EGLAPIENTRY * PFN_eglBindAPI)(EGLenum)
Definition: egl_context.h:125
EGLBoolean(EGLAPIENTRY * PFN_eglDestroySurface)(EGLDisplay, EGLSurface)
Definition: egl_context.h:127
#define EGL_CONTEXT_CLIENT_VERSION
Definition: egl_context.h:70
EGLContext(EGLAPIENTRY * PFN_eglCreateContext)(EGLDisplay, EGLConfig, EGLContext, const EGLint *)
Definition: egl_context.h:126
#define EGL_BAD_NATIVE_WINDOW
Definition: egl_context.h:45
#define EGL_CONTEXT_MAJOR_VERSION_KHR
Definition: egl_context.h:85
#define EGL_NO_SURFACE
Definition: egl_context.h:72
EGLBoolean(EGLAPIENTRY * PFN_eglGetConfigs)(EGLDisplay, EGLConfig *, EGLint, EGLint *)
Definition: egl_context.h:120
#define EGL_NO_RESET_NOTIFICATION_KHR
Definition: egl_context.h:82
#define EGL_GREEN_SIZE
Definition: egl_context.h:59
void * EGLNativeWindowType
Definition: egl_context.h:116
void * EGLDisplay
Definition: egl_context.h:112
#define EGL_OPENGL_ES_API
Definition: egl_context.h:64
#define eglGetPlatformDisplayEXT
Definition: egl_context.h:154
#define EGL_EXTENSIONS
Definition: egl_context.h:69
#define eglGetProcAddress
Definition: egl_context.h:150
#define EGL_BAD_MATCH
Definition: egl_context.h:43
EGLBoolean(EGLAPIENTRY * PFN_eglMakeCurrent)(EGLDisplay, EGLSurface, EGLSurface, EGLContext)
Definition: egl_context.h:130
EGLBoolean(EGLAPIENTRY * PFN_eglInitialize)(EGLDisplay, EGLint *, EGLint *)
Definition: egl_context.h:123
int EGLint
Definition: egl_context.h:107
EGLBoolean(EGLAPIENTRY * PFN_eglGetConfigAttrib)(EGLDisplay, EGLConfig, EGLint, EGLint *)
Definition: egl_context.h:119
#define eglGetError
Definition: egl_context.h:138
EGLBoolean(EGLAPIENTRY * PFN_eglDestroyContext)(EGLDisplay, EGLContext)
Definition: egl_context.h:128
EGLBoolean(EGLAPIENTRY * PFN_eglTerminate)(EGLDisplay)
Definition: egl_context.h:124
#define EGL_COLOR_BUFFER_TYPE
Definition: egl_context.h:49
#define eglDestroyContext
Definition: egl_context.h:144
#define EGL_CONTEXT_LOST
Definition: egl_context.h:48
#define eglBindAPI
Definition: egl_context.h:141
#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR
Definition: egl_context.h:79
#define EGL_BAD_ALLOC
Definition: egl_context.h:37
#define EGL_CONTEXT_RELEASE_BEHAVIOR_KHR
Definition: egl_context.h:92
#define EGL_STENCIL_SIZE
Definition: egl_context.h:62
#define EGL_RENDER_BUFFER
Definition: egl_context.h:67
#define eglInitialize
Definition: egl_context.h:139
#define eglCreateWindowSurface
Definition: egl_context.h:145
#define EGL_CONTEXT_OPENGL_NO_ERROR_KHR
Definition: egl_context.h:89
#define eglDestroySurface
Definition: egl_context.h:143
#define EGL_CONTEXT_FLAGS_KHR
Definition: egl_context.h:88
#define EGL_LOSE_CONTEXT_ON_RESET_KHR
Definition: egl_context.h:83
#define EGL_SURFACE_TYPE
Definition: egl_context.h:51
EGLBoolean(EGLAPIENTRY * PFN_eglSwapBuffers)(EGLDisplay, EGLSurface)
Definition: egl_context.h:131
#define EGL_DEPTH_SIZE
Definition: egl_context.h:61
#define EGL_RGB_BUFFER
Definition: egl_context.h:50
#define EGL_PLATFORM_ANGLE_ANGLE
Definition: egl_context.h:97
#define eglGetConfigAttrib
Definition: egl_context.h:135
#define EGL_BAD_ATTRIBUTE
Definition: egl_context.h:38
#define EGL_RED_SIZE
Definition: egl_context.h:60
#define EGL_SUCCESS
Definition: egl_context.h:34
EGLDisplay(EGLAPIENTRY * PFN_eglGetDisplay)(EGLNativeDisplayType)
Definition: egl_context.h:121
#define EGL_BAD_ACCESS
Definition: egl_context.h:36
#define EGL_BLUE_SIZE
Definition: egl_context.h:58
#define eglQueryString
Definition: egl_context.h:149
EGLDisplay(EGLAPIENTRY * PFNEGLGETPLATFORMDISPLAYEXTPROC)(EGLenum, void *, const EGLint *)
Definition: egl_context.h:152
GLFWglproc(EGLAPIENTRY * PFN_eglGetProcAddress)(const char *)
Definition: egl_context.h:134
const char *(EGLAPIENTRY * PFN_eglQueryString)(EGLDisplay, EGLint)
Definition: egl_context.h:133
#define EGL_GL_COLORSPACE_KHR
Definition: egl_context.h:90
#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR
Definition: egl_context.h:87
#define EGL_BAD_DISPLAY
Definition: egl_context.h:42
#define GLFW_OPENGL_API
Definition: glfw3.h:1087
#define GLFW_OPENGL_ES_API
Definition: glfw3.h:1088
#define GLFWAPI
Definition: glfw3.h:269
#define GLFW_NO_API
Definition: glfw3.h:1086
#define GLFW_RELEASE_BEHAVIOR_FLUSH
Definition: glfw3.h:1109
#define GLFW_OPENGL_COMPAT_PROFILE
Definition: glfw3.h:1096
#define GLFW_LOSE_CONTEXT_ON_RESET
Definition: glfw3.h:1092
#define GLFW_NO_RESET_NOTIFICATION
Definition: glfw3.h:1091
#define GLFW_OPENGL_CORE_PROFILE
Definition: glfw3.h:1095
#define GLFW_RELEASE_BEHAVIOR_NONE
Definition: glfw3.h:1110
void(* GLFWglproc)(void)
GLFW API types.
Definition: glfw3.h:1281
#define GLFW_FORMAT_UNAVAILABLE
The requested format is not supported or available.
Definition: glfw3.h:777
#define GLFW_API_UNAVAILABLE
GLFW could not find support for the requested API on the system.
Definition: glfw3.h:730
#define GLFW_NO_WINDOW_CONTEXT
The specified window does not have an OpenGL or OpenGL ES context.
Definition: glfw3.h:785
#define GLFW_VERSION_UNAVAILABLE
The requested OpenGL or OpenGL ES version is not available.
Definition: glfw3.h:747
#define GLFW_PLATFORM_ERROR
A platform-specific error occurred that does not match any of the more specific categories.
Definition: glfw3.h:758
#define GLFW_TRUE
One.
Definition: glfw3.h:310
#define GLFW_FALSE
Zero.
Definition: glfw3.h:319
struct GLFWwindow GLFWwindow
Opaque window object.
Definition: glfw3.h:1319
_GLFWlibrary _glfw
Definition: init.c:46
void _glfwInputError(int code, const char *format,...)
Definition: init.c:160
void _glfwPlatformSetTls(_GLFWtls *tls, void *value)
Definition: posix_thread.c:68
#define _GLFW_REQUIRE_INIT_OR_RETURN(x)
Definition: internal.h:214
void * _glfwPlatformGetTls(_GLFWtls *tls)
Definition: posix_thread.c:62
int GLFWbool
Definition: internal.h:61
#define NULL
Definition: miniaudio.h:3718
_W64 unsigned int uintptr_t
Definition: stdint.h:119
EGLSurface surface
Definition: egl_context.h:163
EGLContext handle
Definition: egl_context.h:162
EGLConfig config
Definition: egl_context.h:161
_GLFWswapintervalfun swapInterval
Definition: internal.h:362
_GLFWswapbuffersfun swapBuffers
Definition: internal.h:361
_GLFWdestroycontextfun destroy
Definition: internal.h:365
_GLFWcontextEGL egl
Definition: internal.h:370
_GLFWmakecontextcurrentfun makeCurrent
Definition: internal.h:360
_GLFWextensionsupportedfun extensionSupported
Definition: internal.h:363
_GLFWgetprocaddressfun getProcAddress
Definition: internal.h:364
GLFWbool debug
Definition: internal.h:304
GLFWbool noerror
Definition: internal.h:305
_GLFWwindow * share
Definition: internal.h:309
GLFWbool forward
Definition: internal.h:303
int stencilBits
Definition: internal.h:330
GLFWbool transparent
Definition: internal.h:340
uintptr_t handle
Definition: internal.h:341
GLFWbool sRGB
Definition: internal.h:338
GLFWbool doublebuffer
Definition: internal.h:339
PFN_eglGetProcAddress GetProcAddress
Definition: egl_context.h:210
PFN_eglBindAPI BindAPI
Definition: egl_context.h:201
EGLDisplay display
Definition: egl_context.h:174
GLFWbool ANGLE_platform_angle_d3d
Definition: egl_context.h:189
GLFWbool ANGLE_platform_angle_metal
Definition: egl_context.h:191
PFN_eglGetError GetError
Definition: egl_context.h:198
GLFWbool prefix
Definition: egl_context.h:176
PFN_eglMakeCurrent MakeCurrent
Definition: egl_context.h:206
PFN_eglCreateWindowSurface CreateWindowSurface
Definition: egl_context.h:205
PFN_eglQueryString QueryString
Definition: egl_context.h:209
PFN_eglTerminate Terminate
Definition: egl_context.h:200
GLFWbool EXT_platform_wayland
Definition: egl_context.h:186
PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC CreatePlatformWindowSurfaceEXT
Definition: egl_context.h:213
GLFWbool EXT_platform_base
Definition: egl_context.h:184
PFN_eglInitialize Initialize
Definition: egl_context.h:199
GLFWbool KHR_gl_colorspace
Definition: egl_context.h:180
PFN_eglGetConfigs GetConfigs
Definition: egl_context.h:196
GLFWbool KHR_create_context_no_error
Definition: egl_context.h:179
GLFWbool ANGLE_platform_angle
Definition: egl_context.h:187
GLFWbool ANGLE_platform_angle_vulkan
Definition: egl_context.h:190
PFN_eglSwapBuffers SwapBuffers
Definition: egl_context.h:207
PFNEGLGETPLATFORMDISPLAYEXTPROC GetPlatformDisplayEXT
Definition: egl_context.h:212
PFN_eglSwapInterval SwapInterval
Definition: egl_context.h:208
PFN_eglGetDisplay GetDisplay
Definition: egl_context.h:197
GLFWbool KHR_context_flush_control
Definition: egl_context.h:182
PFN_eglCreateContext CreateContext
Definition: egl_context.h:202
GLFWbool EXT_platform_x11
Definition: egl_context.h:185
GLFWbool KHR_create_context
Definition: egl_context.h:178
PFN_eglDestroyContext DestroyContext
Definition: egl_context.h:204
PFN_eglDestroySurface DestroySurface
Definition: egl_context.h:203
GLFWbool ANGLE_platform_angle_opengl
Definition: egl_context.h:188
GLFWbool KHR_get_all_proc_addresses
Definition: egl_context.h:181
PFN_eglGetConfigAttrib GetConfigAttrib
Definition: egl_context.h:195
EGLenum platform
Definition: egl_context.h:173
GLFWbool EXT_client_extensions
Definition: egl_context.h:183
_GLFWlibraryEGL egl
Definition: internal.h:595
_GLFWtls contextSlot
Definition: internal.h:552
_GLFWcontext context
Definition: internal.h:409
GLFWbool _glfwIsVisualTransparentX11(Visual *visual)
Definition: x11_window.c:1879
#define XFree
Definition: x11_platform.h:182
#define XGetVisualInfo
Definition: x11_platform.h:194