src/video/cocoa/SDL_cocoaopengl.m
changeset 1952 420716272158
parent 1936 83946ee0ff1f
child 1970 db3ba6c0d0df
     1.1 --- a/src/video/cocoa/SDL_cocoaopengl.m	Thu Jul 27 06:53:23 2006 +0000
     1.2 +++ b/src/video/cocoa/SDL_cocoaopengl.m	Fri Jul 28 08:43:17 2006 +0000
     1.3 @@ -25,14 +25,14 @@
     1.4  
     1.5  /* NSOpenGL implementation of SDL OpenGL support */
     1.6  
     1.7 -#if SDL_VIDEO_OPENGL
     1.8 +#if SDL_VIDEO_OPENGL_CGL
     1.9  #include <OpenGL/CGLTypes.h>
    1.10  
    1.11  #include "SDL_loadso.h"
    1.12  #include "SDL_opengl.h"
    1.13  
    1.14  
    1.15 -#define DEFAULT_OPENGL_PATH  "/System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib"
    1.16 +#define DEFAULT_OPENGL  "/System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib"
    1.17  
    1.18  /* This is implemented in Mac OS X 10.3 and above */
    1.19  #if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_3
    1.20 @@ -57,7 +57,10 @@
    1.21          }
    1.22      }
    1.23      if (path == NULL) {
    1.24 -        path = DEFAULT_OPENGL_PATH;
    1.25 +        path = SDL_getenv("SDL_OPENGL_LIBRARY");
    1.26 +    }
    1.27 +    if (path == NULL) {
    1.28 +        path = DEFAULT_OPENGL;
    1.29      }
    1.30      _this->gl_config.dll_handle = SDL_LoadObject(path);
    1.31      if (!_this->gl_config.dll_handle) {
    1.32 @@ -87,19 +90,6 @@
    1.33      }
    1.34  }
    1.35  
    1.36 -static void
    1.37 -Cocoa_GL_Shutdown(_THIS)
    1.38 -{
    1.39 -    if (!_this->gl_data || (--_this->gl_data->initialized > 0)) {
    1.40 -        return;
    1.41 -    }
    1.42 -
    1.43 -    Cocoa_GL_UnloadLibrary(_this);
    1.44 -
    1.45 -    SDL_free(_this->gl_data);
    1.46 -    _this->gl_data = NULL;
    1.47 -}
    1.48 -
    1.49  static int
    1.50  Cocoa_GL_Initialize(_THIS)
    1.51  {
    1.52 @@ -124,6 +114,19 @@
    1.53      return 0;
    1.54  }
    1.55  
    1.56 +static void
    1.57 +Cocoa_GL_Shutdown(_THIS)
    1.58 +{
    1.59 +    if (!_this->gl_data || (--_this->gl_data->initialized > 0)) {
    1.60 +        return;
    1.61 +    }
    1.62 +
    1.63 +    Cocoa_GL_UnloadLibrary(_this);
    1.64 +
    1.65 +    SDL_free(_this->gl_data);
    1.66 +    _this->gl_data = NULL;
    1.67 +}
    1.68 +
    1.69  int
    1.70  Cocoa_GL_SetupWindow(_THIS, SDL_Window * window)
    1.71  {
    1.72 @@ -352,6 +355,6 @@
    1.73      [pool release];
    1.74  }
    1.75  
    1.76 -#endif /* SDL_VIDEO_OPENGL */
    1.77 +#endif /* SDL_VIDEO_OPENGL_CGL */
    1.78  
    1.79  /* vi: set ts=4 sw=4 expandtab: */