static int
_context_ext_check(EVGL_Context *ctx)
{
- int fbo_supported = 0;
- int egl_image_supported = 0;
-
if (!ctx)
return 0;
return 1;
#ifdef GL_GLES
+ int fbo_supported = 0;
+ int egl_image_supported = 0;
+
switch (ctx->version)
{
case EVAS_GL_GLES_1_X:
if (EXTENSION_SUPPORT(EGL_KHR_image_base)
&& EXTENSION_SUPPORT(EGL_KHR_gl_texture_2D_image))
egl_image_supported = 1;
-#else
- fbo_supported = 1;
- egl_image_supported = 0;
-#endif
if (fbo_supported && egl_image_supported)
ctx->fbo_image_supported = 1;
+#else
+ ctx->fbo_image_supported = 1;
+#endif
ctx->extension_checked = 1;
}
void *
-evgl_native_surface_egl_image_get(EVGL_Surface *sfc)
+evgl_native_surface_buffer_get(EVGL_Surface *sfc)
{
if (!evgl_engine)
{
ERR("Invalid input data. Engine: %p", evgl_engine);
return NULL;
}
-
+#ifdef GL_GLES
return sfc->egl_image;
+#else
+ return (void *)(uintptr_t)sfc->color_buf;
+#endif
}
int
Evas_GL_Preload glsym_evas_gl_preload_init = NULL;
Evas_GL_Preload glsym_evas_gl_preload_shutdown = NULL;
EVGL_Engine_Call glsym_evgl_engine_shutdown = NULL;
-EVGL_Native_Surface_Call glsym_evgl_native_surface_egl_image_get = NULL;
+EVGL_Native_Surface_Call glsym_evgl_native_surface_buffer_get = NULL;
Evas_Gl_Symbols glsym_evas_gl_symbols = NULL;
Evas_GL_Common_Context_New glsym_evas_gl_common_context_new = NULL;
LINK2GENERIC(evas_gl_preload_init);
LINK2GENERIC(evas_gl_preload_shutdown);
LINK2GENERIC(evgl_engine_shutdown);
- LINK2GENERIC(evgl_native_surface_egl_image_get);
+ LINK2GENERIC(evgl_native_surface_buffer_get);
LINK2GENERIC(evas_gl_symbols);
LINK2GENERIC(evas_gl_common_error_get);
LINK2GENERIC(evas_gl_common_error_set);
Visual *visual;
void *buffer;
-#ifdef GL_GLES
void *egl_surface;
-#else
+
+#ifndef GL_GLES
void *fbc;
XID glx_pixmap;
#endif
}
else if (n->ns.type == EVAS_NATIVE_SURFACE_EVASGL)
{
-#ifdef GL_GLES
if (n->egl_surface)
{
- void *surface = glsym_evgl_native_surface_egl_image_get(n->egl_surface);
+#ifdef GL_GLES
+ void *surface = glsym_evgl_native_surface_buffer_get(n->egl_surface);
if (glsym_glEGLImageTargetTexture2DOES)
{
glsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, surface);
}
else
ERR("Try glEGLImageTargetTexture2DOES on EGL with no support");
- }
#else
-// TODO
+ GLuint tex = (GLuint)(uintptr_t)glsym_evgl_native_surface_buffer_get(n->egl_surface);
+ glBindTexture(GL_TEXTURE_2D, tex);
#endif
+ }
}
}
}
else if (n->ns.type == EVAS_NATIVE_SURFACE_EVASGL)
{
+#ifdef GL_GLES
// nothing
+#else
+ glBindTexture(GL_TEXTURE_2D, 0);
+#endif
}
}
n->pixmap = 0;
n->visual = 0;
-#ifdef GL_GLES
+
n->egl_surface = ns->data.evasgl.surface;
-#else
- n->fbc = 0;
- n->glx_pixmap = 0;
-#endif
im->native.yinvert = 0;
im->native.loose = 0;