apple: Store the CGL API version number for future reference
authorJeremy Huddleston <jeremyhu@apple.com>
Sun, 12 Jun 2011 06:43:03 +0000 (23:43 -0700)
committerJeremy Huddleston <jeremyhu@apple.com>
Sun, 12 Jun 2011 06:43:03 +0000 (23:43 -0700)
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
src/glx/apple/apple_cgl.c
src/glx/apple/apple_cgl.h

index 737d757ed525b78b0a555a23f988cf55a35c0fc5..648ed8694977a64c8ee3e463ded96aa79bebac52 100644 (file)
@@ -64,7 +64,6 @@ void
 apple_cgl_init(void)
 {
    void *h;
-   GLint major = 0, minor = 0;
    const char *opengl_framework_path;
 
    if (initialized)
@@ -88,11 +87,11 @@ apple_cgl_init(void)
 
    apple_cgl.get_version = sym(h, "CGLGetVersion");
 
-   apple_cgl.get_version(&major, &minor);
+   apple_cgl.get_version(&apple_cgl.version_major, &apple_cgl.version_minor);
 
-   apple_glx_diagnostic("CGL major %d minor %d\n", major, minor);
+   apple_glx_diagnostic("CGL major %d minor %d\n", apple_cgl.version_major, apple_cgl.version_minor);
 
-   if (1 != major) {
+   if (1 != apple_cgl.version_major) {
       fprintf(stderr, "WARNING: the CGL major version has changed!\n"
               "libGL may be incompatible!\n");
    }
index 5e98a00fe79c6c98456232ddb580e9d3290eeec3..002c7e64badd0b5e8fa827d7f68d9935c58d3051 100644 (file)
@@ -40,7 +40,8 @@
 
 struct apple_cgl_api
 {
-   void (*get_version) (GLint * majorvers, GLint * minorvers);
+     GLint version_major, version_minor;
+     void (*get_version) (GLint * version_major, GLint * version_minor);
 
      CGLError(*choose_pixel_format) (const CGLPixelFormatAttribute * attribs,
                                      CGLPixelFormatObj * pix, GLint * npix);