egl: make sure EGL_VERSION_STRING query returns same version as eglInitialize()
authorBrian Paul <brian.paul@tungstengraphics.com>
Wed, 28 May 2008 21:43:41 +0000 (15:43 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Wed, 28 May 2008 21:43:41 +0000 (15:43 -0600)
src/egl/main/eglapi.c
src/egl/main/egldefines.h
src/egl/main/egldriver.c
src/egl/main/egldriver.h

index 984af4ea22ea7e379abfc77f276fabc6c7bbc70b..3151b35156c8e4acbeaebbf6282cb63e3896397e 100644 (file)
@@ -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;
 }
index f5d37a2fc063081ecdaf4de1d674d8d762b0de9f..8fc2301b795d0ad29775a78937bd9eb084e6fd47 100644 (file)
@@ -38,8 +38,6 @@
 
 #define _EGL_MAX_EXTENSIONS_LEN 1000
 
-#define _EGL_VERSION_STRING "1.4"
-
 #define _EGL_VENDOR_STRING "Mesa Project"
 
 
index 6d533625b7db3aa4640cf596ee91c5d1335e99ca..2257a68630750104d6676eb85233b109d747f7cc 100644 (file)
@@ -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;
index 67cfb02f46aa66c56ac0e22d2f0c581e2cf37766..9395a667ab3d5222fe08ec156ce59915fded5de4 100644 (file)
@@ -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;
 };