glsym_func_void glsym_evas_gl_common_error_set = NULL;
glsym_func_int glsym_evas_gl_common_error_get = NULL;
glsym_func_void_ptr glsym_evas_gl_common_current_context_get = NULL;
-void (*glsym_evas_gl_context_restore_set) (Eina_Bool enable) = NULL;
_eng_fn (*glsym_eglGetProcAddress) (const char *a) = NULL;
void *(*glsym_eglCreateImage) (EGLDisplay a, EGLContext b, EGLenum c, EGLClientBuffer d, const int *e) = NULL;
LINK2GENERIC(evas_gl_common_error_get);
LINK2GENERIC(evas_gl_common_error_set);
LINK2GENERIC(evas_gl_common_current_context_get);
- LINK2GENERIC(evas_gl_context_restore_set);
#define FINDSYM(dst, sym, typ) \
if (glsym_eglGetProcAddress) { \
#include "evas_engine.h"
+#include <dlfcn.h>
-# define SET_RESTORE_CONTEXT() do { if (glsym_evas_gl_context_restore_set) glsym_evas_gl_context_restore_set(EINA_TRUE); } while(0)
+# define SET_RESTORE_CONTEXT() do { if (glsym_evas_gl_common_context_restore_set) glsym_evas_gl_common_context_restore_set(EINA_TRUE); } while(0)
/* local function prototypes */
+typedef void (*glsym_func_void) ();
+glsym_func_void glsym_evas_gl_common_context_restore_set = NULL;
/* local variables */
static Outbuf *_evas_gl_wl_window = NULL;
/* try to allocate space for our window */
if (!(gw = calloc(1, sizeof(Outbuf))))
return NULL;
+#define LINK2GENERIC(sym) \
+ do { \
+ if (!glsym_##sym) {\
+ glsym_##sym = dlsym(RTLD_DEFAULT, #sym); \
+ if (!glsym_##sym) ERR("Could not find function '%s'", #sym); }\
+ } while(0)
+
+ LINK2GENERIC(evas_gl_common_context_restore_set);
win_count++;
gw->info = einfo;