compositor: Move EGL context creation to gles2-renderer.c
diff --git a/src/gles2-renderer.c b/src/gles2-renderer.c
index ff099d6..470076b 100644
--- a/src/gles2-renderer.c
+++ b/src/gles2-renderer.c
@@ -1048,10 +1048,28 @@
struct weston_output *output;
EGLBoolean ret;
+ static const EGLint context_attribs[] = {
+ EGL_CONTEXT_CLIENT_VERSION, 2,
+ EGL_NONE
+ };
+
renderer = malloc(sizeof *renderer);
if (renderer == NULL)
return -1;
+ if (!eglBindAPI(EGL_OPENGL_ES_API)) {
+ weston_log("failed to bind EGL_OPENGL_ES_API\n");
+ print_egl_error_state();
+ return -1;
+ }
+ ec->egl_context = eglCreateContext(ec->egl_display, ec->egl_config,
+ EGL_NO_CONTEXT, context_attribs);
+ if (ec->egl_context == NULL) {
+ weston_log("failed to create context\n");
+ print_egl_error_state();
+ return -1;
+ }
+
output = container_of(ec->output_list.next,
struct weston_output, link);
ret = eglMakeCurrent(ec->egl_display, output->egl_surface,