diff --git a/auto/src/glew_head.c b/auto/src/glew_head.c index f233a2e..19afd93 100644 --- a/auto/src/glew_head.c +++ b/auto/src/glew_head.c @@ -35,9 +35,26 @@ #endif /* GLEW_MX */ #if defined(__APPLE__) -#include #include #include +#include + +#ifdef MAC_OS_X_VERSION_10_3 + +#include + +void* NSGLGetProcAddress (const GLubyte *name) +{ + static void* image = NULL; + if (NULL == image) + { + image = dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", RTLD_LAZY); + } + return image ? dlsym(image, (const char*)name) : NULL; +} +#else + +#include void* NSGLGetProcAddress (const GLubyte *name) { @@ -59,6 +76,7 @@ void* NSGLGetProcAddress (const GLubyte *name) free(symbolName); return symbol ? NSAddressOfSymbol(symbol) : NULL; } +#endif /* MAC_OS_X_VERSION_10_3 */ #endif /* __APPLE__ */ #if defined(__sgi) || defined (__sun) diff --git a/auto/src/glew_head.h b/auto/src/glew_head.h index fe1aafe..bfa7c9e 100644 --- a/auto/src/glew_head.h +++ b/auto/src/glew_head.h @@ -28,7 +28,7 @@ /* */ #ifndef APIENTRY #define GLEW_APIENTRY_DEFINED -# if defined(__MINGW32__) +# if defined(__MINGW32__) || defined(__CYGWIN__) # define APIENTRY __stdcall # elif (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) # define APIENTRY __stdcall @@ -37,14 +37,14 @@ # endif #endif #ifndef GLAPI -# if defined(__MINGW32__) +# if defined(__MINGW32__) || defined(__CYGWIN__) # define GLAPI extern # endif #endif /* */ #ifndef CALLBACK #define GLEW_CALLBACK_DEFINED -# if defined(__MINGW32__) +# if defined(__MINGW32__) || defined(__CYGWIN__) # define CALLBACK __attribute__ ((__stdcall__)) # elif (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) # define CALLBACK __stdcall @@ -81,7 +81,7 @@ typedef _W64 int ptrdiff_t; #endif #ifndef GLAPI -# if defined(__MINGW32__) +# if defined(__MINGW32__) || defined(__CYGWIN__) # define GLAPI extern # else # define GLAPI WINGDIAPI @@ -168,7 +168,7 @@ typedef signed long long GLint64EXT; typedef unsigned long long GLuint64EXT; # endif #else -# if defined(__MINGW32__) +# if defined(__MINGW32__) || defined(__CYGWIN__) #include # endif typedef int64_t GLint64EXT; diff --git a/auto/src/glew_init_glx.c b/auto/src/glew_init_glx.c index 369b4ad..c66e24c 100644 --- a/auto/src/glew_init_glx.c +++ b/auto/src/glew_init_glx.c @@ -4,10 +4,10 @@ GLboolean glxewGetExtension (const char* name) { GLubyte* p; GLubyte* end; - GLuint len = _glewStrLen((const GLubyte*)name); -/* if (glXQueryExtensionsString == NULL || glXGetCurrentDisplay == NULL) return GL_FALSE; */ -/* p = (GLubyte*)glXQueryExtensionsString(glXGetCurrentDisplay(), DefaultScreen(glXGetCurrentDisplay())); */ - if (glXGetClientString == NULL || glXGetCurrentDisplay == NULL) return GL_FALSE; + GLuint len; + + if (glXGetCurrentDisplay == NULL) return GL_FALSE; + len = _glewStrLen((const GLubyte*)name); p = (GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS); if (0 == p) return GL_FALSE; end = p + _glewStrLen(p); diff --git a/auto/src/glewinfo_tail.c b/auto/src/glewinfo_tail.c index 55d4493..3b417ea 100644 --- a/auto/src/glewinfo_tail.c +++ b/auto/src/glewinfo_tail.c @@ -199,7 +199,7 @@ GLboolean glewCreateContext () aglDestroyPixelFormat(pf); /*aglSetDrawable(ctx, GetWindowPort(wnd));*/ octx = aglGetCurrentContext(); - if (NULL == aglSetCurrentContext(ctx)) return GL_TRUE; + if (GL_FALSE == aglSetCurrentContext(ctx)) return GL_TRUE; return GL_FALSE; } diff --git a/auto/src/wglew_head.h b/auto/src/wglew_head.h index 46ab3fa..f56c4b8 100644 --- a/auto/src/wglew_head.h +++ b/auto/src/wglew_head.h @@ -8,7 +8,7 @@ #define __wglext_h_ -#if !defined(APIENTRY) && !defined(__CYGWIN__) +#if !defined(APIENTRY) # ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN 1 # endif diff --git a/src/visualinfo.c b/src/visualinfo.c index 384313d..f3ae91f 100644 --- a/src/visualinfo.c +++ b/src/visualinfo.c @@ -1056,7 +1056,7 @@ GLboolean CreateContext (GLContext* ctx) aglDestroyPixelFormat(pf); /*aglSetDrawable(ctx, GetWindowPort(wnd));*/ ctx->octx = aglGetCurrentContext(); - if (NULL == aglSetCurrentContext(ctx->ctx)) return GL_TRUE; + if (GL_FALSE == aglSetCurrentContext(ctx->ctx)) return GL_TRUE; return GL_FALSE; }