diff options
author | Chia-I Wu <olvaffe@gmail.com> | 2009-08-17 15:53:54 +0800 |
---|---|---|
committer | Chia-I Wu <olvaffe@gmail.com> | 2009-09-29 18:33:53 +0800 |
commit | 27c1ec23348d55da55923f88ffb94268cbbb43b4 (patch) | |
tree | db014e60bb3e053ffaea217fa09703f8fa6dc3da /src/egl/main/eglapi.c | |
parent | 607a4393e7489ed1da9808f117ecde6cb637accc (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.
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 6060e88466..753399f002 100644 --- a/src/egl/main/eglapi.c +++ b/src/egl/main/eglapi.c @@ -93,8 +93,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 { @@ -876,33 +876,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; } |