From cf3c7d74ccee8e21ebfa04159ab64fec3b989d83 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 28 May 2008 15:21:52 -0600 Subject: egl: added egldefines.h --- src/egl/main/egldefines.h | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 src/egl/main/egldefines.h (limited to 'src/egl/main/egldefines.h') diff --git a/src/egl/main/egldefines.h b/src/egl/main/egldefines.h new file mode 100644 index 0000000000..f5d37a2fc0 --- /dev/null +++ b/src/egl/main/egldefines.h @@ -0,0 +1,47 @@ +/************************************************************************** + * + * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + + + +/** + * Internal EGL defines + */ + + +#ifndef EGLDEFINES_INCLUDED +#define EGLDEFINES_INCLUDED + + +#define _EGL_MAX_EXTENSIONS_LEN 1000 + +#define _EGL_VERSION_STRING "1.4" + +#define _EGL_VENDOR_STRING "Mesa Project" + + + +#endif /* EGLDEFINES_INCLUDED */ -- cgit v1.2.3 From c56e15b093c367e7e17ebd2e153baab8cafd213a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 28 May 2008 15:43:41 -0600 Subject: egl: make sure EGL_VERSION_STRING query returns same version as eglInitialize() --- src/egl/main/eglapi.c | 11 +++++++++-- src/egl/main/egldefines.h | 2 -- src/egl/main/egldriver.c | 2 +- src/egl/main/egldriver.h | 11 ++++++----- 4 files changed, 16 insertions(+), 10 deletions(-) (limited to 'src/egl/main/egldefines.h') diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c index 984af4ea22..3151b35156 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 f5d37a2fc0..8fc2301b79 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 6d533625b7..2257a68630 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 67cfb02f46..9395a667ab 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; }; -- cgit v1.2.3