diff options
Diffstat (limited to 'CNativeCode/gltool.c')
-rwxr-xr-x | CNativeCode/gltool.c | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/CNativeCode/gltool.c b/CNativeCode/gltool.c index 9854180..5676290 100755 --- a/CNativeCode/gltool.c +++ b/CNativeCode/gltool.c @@ -27,10 +27,10 @@ #ifdef _X11_ #include "glxtool.h" #endif -
-#ifdef _WIN32_
- #include "wgltool.h"
-#endif
+ +#ifdef _WIN32_ + #include "wgltool.h" +#endif static int _glLibsLoaded = 0; @@ -84,8 +84,8 @@ void LIBAPIENTRY check_wgl_error (HWND wnd, const char *file, int line) #endif void LIBAPIENTRY check_gl_error (const char *file, int line) -{
- print_gl_error("GLCHECK", file, line, disp__glGetError());
+{ + print_gl_error("GLCHECK", file, line, disp__glGetError()); } void LIBAPIENTRY __sglBegin(const char * file, int line, GLenum mode) @@ -304,7 +304,7 @@ void * LIBAPIENTRY getGLProcAddressHelper if(!loadGLLibrary (libGLName, libGLUName)) return NULL; -
+ if (disp__wglGetProcAddress == NULL && __firstAccess) { disp__wglGetProcAddress = ( PROC (CALLBACK *)(LPCSTR) ) @@ -523,21 +523,22 @@ void * LIBAPIENTRY getGLProcAddressHelper void LIBAPIENTRY fetch_GL_FUNCS (const char * libGLName, - const char * libGLUName, int force) + const char * libGLUName, int force, int reload) { static int _firstRun = 1; - if(force) - { - unloadGLLibrary(); - _firstRun = 1; - } + if (!reload) { + if(force) { + unloadGLLibrary(); + _firstRun = 1; + } - if(!_firstRun) - return; + if(!_firstRun) + return; - if(!loadGLLibrary (libGLName, libGLUName)) - return; + if(!loadGLLibrary (libGLName, libGLUName)) + return; + } #define GET_GL_PROCADDRESS(a) getGLProcAddressHelper (libGLName, libGLUName, (a), NULL, 0, 0); @@ -547,12 +548,12 @@ void LIBAPIENTRY fetch_GL_FUNCS (const char * libGLName, _firstRun=0; #ifdef _X11_ - fetch_GLX_FUNCS (libGLName, libGLUName, force); -#endif
-
-#ifdef _WIN32_
- fetch_WGL_FUNCS (libGLName, libGLUName, force);
-#endif
+ fetch_GLX_FUNCS (libGLName, libGLUName, force, reload); +#endif + +#ifdef _WIN32_ + fetch_WGL_FUNCS (libGLName, libGLUName, force, reload); +#endif } |