summaryrefslogtreecommitdiffstats
path: root/src/egl/main/eglapi.c
diff options
context:
space:
mode:
authorJonathan White <[email protected]>2008-08-06 13:40:03 -0600
committerBrian Paul <[email protected]>2008-08-06 13:40:03 -0600
commit7e2458c7b55b2662067d8cce8a962d8c2bbd3a43 (patch)
tree933a89215c35a1f38c5d1a3e28c1ea51afd2e0a8 /src/egl/main/eglapi.c
parent7a6eba54d064cadf15f93df2c1748cf5e474ef03 (diff)
egl: fix version handling
Diffstat (limited to 'src/egl/main/eglapi.c')
-rw-r--r--src/egl/main/eglapi.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
index 49d1f3d0eb4..9df938e1887 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -63,6 +63,8 @@ eglGetDisplay(NativeDisplayType nativeDisplay)
EGLBoolean EGLAPIENTRY
eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
{
+ EGLint major_int, minor_int;
+
if (dpy) {
EGLBoolean retVal;
_EGLDisplay *dpyPriv = _eglLookupDisplay(dpy);
@@ -77,12 +79,19 @@ eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
}
/* Initialize the particular driver now */
retVal = dpyPriv->Driver->API.Initialize(dpyPriv->Driver, dpy,
- major, minor);
+ &major_int, &minor_int);
- dpyPriv->Driver->APImajor = *major;
- dpyPriv->Driver->APIminor = *minor;
+ dpyPriv->Driver->APImajor = major_int;
+ dpyPriv->Driver->APIminor = minor_int;
snprintf(dpyPriv->Driver->Version, sizeof(dpyPriv->Driver->Version),
- "%d.%d (%s)", *major, *minor, dpyPriv->Driver->Name);
+ "%d.%d (%s)", major_int, minor_int, dpyPriv->Driver->Name);
+
+ /* Update applications version of major and minor if not NULL */
+ if((major != NULL) && (minor != NULL))
+ {
+ *major = major_int;
+ *minor = minor_int;
+ }
return retVal;
}