Browse Source

egl: make sure EGL_VERSION_STRING query returns same version as eglInitialize()

tags/mesa_20090313
Brian Paul 18 years ago
parent
commit
c56e15b093
4 changed files with 16 additions and 10 deletions
  1. 9
    2
      src/egl/main/eglapi.c
  2. 0
    2
      src/egl/main/egldefines.h
  3. 1
    1
      src/egl/main/egldriver.c
  4. 6
    5
      src/egl/main/egldriver.h

+ 9
- 2
src/egl/main/eglapi.c View 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;
}

+ 0
- 2
src/egl/main/egldefines.h View File

@@ -38,8 +38,6 @@

#define _EGL_MAX_EXTENSIONS_LEN 1000

#define _EGL_VERSION_STRING "1.4"

#define _EGL_VENDOR_STRING "Mesa Project"



+ 1
- 1
src/egl/main/egldriver.c View 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;

+ 6
- 5
src/egl/main/egldriver.h View 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;
};

Loading…
Cancel
Save