From 81050e426bbd7e5cd53820ebd3c2a4a42cc18c6f Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 7 Aug 2024 08:30:11 +0200 Subject: load eglGetProcAddress --- include/mgl/gl.h | 2 ++ src/gl.c | 1 + 2 files changed, 3 insertions(+) diff --git a/include/mgl/gl.h b/include/mgl/gl.h index dace8ef..3a96241 100644 --- a/include/mgl/gl.h +++ b/include/mgl/gl.h @@ -22,6 +22,7 @@ typedef uintptr_t EGLNativeWindowType; typedef void* EGLConfig; typedef void* EGLSurface; typedef void* EGLContext; +typedef void (*__eglMustCastToProperFunctionPointerType)(void); typedef struct { void *gl_library; @@ -36,6 +37,7 @@ typedef struct { GLXFBConfig* (*glXChooseFBConfig)(Display *dpy, int screen, const int *attribList, int *nitems); _XVisualInfo* (*glXGetVisualFromFBConfig)(Display *dpy, GLXFBConfig config); + __eglMustCastToProperFunctionPointerType (*eglGetProcAddress)(const char *procname); EGLDisplay (*eglGetDisplay)(EGLNativeDisplayType display_id); unsigned int (*eglInitialize)(EGLDisplay dpy, int32_t *major, int32_t *minor); unsigned int (*eglTerminate)(EGLDisplay dpy); diff --git a/src/gl.c b/src/gl.c index 6d2c0fe..d905eb0 100644 --- a/src/gl.c +++ b/src/gl.c @@ -131,6 +131,7 @@ static int mgl_gl_load_glx(mgl_gl *self) { static int mgl_gl_load_egl(mgl_gl *self) { const dlsym_assign required_dlsym[] = { + { (void**)&self->eglGetProcAddress, "eglGetProcAddress" }, { (void**)&self->eglGetDisplay, "eglGetDisplay" }, { (void**)&self->eglInitialize, "eglInitialize" }, { (void**)&self->eglTerminate, "eglTerminate" }, -- cgit v1.2.3