fixed GLEW_MX bugs

git-svn-id: https://glew.svn.sourceforge.net/svnroot/glew/trunk/glew@262 783a27ee-832a-0410-bc00-9f386506c6dd
This commit is contained in:
ikits 2004-05-09 09:26:51 +00:00
parent 6ddeb41df3
commit ef12b6f7a2
3 changed files with 19 additions and 7 deletions

View File

@ -8,9 +8,9 @@
perl -e 's/#ifndef GLX_OML_sync_control/#if !defined(GLX_OML_sync_control) \&\& defined(__STDC_VERSION__) \&\& (__STDC_VERSION__ >= 199901L)\n#include <inttypes.h>/;' -pi $1
perl -e 's/#ifdef GLX_OML_sync_control/#if defined(GLX_OML_sync_control) \&\& defined(__STDC_VERSION__) \&\& (__STDC_VERSION__ >= 199901L)\n#include <inttypes.h>/;' -pi $1
perl -e 's/(GLXEW_EXPORT PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML;)/#ifdef GLX_OML_sync_control\n\1/' -pi $1
perl -e 's/(GLXEW_EXPORT PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML;)/\1\n#endif/' -pi $1
perl -e 's/(GLXEW_EXPORT GLboolean __GLXEW_OML_sync_control;)/#ifdef GLX_OML_sync_control\n\1\n#endif/' -pi $1
perl -e 's/(extern PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML;)/#ifdef GLX_OML_sync_control\n\1/' -pi $1
perl -e 's/(extern PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML;)/\1\n#endif/' -pi $1
perl -e 's/(extern GLboolean __GLXEW_OML_sync_control;)/#ifdef GLX_OML_sync_control\n\1\n#endif/' -pi $1
perl -e 's/(PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML = NULL;)/#ifdef GLX_OML_sync_control\n\1/' -pi $1
perl -e 's/(PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML = NULL;)/\1\n#endif/' -pi $1
perl -e 's/(GLboolean __GLXEW_OML_sync_control = GL_FALSE;)/#ifdef GLX_OML_sync_control\n\1\n#endif/' -pi $1

View File

@ -41,7 +41,13 @@ int main (void)
}
glewExperimental = GL_TRUE;
#ifdef GLEW_MX
err = glewContextInit(ctx);
err = glewContextInit(glewGetContext());
#ifdef _WIN32
err = err || wglewContextInit(wglewGetContext());
#else
err = err || glxewContextInit(glxewGetContext());
#endif
#else
err = glewInit();
#endif

View File

@ -42,9 +42,15 @@
static FILE* f;
#ifdef GLEW_MX
GLEWContext _ctx;
GLEWContext* ctx = &_ctx;
#define glewGetContext() ctx
GLEWContext _glewctx;
#define glewGetContext() (&_glewctx)
#ifdef _WIN32
WGLEWContext _wglewctx;
#define wglewGetContext() (&_wglewctx)
#else
GLXEWContext _glxewctx;
#define glxewGetContext() (&_glxewctx)
#endif
#endif
#if defined(_WIN32)