diff options
author | Chia-I Wu <[email protected]> | 2009-08-17 15:53:54 +0800 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-10-13 12:00:36 -0600 |
commit | 310c76812e5a2013dad36fc9d1686f57e7b1e626 (patch) | |
tree | 59e87b7f0f22affbc32604be85c1bdf6172fee26 /src/egl/main/eglapi.c | |
parent | e787ffcd02cac9085ac69f631cce235d1cad59c9 (diff) |
egl: Allow binding to any client API.
As a result, EGL_NONE is no longer a valid client API. And it is
possible that no config supports the current bound API.
Signed-off-by: Chia-I Wu <[email protected]>
Diffstat (limited to 'src/egl/main/eglapi.c')
-rw-r--r-- | src/egl/main/eglapi.c | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c index 23d841d2d1a..d86ef9ce562 100644 --- a/src/egl/main/eglapi.c +++ b/src/egl/main/eglapi.c @@ -92,8 +92,8 @@ eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor) snprintf(disp->Version, sizeof(disp->Version), "%d.%d (%s)", major_int, minor_int, drv->Name); - /* update the global notion of supported APIs */ - _eglGlobal.ClientAPIsMask |= disp->ClientAPIsMask; + /* limit to APIs supported by core */ + disp->ClientAPIsMask &= _EGL_API_ALL_BITS; disp->Driver = drv; } else { @@ -842,33 +842,7 @@ eglBindAPI(EGLenum api) if (!_eglIsApiValid(api)) return _eglError(EGL_BAD_PARAMETER, "eglBindAPI"); - switch (api) { -#ifdef EGL_VERSION_1_4 - case EGL_OPENGL_API: - if (_eglGlobal.ClientAPIsMask & EGL_OPENGL_BIT) { - t->CurrentAPIIndex = _eglConvertApiToIndex(api); - return EGL_TRUE; - } - _eglError(EGL_BAD_PARAMETER, "eglBindAPI"); - return EGL_FALSE; -#endif - case EGL_OPENGL_ES_API: - if (_eglGlobal.ClientAPIsMask & (EGL_OPENGL_ES_BIT | EGL_OPENGL_ES2_BIT)) { - t->CurrentAPIIndex = _eglConvertApiToIndex(api); - return EGL_TRUE; - } - _eglError(EGL_BAD_PARAMETER, "eglBindAPI"); - return EGL_FALSE; - case EGL_OPENVG_API: - if (_eglGlobal.ClientAPIsMask & EGL_OPENVG_BIT) { - t->CurrentAPIIndex = _eglConvertApiToIndex(api); - return EGL_TRUE; - } - _eglError(EGL_BAD_PARAMETER, "eglBindAPI"); - return EGL_FALSE; - default: - return EGL_FALSE; - } + t->CurrentAPIIndex = _eglConvertApiToIndex(api); return EGL_TRUE; } |