devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=827ca3fcfc24fef9cb18a898f20c836e7d434a28
commit 827ca3fcfc24fef9cb18a898f20c836e7d434a28 Author: Chris Michael <cp.mich...@samsung.com> Date: Wed Aug 6 15:03:01 2014 -0400 evas-wayland-egl: Implement eng_gl_context functions The eng_gl_context functions are used for Evas 3D, so let's support those in the wayland_egl engine. Signed-off-by: Chris Michael <cp.mich...@samsung.com> --- .../evas/engines/wayland_egl/evas_wl_main.c | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/src/modules/evas/engines/wayland_egl/evas_wl_main.c b/src/modules/evas/engines/wayland_egl/evas_wl_main.c index c073dd7..511f626 100644 --- a/src/modules/evas/engines/wayland_egl/evas_wl_main.c +++ b/src/modules/evas/engines/wayland_egl/evas_wl_main.c @@ -495,3 +495,52 @@ eng_outbuf_egl_display_get(Outbuf *ob) { return ob->egl_disp; } + +Context_3D * +eng_gl_context_new(Outbuf *ob) +{ + Context_3D *ctx; + int attrs[3]; + + if (!ob) return NULL; + + attrs[0] = EGL_CONTEXT_CLIENT_VERSION; + attrs[1] = 2; + attrs[3] = EGL_NONE; + + if (!(ctx = calloc(1, sizeof(Context_3D)))) return NULL; + + ctx->context = + eglCreateContext(ob->egl_disp, ob->egl_config, ob->egl_context[0], attrs); + if (!ctx->context) + { + ERR("Could not create egl context %#x", eglGetError()); + goto err; + } + + ctx->display = ob->egl_disp; + ctx->surface = ob->egl_surface[0]; + + return ctx; + +err: + free(ctx); + return NULL; +} + +void +eng_gl_context_free(Context_3D *ctx) +{ + eglDestroyContext(ctx->display, ctx->context); +} + +void +eng_gl_context_use(Context_3D *ctx) +{ + if (eglMakeCurrent(ctx->display, ctx->surface, + ctx->surface, ctx->context) == EGL_FALSE) + { + ERR("eglMakeCurrent Failed: %#x", eglGetError()); + } +} + --