Go to the documentation of this file.
45 return "EGL is not or could not be initialized";
47 return "EGL cannot access a requested resource";
49 return "EGL failed to allocate resources for the requested operation";
51 return "An unrecognized attribute or attribute value was passed in the attribute list";
53 return "An EGLContext argument does not name a valid EGL rendering context";
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";
59 return "An EGLDisplay argument does not name a valid EGL display connection";
61 return "An EGLSurface argument does not name a valid surface configured for GL rendering";
63 return "Arguments are inconsistent";
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";
71 return "The application must destroy all contexts and reinitialise";
73 return "ERROR: UNKNOWN EGL ERROR";
95 int i, nativeCount, usableCount;
104 nativeConfigs = calloc(nativeCount,
sizeof(
EGLConfig));
110 for (i = 0; i < nativeCount; i++)
123 #if defined(_GLFW_X11)
124 XVisualInfo vi = {0};
134 XVisualInfo* vis = XGetVisualInfo(
_glfw.x11.display,
147 if (ctxconfig->
major == 1)
175 u->
handle = (uintptr_t) n;
186 return closest !=
NULL;
199 "EGL: Failed to make context current: %s",
212 "EGL: Failed to clear current context: %s",
226 "EGL: The context must be current on the calling thread when swapping buffers");
267 #if defined(_GLFW_X11)
280 if (window->
context.egl.surface)
286 if (window->
context.egl.handle)
303 const char* sonames[] =
305 #if defined(_GLFW_EGL_LIBRARY)
307 #elif defined(_GLFW_WIN32)
310 #elif defined(_GLFW_COCOA)
312 #elif defined(__CYGWIN__)
323 for (i = 0; sonames[i]; i++)
336 _glfw.egl.prefix = (strncmp(sonames[i],
"lib", 3) == 0);
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)
389 "EGL: Failed to load required entry points");
399 "EGL: Failed to get EGL display: %s",
409 "EGL: Failed to initialize EGL: %s",
416 _glfw.egl.KHR_create_context =
418 _glfw.egl.KHR_create_context_no_error =
420 _glfw.egl.KHR_gl_colorspace =
422 _glfw.egl.KHR_get_all_proc_addresses =
424 _glfw.egl.KHR_context_flush_control =
434 if (
_glfw.egl.display)
447 #define setAttrib(a, v) \
449 assert((size_t) (index + 1) < sizeof(attribs) / sizeof(attribs[0])); \
450 attribs[index++] = a; \
451 attribs[index++] = v; \
465 if (!
_glfw.egl.display)
471 if (ctxconfig->
share)
477 "EGL: Failed to find a suitable EGLConfig");
486 "EGL: Failed to bind OpenGL ES: %s",
496 "EGL: Failed to bind OpenGL: %s",
502 if (
_glfw.egl.KHR_create_context)
504 int mask = 0, flags = 0;
517 if (ctxconfig->
debug)
538 if (
_glfw.egl.KHR_create_context_no_error)
542 if (ctxconfig->
major != 1 || ctxconfig->
minor != 0)
560 if (
_glfw.egl.KHR_context_flush_control)
582 "EGL: Failed to create context: %s",
593 if (
_glfw.egl.KHR_gl_colorspace)
608 "EGL: Failed to create window surface: %s",
616 if (!
_glfw.egl.KHR_get_all_proc_addresses)
619 const char** sonames;
620 const char* es1sonames[] =
622 #if defined(_GLFW_GLESV1_LIBRARY)
623 _GLFW_GLESV1_LIBRARY,
624 #elif defined(_GLFW_WIN32)
627 #elif defined(_GLFW_COCOA)
628 "libGLESv1_CM.dylib",
635 const char* es2sonames[] =
637 #if defined(_GLFW_GLESV2_LIBRARY)
638 _GLFW_GLESV2_LIBRARY,
639 #elif defined(_GLFW_WIN32)
642 #elif defined(_GLFW_COCOA)
644 #elif defined(__CYGWIN__)
651 const char* glsonames[] =
653 #if defined(_GLFW_OPENGL_LIBRARY)
654 _GLFW_OPENGL_LIBRARY,
655 #elif defined(_GLFW_WIN32)
656 #elif defined(_GLFW_COCOA)
665 if (ctxconfig->
major == 1)
666 sonames = es1sonames;
668 sonames = es2sonames;
673 for (i = 0; sonames[i]; i++)
677 if (
_glfw.egl.prefix != (strncmp(sonames[i],
"lib", 3) == 0))
688 "EGL: Failed to load client library");
707 #if defined(_GLFW_X11)
711 Visual** visual,
int* depth)
716 EGLint visualID = 0, count = 0;
717 const long vimask = VisualScreenMask | VisualIDMask;
722 "EGL: Failed to find a suitable EGLConfig");
729 desired.screen =
_glfw.x11.screen;
730 desired.visualid = visualID;
732 result = XGetVisualInfo(
_glfw.x11.display, vimask, &desired, &count);
736 "EGL: Failed to retrieve Visual for EGLConfig");
740 *visual = result->visual;
741 *depth = result->depth;
756 return _glfw.egl.display;
770 return window->
context.egl.handle;
784 return window->
context.egl.surface;
#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR
#define EGL_GL_COLORSPACE_SRGB_KHR
static void swapBuffersEGL(_GLFWwindow *window)
void _glfwTerminateEGL(void)
EGLBoolean(EGLAPIENTRY * PFN_eglTerminate)(EGLDisplay)
#define EGL_BAD_CURRENT_SURFACE
#define EGL_BAD_NATIVE_PIXMAP
_GLFWextensionsupportedfun extensionSupported
#define EGL_CONTEXT_MAJOR_VERSION_KHR
EGLBoolean(EGLAPIENTRY * PFN_eglDestroySurface)(EGLDisplay, EGLSurface)
#define EGL_NATIVE_VISUAL_ID
GLFWAPI EGLContext glfwGetEGLContext(GLFWwindow *handle)
_GLFWmakecontextcurrentfun makeCurrent
#define GLFW_RELEASE_BEHAVIOR_NONE
#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR
static int extensionSupportedEGL(const char *extension)
#define EGL_CONTEXT_RELEASE_BEHAVIOR_NONE_KHR
#define EGL_BAD_ATTRIBUTE
EGLBoolean(EGLAPIENTRY * PFN_eglGetConfigs)(EGLDisplay, EGLConfig *, EGLint, EGLint *)
#define GLFW_FORMAT_UNAVAILABLE
The requested format is not supported or available.
struct GLFWwindow GLFWwindow
Opaque window object.
#define EGL_OPENGL_ES_API
GLFWbool _glfwChooseVisualEGL(const _GLFWwndconfig *wndconfig, const _GLFWctxconfig *ctxconfig, const _GLFWfbconfig *fbconfig, Visual **visual, int *depth)
void _glfwPlatformSetTls(_GLFWtls *tls, void *value)
error
Error code indicating why parse failed.
#define EGL_CONTEXT_CLIENT_VERSION
void _glfwInputError(int code, const char *format,...)
static void makeContextCurrentEGL(_GLFWwindow *window)
#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR
static GLFWglproc getProcAddressEGL(const char *procname)
#define GLFW_VERSION_UNAVAILABLE
The requested OpenGL or OpenGL ES version is not available.
#define GLFW_LOSE_CONTEXT_ON_RESET
_GLFWdestroycontextfun destroy
#define GLFW_NO_WINDOW_CONTEXT
The specified window does not have an OpenGL or OpenGL ES context.
EGLBoolean(EGLAPIENTRY * PFN_eglInitialize)(EGLDisplay, EGLint *, EGLint *)
#define EGL_CONTEXT_FLAGS_KHR
static GLFWbool chooseEGLConfig(const _GLFWctxconfig *ctxconfig, const _GLFWfbconfig *desired, EGLConfig *result)
#define GLFW_API_UNAVAILABLE
GLFW could not find support for the requested API on the system.
void(* GLFWglproc)(void)
Client API function pointer type.
#define EGL_OPENGL_ES2_BIT
#define GLFW_OPENGL_COMPAT_PROFILE
#define EGL_LOSE_CONTEXT_ON_RESET_KHR
EGLint(EGLAPIENTRY * PFN_eglGetError)(void)
#define EGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR
#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR
#define EGL_RENDERABLE_TYPE
#define GLFW_NO_RESET_NOTIFICATION
void * _glfwPlatformGetTls(_GLFWtls *tls)
#define EGL_CONTEXT_MINOR_VERSION_KHR
#define EGL_COLOR_BUFFER_TYPE
GLFWbool _glfwCreateContextEGL(_GLFWwindow *window, const _GLFWctxconfig *ctxconfig, const _GLFWfbconfig *fbconfig)
#define EGL_BAD_PARAMETER
GLFWAPI EGLDisplay glfwGetEGLDisplay(void)
#define _GLFW_REQUIRE_INIT_OR_RETURN(x)
EGLBoolean(EGLAPIENTRY * PFN_eglSwapInterval)(EGLDisplay, EGLint)
const _GLFWfbconfig * _glfwChooseFBConfig(const _GLFWfbconfig *desired, const _GLFWfbconfig *alternatives, unsigned int count)
#define GLFW_OPENGL_ES_API
static int getEGLConfigAttrib(EGLConfig config, int attrib)
#define EGL_CONTEXT_RELEASE_BEHAVIOR_KHR
EGLContext(EGLAPIENTRY * PFN_eglCreateContext)(EGLDisplay, EGLConfig, EGLContext, const EGLint *)
EGLSurface(EGLAPIENTRY * PFN_eglCreateWindowSurface)(EGLDisplay, EGLConfig, EGLNativeWindowType, const EGLint *)
GLFWbool _glfwStringInExtensionString(const char *string, const char *extensions)
EGLBoolean(EGLAPIENTRY * PFN_eglGetConfigAttrib)(EGLDisplay, EGLConfig, EGLint, EGLint *)
GLFWAPI EGLSurface glfwGetEGLSurface(GLFWwindow *handle)
#define EGL_OPENGL_ES_BIT
#define eglDestroyContext
static const char * getEGLErrorString(EGLint error)
#define EGL_CONTEXT_OPENGL_NO_ERROR_KHR
static void swapIntervalEGL(int interval)
#define EGL_BAD_NATIVE_WINDOW
#define EGL_GL_COLORSPACE_KHR
EGLBoolean(EGLAPIENTRY * PFN_eglSwapBuffers)(EGLDisplay, EGLSurface)
#define eglCreateWindowSurface
EGLBoolean(EGLAPIENTRY * PFN_eglMakeCurrent)(EGLDisplay, EGLSurface, EGLSurface, EGLContext)
#define EGL_NOT_INITIALIZED
#define GLFW_PLATFORM_ERROR
A platform-specific error occurred that does not match any of the more specific categories.
#define EGL_NO_RESET_NOTIFICATION_KHR
static void destroyContextEGL(_GLFWwindow *window)
GLFWbool _glfwInitEGL(void)
#define eglDestroySurface
#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR
const typedef char *EGLAPIENTRY * PFN_eglQueryString(EGLDisplay, EGLint)
#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR
_GLFWswapbuffersfun swapBuffers
EGLBoolean(EGLAPIENTRY * PFN_eglDestroyContext)(EGLDisplay, EGLContext)
#define GLFW_RELEASE_BEHAVIOR_FLUSH
#define GLFW_OPENGL_CORE_PROFILE
GLFWglproc(EGLAPIENTRY * PFN_eglGetProcAddress)(const char *)
#define eglGetProcAddress
_GLFWgetprocaddressfun getProcAddress
#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR
#define eglGetConfigAttrib
EGLBoolean(EGLAPIENTRY * PFN_eglBindAPI)(EGLenum)
EGLDisplay(EGLAPIENTRY * PFN_eglGetDisplay)(EGLNativeDisplayType)
_GLFWswapintervalfun swapInterval
mvsim
Author(s):
autogenerated on Wed May 28 2025 02:13:07