summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-05-30 13:46:31 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-05-30 13:46:31 -0600
commitba7aeb8b34c2e310b6ba0d3dbfdc68b0d6ab82c8 (patch)
tree3f2432e9feecdbcb87649dacf240f9cda6c4953f
parentd5078b94323241a6482f54797756116b1c864327 (diff)
egl: specify client API by bit flag, not string
-rw-r--r--src/gallium/winsys/egl_xlib/egl_xlib.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gallium/winsys/egl_xlib/egl_xlib.c b/src/gallium/winsys/egl_xlib/egl_xlib.c
index bd2acd0411..1458f83c02 100644
--- a/src/gallium/winsys/egl_xlib/egl_xlib.c
+++ b/src/gallium/winsys/egl_xlib/egl_xlib.c
@@ -302,6 +302,12 @@ xlib_eglCreateContext(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config,
return EGL_NO_CONTEXT;
}
+ if (ctx->Base.ClientAPI != EGL_OPENGL_API) {
+ _eglError(EGL_BAD_MATCH, "eglCreateContext(only OpenGL API supported)");
+ free(ctx);
+ return EGL_NO_CONTEXT;
+ }
+
/* create a softpipe context */
ctx->pipe = softpipe_create(xdrv->screen, xdrv->winsys, NULL);
@@ -309,6 +315,7 @@ xlib_eglCreateContext(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config,
_eglConfigToContextModesRec(conf, &visual);
ctx->Context = st_create_context(ctx->pipe, &visual, share_ctx);
+ _eglSaveContext(&ctx->Base);
return _eglGetContextHandle(&ctx->Base);
}
@@ -525,8 +532,8 @@ _eglMain(_EGLDisplay *dpy, const char *args)
xdrv->Base.API.MakeCurrent = xlib_eglMakeCurrent;
xdrv->Base.API.SwapBuffers = xlib_eglSwapBuffers;
+ xdrv->Base.ClientAPIsMask = EGL_OPENGL_BIT /*| EGL_OPENGL_ES_BIT*/;
- xdrv->Base.ClientAPIs = "OpenGL"; /* "OpenGL_ES" */
xdrv->Base.Name = "Xlib/softpipe";
/* create one winsys and use it for all contexts/surfaces */
@@ -535,7 +542,6 @@ _eglMain(_EGLDisplay *dpy, const char *args)
xdrv->screen = softpipe_create_screen(xdrv->winsys);
-
return &xdrv->Base;
}