From 7214d0be63012e5e48e078460296aae39314de15 Mon Sep 17 00:00:00 2001 From: ikits Date: Thu, 19 Feb 2004 07:49:16 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: https://glew.svn.sourceforge.net/svnroot/glew/trunk/glew@233 783a27ee-832a-0410-bc00-9f386506c6dd --- auto/bin/make_init.pl | 2 +- auto/bin/make_list.pl | 4 ++-- auto/src/glew_gl.c | 2 +- auto/src/glew_glx.c | 2 +- auto/src/glew_post.c | 6 +++--- auto/src/glew_pre.c | 11 ++++++++--- auto/src/glew_pre.h | 2 +- auto/src/glew_wgl.c | 2 +- auto/src/glewinfo_post.c | 1 + 9 files changed, 19 insertions(+), 13 deletions(-) diff --git a/auto/bin/make_init.pl b/auto/bin/make_init.pl index 62720ed..fc00fff 100755 --- a/auto/bin/make_init.pl +++ b/auto/bin/make_init.pl @@ -49,7 +49,7 @@ foreach my $ext (sort @extlist) if (keys %$functions) { print "static GLboolean _glewInit_$extname (" . $type . - "EWContext* ctx)\n{\n GLboolean r = GL_FALSE;\n"; + "EW_CONTEXT_ARG_DEF)\n{\n GLboolean r = GL_FALSE;\n"; output_decls($functions, \&make_pfn_def_init); print "\n return r;\n}\n"; } diff --git a/auto/bin/make_list.pl b/auto/bin/make_list.pl index b2542e3..1cfc589 100755 --- a/auto/bin/make_list.pl +++ b/auto/bin/make_list.pl @@ -52,11 +52,11 @@ foreach my $ext (sort @extlist) { if ($extname =~ /WGL_.*/) { - print " if (glewExperimental || " . $extvar . "|| crippled) " . $extvar . "= !_glewInit_$extname(ctx);\n"; + print " if (glewExperimental || " . $extvar . "|| crippled) " . $extvar . "= !_glewInit_$extname(GLEW_CONTEXT_ARG_VAR);\n"; } else { - print " if (glewExperimental || " . $extvar . ") " . $extvar . " = !_glewInit_$extname(ctx);\n"; + print " if (glewExperimental || " . $extvar . ") " . $extvar . " = !_glewInit_$extname(GLEW_CONTEXT_ARG_VAR);\n"; } } print "#endif /* $extname */\n"; diff --git a/auto/src/glew_gl.c b/auto/src/glew_gl.c index 7952977..90fe723 100644 --- a/auto/src/glew_gl.c +++ b/auto/src/glew_gl.c @@ -54,7 +54,7 @@ GLboolean glewGetExtension (const char* name) #ifndef GLEW_MX static #endif -GLenum glewContextInit (GLEWContext* ctx) +GLenum glewContextInit (GLEW_CONTEXT_ARG_DEF) { const GLubyte* s; GLuint i; diff --git a/auto/src/glew_glx.c b/auto/src/glew_glx.c index a73fb4b..8e02a24 100644 --- a/auto/src/glew_glx.c +++ b/auto/src/glew_glx.c @@ -24,7 +24,7 @@ GLboolean glxewGetExtension (const char* name) #ifndef GLEW_MX static #endif -GLenum glxewContextInit (GLXEWContext* ctx) +GLenum glxewContextInit (GLXEW_CONTEXT_ARG_DEF) { int major, minor; /* initialize core GLX 1.2 */ diff --git a/auto/src/glew_post.c b/auto/src/glew_post.c index d4aa7f9..d819194 100644 --- a/auto/src/glew_post.c +++ b/auto/src/glew_post.c @@ -39,11 +39,11 @@ GLboolean glewExperimental = GL_FALSE; GLenum glewInit () { GLenum r; - if ( (r = glewContextInit(0)) ) return r; + if ( (r = glewContextInit()) ) return r; #if defined(_WIN32) - return wglewContextInit(0); + return wglewContextInit(); #elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) /* _UNIX */ - return glxewContextInit(0); + return glxewContextInit(); #else return r; #endif /* _WIN32 */ diff --git a/auto/src/glew_pre.c b/auto/src/glew_pre.c index e481a56..4a1788d 100644 --- a/auto/src/glew_pre.c +++ b/auto/src/glew_pre.c @@ -96,10 +96,15 @@ static void *dlGetProcAddress (const GLubyte* name) #ifdef GLEW_MX #define glewGetContext() ctx +#define GLEW_CONTEXT_ARG_DEF GLEWContext* ctx +#define WGLEW_CONTEXT_ARG_DEF WGLEWContext* ctx +#define GLXEW_CONTEXT_ARG_DEF GLXEWContext* ctx +#define GLEW_CONTEXT_ARG_VAR ctx #else -#define GLEWContext void -#define WGLEWContext void -#define GLXEWContext void +#define GLEW_CONTEXT_ARG_DEF void +#define WGLEW_CONTEXT_ARG_DEF void +#define GLXEW_CONTEXT_ARG_DEF void +#define GLEW_CONTEXT_ARG_VAR #endif #if !defined(_WIN32) || !defined(GLEW_MX) diff --git a/auto/src/glew_pre.h b/auto/src/glew_pre.h index 081ced2..1fb842e 100644 --- a/auto/src/glew_pre.h +++ b/auto/src/glew_pre.h @@ -118,7 +118,7 @@ #define WINGDIAPI __declspec(dllimport) #endif /* */ -#if !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(_WCHAR_T_DEFINED) +#if !defined(__CYGWIN__) && !defined(_WCHAR_T_DEFINED) # ifndef _WCHAR_T_DEFINED typedef unsigned short wchar_t; # define _WCHAR_T_DEFINED diff --git a/auto/src/glew_wgl.c b/auto/src/glew_wgl.c index 54af134..586e0a0 100644 --- a/auto/src/glew_wgl.c +++ b/auto/src/glew_wgl.c @@ -34,7 +34,7 @@ GLboolean wglewGetExtension (const char* name) #ifndef GLEW_MX static #endif -GLenum wglewContextInit (WGLEWContext* ctx) +GLenum wglewContextInit (WGLEW_CONTEXT_ARG_DEF) { GLboolean crippled; /* find wgl extension string query functions */ diff --git a/auto/src/glewinfo_post.c b/auto/src/glewinfo_post.c index 8d32a02..696597a 100644 --- a/auto/src/glewinfo_post.c +++ b/auto/src/glewinfo_post.c @@ -89,6 +89,7 @@ GLboolean glewParseArgs (int argc, char** argv, char** display, int* visual) if (!strcmp(argv[p], "-pf") || !strcmp(argv[p], "-pixelformat")) { if (++p >= argc) return GL_TRUE; + *display = 0; *visual = strtol(argv[p++], NULL, 0); } else