egl_context.c
Go to the documentation of this file.
1 //========================================================================
2 // GLFW 3.3 EGL - www.glfw.org
3 //------------------------------------------------------------------------
4 // Copyright (c) 2002-2006 Marcus Geelnard
5 // Copyright (c) 2006-2016 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 #include "internal.h"
29 
30 #include <stdio.h>
31 #include <string.h>
32 #include <stdlib.h>
33 #include <assert.h>
34 
35 
36 // Return a description of the specified EGL error
37 //
38 static const char* getEGLErrorString(EGLint error)
39 {
40  switch (error)
41  {
42  case EGL_SUCCESS:
43  return "Success";
45  return "EGL is not or could not be initialized";
46  case EGL_BAD_ACCESS:
47  return "EGL cannot access a requested resource";
48  case EGL_BAD_ALLOC:
49  return "EGL failed to allocate resources for the requested operation";
50  case EGL_BAD_ATTRIBUTE:
51  return "An unrecognized attribute or attribute value was passed in the attribute list";
52  case EGL_BAD_CONTEXT:
53  return "An EGLContext argument does not name a valid EGL rendering context";
54  case EGL_BAD_CONFIG:
55  return "An EGLConfig argument does not name a valid EGL frame buffer configuration";
57  return "The current surface of the calling thread is a window, pixel buffer or pixmap that is no longer valid";
58  case EGL_BAD_DISPLAY:
59  return "An EGLDisplay argument does not name a valid EGL display connection";
60  case EGL_BAD_SURFACE:
61  return "An EGLSurface argument does not name a valid surface configured for GL rendering";
62  case EGL_BAD_MATCH:
63  return "Arguments are inconsistent";
64  case EGL_BAD_PARAMETER:
65  return "One or more argument values are invalid";
67  return "A NativePixmapType argument does not refer to a valid native pixmap";
69  return "A NativeWindowType argument does not refer to a valid native window";
70  case EGL_CONTEXT_LOST:
71  return "The application must destroy all contexts and reinitialise";
72  default:
73  return "ERROR: UNKNOWN EGL ERROR";
74  }
75 }
76 
77 // Returns the specified attribute of the specified EGLConfig
78 //
79 static int getEGLConfigAttrib(EGLConfig config, int attrib)
80 {
81  int value;
82  eglGetConfigAttrib(_glfw.egl.display, config, attrib, &value);
83  return value;
84 }
85 
86 // Return the EGLConfig most closely matching the specified hints
87 //
88 static GLFWbool chooseEGLConfig(const _GLFWctxconfig* ctxconfig,
89  const _GLFWfbconfig* desired,
91 {
92  EGLConfig* nativeConfigs;
93  _GLFWfbconfig* usableConfigs;
94  const _GLFWfbconfig* closest;
95  int i, nativeCount, usableCount;
96 
97  eglGetConfigs(_glfw.egl.display, NULL, 0, &nativeCount);
98  if (!nativeCount)
99  {
100  _glfwInputError(GLFW_API_UNAVAILABLE, "EGL: No EGLConfigs returned");
101  return GLFW_FALSE;
102  }
103 
104  nativeConfigs = calloc(nativeCount, sizeof(EGLConfig));
105  eglGetConfigs(_glfw.egl.display, nativeConfigs, nativeCount, &nativeCount);
106 
107  usableConfigs = calloc(nativeCount, sizeof(_GLFWfbconfig));
108  usableCount = 0;
109 
110  for (i = 0; i < nativeCount; i++)
111  {
112  const EGLConfig n = nativeConfigs[i];
113  _GLFWfbconfig* u = usableConfigs + usableCount;
114 
115  // Only consider RGB(A) EGLConfigs
117  continue;
118 
119  // Only consider window EGLConfigs
121  continue;
122 
123 #if defined(_GLFW_X11)
124  XVisualInfo vi = {0};
125 
126  // Only consider EGLConfigs with associated Visuals
127  vi.visualid = getEGLConfigAttrib(n, EGL_NATIVE_VISUAL_ID);
128  if (!vi.visualid)
129  continue;
130 
131  if (desired->transparent)
132  {
133  int count;
134  XVisualInfo* vis = XGetVisualInfo(_glfw.x11.display,
135  VisualIDMask, &vi,
136  &count);
137  if (vis)
138  {
139  u->transparent = _glfwIsVisualTransparentX11(vis[0].visual);
140  XFree(vis);
141  }
142  }
143 #endif // _GLFW_X11
144 
145  if (ctxconfig->client == GLFW_OPENGL_ES_API)
146  {
147  if (ctxconfig->major == 1)
148  {
150  continue;
151  }
152  else
153  {
155  continue;
156  }
157  }
158  else if (ctxconfig->client == GLFW_OPENGL_API)
159  {
161  continue;
162  }
163 
167 
171 
173  u->doublebuffer = GLFW_TRUE;
174 
175  u->handle = (uintptr_t) n;
176  usableCount++;
177  }
178 
179  closest = _glfwChooseFBConfig(desired, usableConfigs, usableCount);
180  if (closest)
181  *result = (EGLConfig) closest->handle;
182 
183  free(nativeConfigs);
184  free(usableConfigs);
185 
186  return closest != NULL;
187 }
188 
190 {
191  if (window)
192  {
193  if (!eglMakeCurrent(_glfw.egl.display,
194  window->context.egl.surface,
195  window->context.egl.surface,
196  window->context.egl.handle))
197  {
199  "EGL: Failed to make context current: %s",
201  return;
202  }
203  }
204  else
205  {
206  if (!eglMakeCurrent(_glfw.egl.display,
210  {
212  "EGL: Failed to clear current context: %s",
214  return;
215  }
216  }
217 
219 }
220 
222 {
223  if (window != _glfwPlatformGetTls(&_glfw.contextSlot))
224  {
226  "EGL: The context must be current on the calling thread when swapping buffers");
227  return;
228  }
229 
230  eglSwapBuffers(_glfw.egl.display, window->context.egl.surface);
231 }
232 
233 static void swapIntervalEGL(int interval)
234 {
235  eglSwapInterval(_glfw.egl.display, interval);
236 }
237 
238 static int extensionSupportedEGL(const char* extension)
239 {
240  const char* extensions = eglQueryString(_glfw.egl.display, EGL_EXTENSIONS);
241  if (extensions)
242  {
243  if (_glfwStringInExtensionString(extension, extensions))
244  return GLFW_TRUE;
245  }
246 
247  return GLFW_FALSE;
248 }
249 
250 static GLFWglproc getProcAddressEGL(const char* procname)
251 {
253 
254  if (window->context.egl.client)
255  {
256  GLFWglproc proc = (GLFWglproc) _glfw_dlsym(window->context.egl.client,
257  procname);
258  if (proc)
259  return proc;
260  }
261 
262  return eglGetProcAddress(procname);
263 }
264 
266 {
267 #if defined(_GLFW_X11)
268  // NOTE: Do not unload libGL.so.1 while the X11 display is still open,
269  // as it will make XCloseDisplay segfault
270  if (window->context.client != GLFW_OPENGL_API)
271 #endif // _GLFW_X11
272  {
273  if (window->context.egl.client)
274  {
275  _glfw_dlclose(window->context.egl.client);
276  window->context.egl.client = NULL;
277  }
278  }
279 
280  if (window->context.egl.surface)
281  {
282  eglDestroySurface(_glfw.egl.display, window->context.egl.surface);
283  window->context.egl.surface = EGL_NO_SURFACE;
284  }
285 
286  if (window->context.egl.handle)
287  {
288  eglDestroyContext(_glfw.egl.display, window->context.egl.handle);
289  window->context.egl.handle = EGL_NO_CONTEXT;
290  }
291 }
292 
293 
297 
298 // Initialize EGL
299 //
301 {
302  int i;
303  const char* sonames[] =
304  {
305 #if defined(_GLFW_EGL_LIBRARY)
306  _GLFW_EGL_LIBRARY,
307 #elif defined(_GLFW_WIN32)
308  "libEGL.dll",
309  "EGL.dll",
310 #elif defined(_GLFW_COCOA)
311  "libEGL.dylib",
312 #elif defined(__CYGWIN__)
313  "libEGL-1.so",
314 #else
315  "libEGL.so.1",
316 #endif
317  NULL
318  };
319 
320  if (_glfw.egl.handle)
321  return GLFW_TRUE;
322 
323  for (i = 0; sonames[i]; i++)
324  {
325  _glfw.egl.handle = _glfw_dlopen(sonames[i]);
326  if (_glfw.egl.handle)
327  break;
328  }
329 
330  if (!_glfw.egl.handle)
331  {
332  _glfwInputError(GLFW_API_UNAVAILABLE, "EGL: Library not found");
333  return GLFW_FALSE;
334  }
335 
336  _glfw.egl.prefix = (strncmp(sonames[i], "lib", 3) == 0);
337 
338  _glfw.egl.GetConfigAttrib = (PFN_eglGetConfigAttrib)
339  _glfw_dlsym(_glfw.egl.handle, "eglGetConfigAttrib");
340  _glfw.egl.GetConfigs = (PFN_eglGetConfigs)
341  _glfw_dlsym(_glfw.egl.handle, "eglGetConfigs");
342  _glfw.egl.GetDisplay = (PFN_eglGetDisplay)
343  _glfw_dlsym(_glfw.egl.handle, "eglGetDisplay");
344  _glfw.egl.GetError = (PFN_eglGetError)
345  _glfw_dlsym(_glfw.egl.handle, "eglGetError");
346  _glfw.egl.Initialize = (PFN_eglInitialize)
347  _glfw_dlsym(_glfw.egl.handle, "eglInitialize");
348  _glfw.egl.Terminate = (PFN_eglTerminate)
349  _glfw_dlsym(_glfw.egl.handle, "eglTerminate");
350  _glfw.egl.BindAPI = (PFN_eglBindAPI)
351  _glfw_dlsym(_glfw.egl.handle, "eglBindAPI");
352  _glfw.egl.CreateContext = (PFN_eglCreateContext)
353  _glfw_dlsym(_glfw.egl.handle, "eglCreateContext");
354  _glfw.egl.DestroySurface = (PFN_eglDestroySurface)
355  _glfw_dlsym(_glfw.egl.handle, "eglDestroySurface");
356  _glfw.egl.DestroyContext = (PFN_eglDestroyContext)
357  _glfw_dlsym(_glfw.egl.handle, "eglDestroyContext");
358  _glfw.egl.CreateWindowSurface = (PFN_eglCreateWindowSurface)
359  _glfw_dlsym(_glfw.egl.handle, "eglCreateWindowSurface");
360  _glfw.egl.MakeCurrent = (PFN_eglMakeCurrent)
361  _glfw_dlsym(_glfw.egl.handle, "eglMakeCurrent");
362  _glfw.egl.SwapBuffers = (PFN_eglSwapBuffers)
363  _glfw_dlsym(_glfw.egl.handle, "eglSwapBuffers");
364  _glfw.egl.SwapInterval = (PFN_eglSwapInterval)
365  _glfw_dlsym(_glfw.egl.handle, "eglSwapInterval");
366  _glfw.egl.QueryString = (PFN_eglQueryString)
367  _glfw_dlsym(_glfw.egl.handle, "eglQueryString");
368  _glfw.egl.GetProcAddress = (PFN_eglGetProcAddress)
369  _glfw_dlsym(_glfw.egl.handle, "eglGetProcAddress");
370 
371  if (!_glfw.egl.GetConfigAttrib ||
372  !_glfw.egl.GetConfigs ||
373  !_glfw.egl.GetDisplay ||
374  !_glfw.egl.GetError ||
375  !_glfw.egl.Initialize ||
376  !_glfw.egl.Terminate ||
377  !_glfw.egl.BindAPI ||
378  !_glfw.egl.CreateContext ||
379  !_glfw.egl.DestroySurface ||
380  !_glfw.egl.DestroyContext ||
381  !_glfw.egl.CreateWindowSurface ||
382  !_glfw.egl.MakeCurrent ||
383  !_glfw.egl.SwapBuffers ||
384  !_glfw.egl.SwapInterval ||
385  !_glfw.egl.QueryString ||
386  !_glfw.egl.GetProcAddress)
387  {
389  "EGL: Failed to load required entry points");
390 
392  return GLFW_FALSE;
393  }
394 
396  if (_glfw.egl.display == EGL_NO_DISPLAY)
397  {
399  "EGL: Failed to get EGL display: %s",
401 
403  return GLFW_FALSE;
404  }
405 
406  if (!eglInitialize(_glfw.egl.display, &_glfw.egl.major, &_glfw.egl.minor))
407  {
409  "EGL: Failed to initialize EGL: %s",
411 
413  return GLFW_FALSE;
414  }
415 
416  _glfw.egl.KHR_create_context =
417  extensionSupportedEGL("EGL_KHR_create_context");
418  _glfw.egl.KHR_create_context_no_error =
419  extensionSupportedEGL("EGL_KHR_create_context_no_error");
420  _glfw.egl.KHR_gl_colorspace =
421  extensionSupportedEGL("EGL_KHR_gl_colorspace");
422  _glfw.egl.KHR_get_all_proc_addresses =
423  extensionSupportedEGL("EGL_KHR_get_all_proc_addresses");
424  _glfw.egl.KHR_context_flush_control =
425  extensionSupportedEGL("EGL_KHR_context_flush_control");
426 
427  return GLFW_TRUE;
428 }
429 
430 // Terminate EGL
431 //
433 {
434  if (_glfw.egl.display)
435  {
436  eglTerminate(_glfw.egl.display);
437  _glfw.egl.display = EGL_NO_DISPLAY;
438  }
439 
440  if (_glfw.egl.handle)
441  {
443  _glfw.egl.handle = NULL;
444  }
445 }
446 
447 #define setAttrib(a, v) \
448 { \
449  assert((size_t) (index + 1) < sizeof(attribs) / sizeof(attribs[0])); \
450  attribs[index++] = a; \
451  attribs[index++] = v; \
452 }
453 
454 // Create the OpenGL or OpenGL ES context
455 //
457  const _GLFWctxconfig* ctxconfig,
458  const _GLFWfbconfig* fbconfig)
459 {
460  EGLint attribs[40];
462  EGLContext share = NULL;
463  int index = 0;
464 
465  if (!_glfw.egl.display)
466  {
467  _glfwInputError(GLFW_API_UNAVAILABLE, "EGL: API not available");
468  return GLFW_FALSE;
469  }
470 
471  if (ctxconfig->share)
472  share = ctxconfig->share->context.egl.handle;
473 
474  if (!chooseEGLConfig(ctxconfig, fbconfig, &config))
475  {
477  "EGL: Failed to find a suitable EGLConfig");
478  return GLFW_FALSE;
479  }
480 
481  if (ctxconfig->client == GLFW_OPENGL_ES_API)
482  {
484  {
486  "EGL: Failed to bind OpenGL ES: %s",
488  return GLFW_FALSE;
489  }
490  }
491  else
492  {
494  {
496  "EGL: Failed to bind OpenGL: %s",
498  return GLFW_FALSE;
499  }
500  }
501 
502  if (_glfw.egl.KHR_create_context)
503  {
504  int mask = 0, flags = 0;
505 
506  if (ctxconfig->client == GLFW_OPENGL_API)
507  {
508  if (ctxconfig->forward)
510 
511  if (ctxconfig->profile == GLFW_OPENGL_CORE_PROFILE)
513  else if (ctxconfig->profile == GLFW_OPENGL_COMPAT_PROFILE)
515  }
516 
517  if (ctxconfig->debug)
519 
520  if (ctxconfig->robustness)
521  {
522  if (ctxconfig->robustness == GLFW_NO_RESET_NOTIFICATION)
523  {
526  }
527  else if (ctxconfig->robustness == GLFW_LOSE_CONTEXT_ON_RESET)
528  {
531  }
532 
534  }
535 
536  if (ctxconfig->noerror)
537  {
538  if (_glfw.egl.KHR_create_context_no_error)
540  }
541 
542  if (ctxconfig->major != 1 || ctxconfig->minor != 0)
543  {
546  }
547 
548  if (mask)
550 
551  if (flags)
553  }
554  else
555  {
556  if (ctxconfig->client == GLFW_OPENGL_ES_API)
558  }
559 
560  if (_glfw.egl.KHR_context_flush_control)
561  {
562  if (ctxconfig->release == GLFW_RELEASE_BEHAVIOR_NONE)
563  {
566  }
567  else if (ctxconfig->release == GLFW_RELEASE_BEHAVIOR_FLUSH)
568  {
571  }
572  }
573 
575 
576  window->context.egl.handle = eglCreateContext(_glfw.egl.display,
577  config, share, attribs);
578 
579  if (window->context.egl.handle == EGL_NO_CONTEXT)
580  {
582  "EGL: Failed to create context: %s",
584  return GLFW_FALSE;
585  }
586 
587  // Set up attributes for surface creation
588  {
589  int index = 0;
590 
591  if (fbconfig->sRGB)
592  {
593  if (_glfw.egl.KHR_gl_colorspace)
595  }
596 
598  }
599 
600  window->context.egl.surface =
601  eglCreateWindowSurface(_glfw.egl.display,
602  config,
604  attribs);
605  if (window->context.egl.surface == EGL_NO_SURFACE)
606  {
608  "EGL: Failed to create window surface: %s",
610  return GLFW_FALSE;
611  }
612 
613  window->context.egl.config = config;
614 
615  // Load the appropriate client library
616  if (!_glfw.egl.KHR_get_all_proc_addresses)
617  {
618  int i;
619  const char** sonames;
620  const char* es1sonames[] =
621  {
622 #if defined(_GLFW_GLESV1_LIBRARY)
623  _GLFW_GLESV1_LIBRARY,
624 #elif defined(_GLFW_WIN32)
625  "GLESv1_CM.dll",
626  "libGLES_CM.dll",
627 #elif defined(_GLFW_COCOA)
628  "libGLESv1_CM.dylib",
629 #else
630  "libGLESv1_CM.so.1",
631  "libGLES_CM.so.1",
632 #endif
633  NULL
634  };
635  const char* es2sonames[] =
636  {
637 #if defined(_GLFW_GLESV2_LIBRARY)
638  _GLFW_GLESV2_LIBRARY,
639 #elif defined(_GLFW_WIN32)
640  "GLESv2.dll",
641  "libGLESv2.dll",
642 #elif defined(_GLFW_COCOA)
643  "libGLESv2.dylib",
644 #elif defined(__CYGWIN__)
645  "libGLESv2-2.so",
646 #else
647  "libGLESv2.so.2",
648 #endif
649  NULL
650  };
651  const char* glsonames[] =
652  {
653 #if defined(_GLFW_OPENGL_LIBRARY)
654  _GLFW_OPENGL_LIBRARY,
655 #elif defined(_GLFW_WIN32)
656 #elif defined(_GLFW_COCOA)
657 #else
658  "libGL.so.1",
659 #endif
660  NULL
661  };
662 
663  if (ctxconfig->client == GLFW_OPENGL_ES_API)
664  {
665  if (ctxconfig->major == 1)
666  sonames = es1sonames;
667  else
668  sonames = es2sonames;
669  }
670  else
671  sonames = glsonames;
672 
673  for (i = 0; sonames[i]; i++)
674  {
675  // HACK: Match presence of lib prefix to increase chance of finding
676  // a matching pair in the jungle that is Win32 EGL/GLES
677  if (_glfw.egl.prefix != (strncmp(sonames[i], "lib", 3) == 0))
678  continue;
679 
680  window->context.egl.client = _glfw_dlopen(sonames[i]);
681  if (window->context.egl.client)
682  break;
683  }
684 
685  if (!window->context.egl.client)
686  {
688  "EGL: Failed to load client library");
689  return GLFW_FALSE;
690  }
691  }
692 
699 
700  return GLFW_TRUE;
701 }
702 
703 #undef setAttrib
704 
705 // Returns the Visual and depth of the chosen EGLConfig
706 //
707 #if defined(_GLFW_X11)
708 GLFWbool _glfwChooseVisualEGL(const _GLFWwndconfig* wndconfig,
709  const _GLFWctxconfig* ctxconfig,
710  const _GLFWfbconfig* fbconfig,
711  Visual** visual, int* depth)
712 {
713  XVisualInfo* result;
714  XVisualInfo desired;
715  EGLConfig native;
716  EGLint visualID = 0, count = 0;
717  const long vimask = VisualScreenMask | VisualIDMask;
718 
719  if (!chooseEGLConfig(ctxconfig, fbconfig, &native))
720  {
722  "EGL: Failed to find a suitable EGLConfig");
723  return GLFW_FALSE;
724  }
725 
726  eglGetConfigAttrib(_glfw.egl.display, native,
727  EGL_NATIVE_VISUAL_ID, &visualID);
728 
729  desired.screen = _glfw.x11.screen;
730  desired.visualid = visualID;
731 
732  result = XGetVisualInfo(_glfw.x11.display, vimask, &desired, &count);
733  if (!result)
734  {
736  "EGL: Failed to retrieve Visual for EGLConfig");
737  return GLFW_FALSE;
738  }
739 
740  *visual = result->visual;
741  *depth = result->depth;
742 
743  XFree(result);
744  return GLFW_TRUE;
745 }
746 #endif // _GLFW_X11
747 
748 
752 
754 {
756  return _glfw.egl.display;
757 }
758 
760 {
761  _GLFWwindow* window = (_GLFWwindow*) handle;
763 
764  if (window->context.client == GLFW_NO_API)
765  {
767  return EGL_NO_CONTEXT;
768  }
769 
770  return window->context.egl.handle;
771 }
772 
774 {
775  _GLFWwindow* window = (_GLFWwindow*) handle;
777 
778  if (window->context.client == GLFW_NO_API)
779  {
781  return EGL_NO_SURFACE;
782  }
783 
784  return window->context.egl.surface;
785 }
786 
#define EGL_OPENGL_ES_BIT
Definition: egl_context.h:70
EGLBoolean(EGLAPIENTRY * PFN_eglDestroySurface)(EGLDisplay, EGLSurface)
Definition: egl_context.h:127
_GLFWswapbuffersfun swapBuffers
Definition: internal.h:349
#define EGL_CONTEXT_OPENGL_NO_ERROR_KHR
Definition: egl_context.h:103
#define GLFW_OPENGL_ES_API
Definition: glfw3.h:991
EGLBoolean(EGLAPIENTRY * PFN_eglBindAPI)(EGLenum)
Definition: egl_context.h:125
_GLFWwindow * share
Definition: internal.h:297
#define EGL_SUCCESS
Definition: egl_context.h:50
#define eglSwapInterval
Definition: egl_context.h:148
#define EGL_CONTEXT_LOST
Definition: egl_context.h:64
#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR
Definition: egl_context.h:98
static void makeContextCurrentEGL(_GLFWwindow *window)
Definition: egl_context.c:189
#define EGL_BAD_CONFIG
Definition: egl_context.h:55
EGLBoolean(EGLAPIENTRY * PFN_eglMakeCurrent)(EGLDisplay, EGLSurface, EGLSurface, EGLContext)
Definition: egl_context.h:130
_GLFWgetprocaddressfun getProcAddress
Definition: internal.h:352
#define EGL_OPENGL_BIT
Definition: egl_context.h:72
#define EGL_BAD_CONTEXT
Definition: egl_context.h:56
#define GLFWAPI
Definition: glfw3.h:240
EGLDisplay(EGLAPIENTRY * PFN_eglGetDisplay)(EGLNativeDisplayType)
Definition: egl_context.h:121
#define EGL_RGB_BUFFER
Definition: egl_context.h:66
static const char * getEGLErrorString(EGLint error)
Definition: egl_context.c:38
#define GLFW_OPENGL_COMPAT_PROFILE
Definition: glfw3.h:999
_GLFWtls contextSlot
Definition: internal.h:536
#define EGL_CONTEXT_CLIENT_VERSION
Definition: egl_context.h:84
#define EGL_CONTEXT_MAJOR_VERSION_KHR
Definition: egl_context.h:99
const GLint * attribs
Definition: glext.h:11230
GLFWbool sRGB
Definition: internal.h:326
#define EGL_NO_DISPLAY
Definition: egl_context.h:87
uintptr_t handle
Definition: internal.h:329
#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR
Definition: egl_context.h:91
static int extensionSupportedEGL(const char *extension)
Definition: egl_context.c:238
GLuint64 GLenum void * handle
Definition: glext.h:7785
#define EGL_NOT_INITIALIZED
Definition: egl_context.h:51
const char *(EGLAPIENTRY * PFN_eglQueryString)(EGLDisplay, EGLint)
Definition: egl_context.h:133
_GLFWdestroycontextfun destroy
Definition: internal.h:353
GLfloat value
#define EGL_LOSE_CONTEXT_ON_RESET_KHR
Definition: egl_context.h:97
GLint GLuint mask
#define EGL_OPENGL_ES2_BIT
Definition: egl_context.h:71
#define EGL_NO_CONTEXT
Definition: egl_context.h:88
#define eglGetConfigs
Definition: egl_context.h:136
#define GLFW_FALSE
Zero.
Definition: glfw3.h:287
#define _glfw_dlopen(name)
GLint GLint GLsizei GLsizei GLsizei depth
#define GLFW_NO_WINDOW_CONTEXT
The specified window does not have an OpenGL or OpenGL ES context.
Definition: glfw3.h:753
EGLBoolean(EGLAPIENTRY * PFN_eglGetConfigs)(EGLDisplay, EGLConfig *, EGLint, EGLint *)
Definition: egl_context.h:120
GLFWbool forward
Definition: internal.h:291
#define GLFW_LOSE_CONTEXT_ON_RESET
Definition: glfw3.h:995
#define EGL_WINDOW_BIT
Definition: egl_context.h:68
#define EGL_DEPTH_SIZE
Definition: egl_context.h:77
#define EGL_CONTEXT_RELEASE_BEHAVIOR_NONE_KHR
Definition: egl_context.h:107
#define GLFW_OPENGL_API
Definition: glfw3.h:990
#define eglBindAPI
Definition: egl_context.h:141
#define EGL_NATIVE_VISUAL_ID
Definition: egl_context.h:85
#define GLFW_API_UNAVAILABLE
GLFW could not find support for the requested API on the system.
Definition: glfw3.h:698
#define EGL_CONTEXT_MINOR_VERSION_KHR
Definition: egl_context.h:100
#define GLFW_FORMAT_UNAVAILABLE
The requested format is not supported or available.
Definition: glfw3.h:745
int stencilBits
Definition: internal.h:318
EGLint(EGLAPIENTRY * PFN_eglGetError)(void)
Definition: egl_context.h:122
GLdouble n
Definition: glext.h:1966
#define GLFW_RELEASE_BEHAVIOR_NONE
Definition: glfw3.h:1012
_GLFWcontext context
Definition: internal.h:394
#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR
Definition: egl_context.h:93
int GLFWbool
Definition: internal.h:61
#define EGL_RENDERABLE_TYPE
Definition: egl_context.h:69
static void swapBuffersEGL(_GLFWwindow *window)
Definition: egl_context.c:221
EGLBoolean(EGLAPIENTRY * PFN_eglTerminate)(EGLDisplay)
Definition: egl_context.h:124
#define eglGetError
Definition: egl_context.h:138
EGLBoolean(EGLAPIENTRY * PFN_eglDestroyContext)(EGLDisplay, EGLContext)
Definition: egl_context.h:128
GLFWAPI EGLContext glfwGetEGLContext(GLFWwindow *handle)
Definition: egl_context.c:759
void * handle
Definition: internal.h:547
#define EGL_BAD_CURRENT_SURFACE
Definition: egl_context.h:57
#define EGL_BAD_NATIVE_PIXMAP
Definition: egl_context.h:60
GLuint index
#define eglCreateContext
Definition: egl_context.h:142
void(* GLFWglproc)(void)
#define EGL_BAD_MATCH
Definition: egl_context.h:59
GLFWbool transparent
Definition: internal.h:328
#define _glfw_dlclose(handle)
void * EGLContext
Definition: egl_context.h:114
#define _GLFW_REQUIRE_INIT_OR_RETURN(x)
Definition: internal.h:210
#define EGL_EXTENSIONS
Definition: egl_context.h:83
static GLFWbool chooseEGLConfig(const _GLFWctxconfig *ctxconfig, const _GLFWfbconfig *desired, EGLConfig *result)
Definition: egl_context.c:88
const _GLFWfbconfig * _glfwChooseFBConfig(const _GLFWfbconfig *desired, const _GLFWfbconfig *alternatives, unsigned int count)
Definition: context.c:176
#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR
Definition: egl_context.h:101
GLFWbool _glfwIsVisualTransparentX11(Visual *visual)
Definition: x11_window.c:1885
#define EGL_BAD_ATTRIBUTE
Definition: egl_context.h:54
GLFWbool _glfwCreateContextEGL(_GLFWwindow *window, const _GLFWctxconfig *ctxconfig, const _GLFWfbconfig *fbconfig)
Definition: egl_context.c:456
static void swapIntervalEGL(int interval)
Definition: egl_context.c:233
GLFWAPI EGLDisplay glfwGetEGLDisplay(void)
Definition: egl_context.c:753
#define GLFW_PLATFORM_ERROR
A platform-specific error occurred that does not match any of the more specific categories.
Definition: glfw3.h:726
_GLFWlibrary _glfw
Definition: init.c:44
#define EGL_GL_COLORSPACE_KHR
Definition: egl_context.h:104
#define eglSwapBuffers
Definition: egl_context.h:147
GLFWbool _glfwStringInExtensionString(const char *string, const char *extensions)
Definition: context.c:580
_W64 unsigned int uintptr_t
Definition: stdint.h:119
EGLBoolean(EGLAPIENTRY * PFN_eglSwapBuffers)(EGLDisplay, EGLSurface)
Definition: egl_context.h:131
#define EGL_NO_SURFACE
Definition: egl_context.h:86
static void destroyContextEGL(_GLFWwindow *window)
Definition: egl_context.c:265
#define EGL_NO_RESET_NOTIFICATION_KHR
Definition: egl_context.h:96
void * EGLConfig
Definition: egl_context.h:113
void _glfwTerminateEGL(void)
Definition: egl_context.c:432
#define EGL_CONTEXT_FLAGS_KHR
Definition: egl_context.h:102
#define EGL_SAMPLES
Definition: egl_context.h:79
GLFWbool noerror
Definition: internal.h:293
#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR
Definition: egl_context.h:92
GLbitfield flags
#define EGL_COLOR_BUFFER_TYPE
Definition: egl_context.h:65
_GLFWmakecontextcurrentfun makeCurrent
Definition: internal.h:348
#define EGL_BAD_DISPLAY
Definition: egl_context.h:58
#define EGL_OPENGL_API
Definition: egl_context.h:81
#define EGL_GREEN_SIZE
Definition: egl_context.h:75
GLFWAPI EGLSurface glfwGetEGLSurface(GLFWwindow *handle)
Definition: egl_context.c:773
void _glfwInputError(int code, const char *format,...)
Definition: init.c:129
#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR
Definition: egl_context.h:94
_GLFWextensionsupportedfun extensionSupported
Definition: internal.h:351
#define EGL_CONTEXT_RELEASE_BEHAVIOR_KHR
Definition: egl_context.h:106
#define EGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR
Definition: egl_context.h:108
GLFWbool debug
Definition: internal.h:292
#define GLFW_RELEASE_BEHAVIOR_FLUSH
Definition: glfw3.h:1011
#define eglGetProcAddress
Definition: egl_context.h:150
#define EGL_ALPHA_SIZE
Definition: egl_context.h:73
#define EGL_BAD_ACCESS
Definition: egl_context.h:52
#define GLFW_VERSION_UNAVAILABLE
The requested OpenGL or OpenGL ES version is not available.
Definition: glfw3.h:715
#define _GLFW_EGL_NATIVE_WINDOW
_GLFWswapintervalfun swapInterval
Definition: internal.h:350
#define eglQueryString
Definition: egl_context.h:149
#define EGL_BAD_ALLOC
Definition: egl_context.h:53
#define eglGetConfigAttrib
Definition: egl_context.h:135
#define GLFW_TRUE
One.
Definition: glfw3.h:279
GLFWglproc(EGLAPIENTRY * PFN_eglGetProcAddress)(const char *)
Definition: egl_context.h:134
void _glfwPlatformSetTls(_GLFWtls *tls, void *value)
Definition: posix_thread.c:66
#define eglDestroyContext
Definition: egl_context.h:144
EGLBoolean(EGLAPIENTRY * PFN_eglSwapInterval)(EGLDisplay, EGLint)
Definition: egl_context.h:132
EGLSurface(EGLAPIENTRY * PFN_eglCreateWindowSurface)(EGLDisplay, EGLConfig, EGLNativeWindowType, const EGLint *)
Definition: egl_context.h:129
#define eglCreateWindowSurface
Definition: egl_context.h:145
#define GLFW_OPENGL_CORE_PROFILE
Definition: glfw3.h:998
#define eglTerminate
Definition: egl_context.h:140
GLint GLsizei count
#define setAttrib(a, v)
Definition: egl_context.c:447
int EGLint
Definition: egl_context.h:110
#define EGL_BAD_PARAMETER
Definition: egl_context.h:62
EGLBoolean(EGLAPIENTRY * PFN_eglInitialize)(EGLDisplay, EGLint *, EGLint *)
Definition: egl_context.h:123
void * _glfwPlatformGetTls(_GLFWtls *tls)
Definition: posix_thread.c:60
#define EGL_STENCIL_SIZE
Definition: egl_context.h:78
#define EGL_BLUE_SIZE
Definition: egl_context.h:74
GLFWbool doublebuffer
Definition: internal.h:327
#define EGL_SURFACE_TYPE
Definition: egl_context.h:67
#define NULL
Definition: tinycthread.c:47
int i
EGLBoolean(EGLAPIENTRY * PFN_eglGetConfigAttrib)(EGLDisplay, EGLConfig, EGLint, EGLint *)
Definition: egl_context.h:119
#define EGL_GL_COLORSPACE_SRGB_KHR
Definition: egl_context.h:105
#define _glfw_dlsym(handle, name)
GLFWbool _glfwInitEGL(void)
Definition: egl_context.c:300
#define EGL_OPENGL_ES_API
Definition: egl_context.h:80
#define _GLFW_EGL_NATIVE_DISPLAY
static GLFWglproc getProcAddressEGL(const char *procname)
Definition: egl_context.c:250
#define EGL_NONE
Definition: egl_context.h:82
void * EGLDisplay
Definition: egl_context.h:115
GLuint64EXT * result
Definition: glext.h:10921
#define eglMakeCurrent
Definition: egl_context.h:146
#define eglGetDisplay
Definition: egl_context.h:137
static int getEGLConfigAttrib(EGLConfig config, int attrib)
Definition: egl_context.c:79
#define EGL_BAD_NATIVE_WINDOW
Definition: egl_context.h:61
#define GLFW_NO_RESET_NOTIFICATION
Definition: glfw3.h:994
#define EGL_BAD_SURFACE
Definition: egl_context.h:63
struct GLFWwindow GLFWwindow
#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR
Definition: egl_context.h:95
EGLContext(EGLAPIENTRY * PFN_eglCreateContext)(EGLDisplay, EGLConfig, EGLContext, const EGLint *)
Definition: egl_context.h:126
#define EGL_RED_SIZE
Definition: egl_context.h:76
#define GLFW_NO_API
Definition: glfw3.h:989
#define eglInitialize
Definition: egl_context.h:139
void * EGLSurface
Definition: egl_context.h:116
#define eglDestroySurface
Definition: egl_context.h:143


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:14