diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2008-05-28 15:43:41 -0600 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2008-05-28 15:43:41 -0600 |
commit | c56e15b093c367e7e17ebd2e153baab8cafd213a (patch) | |
tree | e71df4230edd8cf46d06821d6941009961d77ffa /src/egl/main | |
parent | 8cd33faee61626de7320efb4e20d95e4cfb7a573 (diff) | |
download | external_mesa3d-c56e15b093c367e7e17ebd2e153baab8cafd213a.zip external_mesa3d-c56e15b093c367e7e17ebd2e153baab8cafd213a.tar.gz external_mesa3d-c56e15b093c367e7e17ebd2e153baab8cafd213a.tar.bz2 |
egl: make sure EGL_VERSION_STRING query returns same version as eglInitialize()
Diffstat (limited to 'src/egl/main')
-rw-r--r-- | src/egl/main/eglapi.c | 11 | ||||
-rw-r--r-- | src/egl/main/egldefines.h | 2 | ||||
-rw-r--r-- | src/egl/main/egldriver.c | 2 | ||||
-rw-r--r-- | src/egl/main/egldriver.h | 11 |
4 files changed, 16 insertions, 10 deletions
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c index 984af4e..3151b35 100644 --- a/src/egl/main/eglapi.c +++ b/src/egl/main/eglapi.c @@ -64,6 +64,7 @@ EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor) { if (dpy) { + EGLBoolean retVal; _EGLDisplay *dpyPriv = _eglLookupDisplay(dpy); if (!dpyPriv) { return EGL_FALSE; @@ -75,8 +76,14 @@ eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor) return EGL_FALSE; } /* Initialize the particular driver now */ - return dpyPriv->Driver->API.Initialize(dpyPriv->Driver, dpy, - major, minor); + retVal = dpyPriv->Driver->API.Initialize(dpyPriv->Driver, dpy, + major, minor); + + dpyPriv->Driver->APImajor = *major; + dpyPriv->Driver->APIminor = *minor; + sprintf(dpyPriv->Driver->Version, "%d.%d", *major, *minor); + + return retVal; } return EGL_FALSE; } diff --git a/src/egl/main/egldefines.h b/src/egl/main/egldefines.h index f5d37a2..8fc2301 100644 --- a/src/egl/main/egldefines.h +++ b/src/egl/main/egldefines.h @@ -38,8 +38,6 @@ #define _EGL_MAX_EXTENSIONS_LEN 1000 -#define _EGL_VERSION_STRING "1.4" - #define _EGL_VENDOR_STRING "Mesa Project" diff --git a/src/egl/main/egldriver.c b/src/egl/main/egldriver.c index 6d53362..2257a68 100644 --- a/src/egl/main/egldriver.c +++ b/src/egl/main/egldriver.c @@ -306,7 +306,7 @@ _eglQueryString(_EGLDriver *drv, EGLDisplay dpy, EGLint name) case EGL_VENDOR: return _EGL_VENDOR_STRING; case EGL_VERSION: - return _EGL_VERSION_STRING; + return drv->Version; case EGL_EXTENSIONS: _eglUpdateExtensionsString(drv); return drv->Extensions.String; diff --git a/src/egl/main/egldriver.h b/src/egl/main/egldriver.h index 67cfb02..9395a66 100644 --- a/src/egl/main/egldriver.h +++ b/src/egl/main/egldriver.h @@ -24,17 +24,18 @@ struct _egl_extensions */ struct _egl_driver { - EGLBoolean Initialized; /* set by driver after initialized */ + EGLBoolean Initialized; /**< set by driver after initialized */ - void *LibHandle; /* dlopen handle */ + void *LibHandle; /**< dlopen handle */ _EGLDisplay *Display; - int ABIversion; - int APImajor, APIminor; /* returned through eglInitialize */ + int APImajor, APIminor; /**< as returned by eglInitialize() */ + char Version[10]; /**< initialized from APImajor/minor */ + const char *ClientAPIs; - _EGLAPI API; + _EGLAPI API; /**< EGL API dispatch table */ _EGLExtensions Extensions; }; |