src/video/win32/SDL_win32opengl.c
changeset 1952 420716272158
parent 1936 83946ee0ff1f
child 2150 abbe2c1dcf0a
     1.1 --- a/src/video/win32/SDL_win32opengl.c	Thu Jul 27 06:53:23 2006 +0000
     1.2 +++ b/src/video/win32/SDL_win32opengl.c	Fri Jul 28 08:43:17 2006 +0000
     1.3 @@ -25,10 +25,10 @@
     1.4  
     1.5  /* WGL implementation of SDL OpenGL support */
     1.6  
     1.7 -#if SDL_VIDEO_OPENGL
     1.8 +#if SDL_VIDEO_OPENGL_WGL
     1.9  #include "SDL_opengl.h"
    1.10  
    1.11 -#define DEFAULT_OPENGL_PATH "OPENGL32.DLL"
    1.12 +#define DEFAULT_OPENGL "OPENGL32.DLL"
    1.13  
    1.14  
    1.15  int
    1.16 @@ -47,7 +47,10 @@
    1.17          }
    1.18      }
    1.19      if (path == NULL) {
    1.20 -        path = DEFAULT_OPENGL_PATH;
    1.21 +        path = SDL_getenv("SDL_OPENGL_LIBRARY");
    1.22 +    }
    1.23 +    if (path == NULL) {
    1.24 +        path = DEFAULT_OPENGL;
    1.25      }
    1.26      wpath = WIN_UTF8ToString(path);
    1.27      handle = LoadLibrary(wpath);
    1.28 @@ -257,19 +260,6 @@
    1.29      WIN_PumpEvents(_this);
    1.30  }
    1.31  
    1.32 -static void
    1.33 -WIN_GL_Shutdown(_THIS)
    1.34 -{
    1.35 -    if (!_this->gl_data || (--_this->gl_data->initialized > 0)) {
    1.36 -        return;
    1.37 -    }
    1.38 -
    1.39 -    WIN_GL_UnloadLibrary(_this);
    1.40 -
    1.41 -    SDL_free(_this->gl_data);
    1.42 -    _this->gl_data = NULL;
    1.43 -}
    1.44 -
    1.45  static int
    1.46  WIN_GL_Initialize(_THIS)
    1.47  {
    1.48 @@ -298,6 +288,19 @@
    1.49      return 0;
    1.50  }
    1.51  
    1.52 +static void
    1.53 +WIN_GL_Shutdown(_THIS)
    1.54 +{
    1.55 +    if (!_this->gl_data || (--_this->gl_data->initialized > 0)) {
    1.56 +        return;
    1.57 +    }
    1.58 +
    1.59 +    WIN_GL_UnloadLibrary(_this);
    1.60 +
    1.61 +    SDL_free(_this->gl_data);
    1.62 +    _this->gl_data = NULL;
    1.63 +}
    1.64 +
    1.65  int
    1.66  WIN_GL_SetupWindow(_THIS, SDL_Window * window)
    1.67  {
    1.68 @@ -479,7 +482,6 @@
    1.69      _this->gl_data->wglDeleteContext((HGLRC) context);
    1.70  }
    1.71  
    1.72 -#endif /* SDL_VIDEO_OPENGL */
    1.73 -
    1.74 +#endif /* SDL_VIDEO_OPENGL_WGL */
    1.75  
    1.76  /* vi: set ts=4 sw=4 expandtab: */