Bind GLES2 API, not OpenGL

dev
Kristian Høgsberg 14 years ago
parent c098d8da47
commit 2c28aa5981
  1. 10
      compositor-drm.c
  2. 10
      compositor-x11.c

@ -307,6 +307,10 @@ init_egl(struct drm_compositor *ec, struct udev_device *device)
{ {
EGLint major, minor; EGLint major, minor;
const char *extensions; 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->base.base.device = strdup(udev_device_get_devnode(device));
ec->drm_fd = open(ec->base.base.device, O_RDWR); 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; return -1;
} }
eglBindAPI(EGL_OPENGL_API); eglBindAPI(EGL_OPENGL_ES_API);
ec->base.context = eglCreateContext(ec->base.display, ec->base.context = eglCreateContext(ec->base.display, NULL,
NULL, EGL_NO_CONTEXT, NULL); EGL_NO_CONTEXT, context_attribs);
if (ec->base.context == NULL) { if (ec->base.context == NULL) {
fprintf(stderr, "failed to create context\n"); fprintf(stderr, "failed to create context\n");
return -1; return -1;

@ -200,6 +200,10 @@ x11_compositor_init_egl(struct x11_compositor *c)
{ {
EGLint major, minor; EGLint major, minor;
const char *extensions; const char *extensions;
static const EGLint context_attribs[] = {
EGL_CONTEXT_CLIENT_VERSION, 2,
EGL_NONE
};
if (dri2_connect(c) < 0) if (dri2_connect(c) < 0)
return -1; return -1;
@ -232,9 +236,9 @@ x11_compositor_init_egl(struct x11_compositor *c)
return -1; return -1;
} }
eglBindAPI(EGL_OPENGL_API); eglBindAPI(EGL_OPENGL_ES_API);
c->base.context = eglCreateContext(c->base.display, c->base.context = eglCreateContext(c->base.display, NULL,
NULL, EGL_NO_CONTEXT, NULL); EGL_NO_CONTEXT, context_attribs);
if (c->base.context == NULL) { if (c->base.context == NULL) {
fprintf(stderr, "failed to create context\n"); fprintf(stderr, "failed to create context\n");
return -1; return -1;

Loading…
Cancel
Save