summaryrefslogtreecommitdiff
path: root/src/egl/main/eglcontext.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-05-30 13:45:40 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-05-30 13:45:40 -0600
commitd5078b94323241a6482f54797756116b1c864327 (patch)
tree7d5d96198eb770a9c24b6425d0ec53dc266cafb9 /src/egl/main/eglcontext.c
parent52676207e338b4c2b4953747521921ab79d70f06 (diff)
egl: clean-up re-org of the client API state
Diffstat (limited to 'src/egl/main/eglcontext.c')
-rw-r--r--src/egl/main/eglcontext.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/egl/main/eglcontext.c b/src/egl/main/eglcontext.c
index 86d1d84334..bf1addf241 100644
--- a/src/egl/main/eglcontext.c
+++ b/src/egl/main/eglcontext.c
@@ -20,6 +20,12 @@ _eglInitContext(_EGLDriver *drv, EGLDisplay dpy, _EGLContext *ctx,
_EGLConfig *conf;
_EGLDisplay *display = _eglLookupDisplay(dpy);
EGLint i;
+ const EGLenum api = eglQueryAPI();
+
+ if (api == EGL_NONE) {
+ _eglError(EGL_BAD_MATCH, "eglCreateContext(no client API)");
+ return EGL_FALSE;
+ }
conf = _eglLookupConfig(drv, dpy, config);
if (!conf) {
@@ -30,7 +36,8 @@ _eglInitContext(_EGLDriver *drv, EGLDisplay dpy, _EGLContext *ctx,
for (i = 0; attrib_list && attrib_list[i] != EGL_NONE; i++) {
switch (attrib_list[i]) {
case EGL_CONTEXT_CLIENT_VERSION:
- /* xxx todo */
+ i++;
+ ctx->ClientVersion = attrib_list[i];
break;
default:
_eglError(EGL_BAD_ATTRIBUTE, "_eglInitContext");
@@ -43,6 +50,7 @@ _eglInitContext(_EGLDriver *drv, EGLDisplay dpy, _EGLContext *ctx,
ctx->Config = conf;
ctx->DrawSurface = EGL_NO_SURFACE;
ctx->ReadSurface = EGL_NO_SURFACE;
+ ctx->ClientAPI = api;
return EGL_TRUE;
}