From 2c28aa59816819d2ff28a517e5f5781551a0d624 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Wed, 28 Jul 2010 23:47:54 -0400 Subject: [PATCH] Bind GLES2 API, not OpenGL --- compositor-drm.c | 10 +++++++--- compositor-x11.c | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/compositor-drm.c b/compositor-drm.c index 00e10c54..05ab02ac 100644 --- a/compositor-drm.c +++ b/compositor-drm.c @@ -307,6 +307,10 @@ init_egl(struct drm_compositor *ec, struct udev_device *device) { EGLint major, minor; const char *extensions; + static const EGLint context_attribs[] = { + EGL_CONTEXT_CLIENT_VERSION, 2, + EGL_NONE + }; ec->base.base.device = strdup(udev_device_get_devnode(device)); ec->drm_fd = open(ec->base.base.device, O_RDWR); @@ -334,9 +338,9 @@ init_egl(struct drm_compositor *ec, struct udev_device *device) return -1; } - eglBindAPI(EGL_OPENGL_API); - ec->base.context = eglCreateContext(ec->base.display, - NULL, EGL_NO_CONTEXT, NULL); + eglBindAPI(EGL_OPENGL_ES_API); + ec->base.context = eglCreateContext(ec->base.display, NULL, + EGL_NO_CONTEXT, context_attribs); if (ec->base.context == NULL) { fprintf(stderr, "failed to create context\n"); return -1; diff --git a/compositor-x11.c b/compositor-x11.c index 76d95859..3cb73b46 100644 --- a/compositor-x11.c +++ b/compositor-x11.c @@ -200,6 +200,10 @@ x11_compositor_init_egl(struct x11_compositor *c) { EGLint major, minor; const char *extensions; + static const EGLint context_attribs[] = { + EGL_CONTEXT_CLIENT_VERSION, 2, + EGL_NONE + }; if (dri2_connect(c) < 0) return -1; @@ -232,9 +236,9 @@ x11_compositor_init_egl(struct x11_compositor *c) return -1; } - eglBindAPI(EGL_OPENGL_API); - c->base.context = eglCreateContext(c->base.display, - NULL, EGL_NO_CONTEXT, NULL); + eglBindAPI(EGL_OPENGL_ES_API); + c->base.context = eglCreateContext(c->base.display, NULL, + EGL_NO_CONTEXT, context_attribs); if (c->base.context == NULL) { fprintf(stderr, "failed to create context\n"); return -1;