From 6e35a3c7a5d650ff85af849f8fa3abc456453ea6 Mon Sep 17 00:00:00 2001 From: ikits Date: Wed, 29 Dec 2004 07:24:49 +0000 Subject: [PATCH] fixed problems with mx builds; update project files git-svn-id: https://glew.svn.sourceforge.net/svnroot/glew/trunk/glew@320 783a27ee-832a-0410-bc00-9f386506c6dd --- auto/Makefile | 20 ++++++++----- auto/bin/{make_def.pl => make_def_fun.pl} | 10 ------- auto/bin/make_def_var.pl | 34 +++++++++++++++++++++++ auto/src/glew_gl_fun.c | 6 ++++ auto/src/glew_gl_head.c | 2 -- auto/src/glew_gl_tail.c | 5 ---- auto/src/glew_gl_var.c | 5 ++++ auto/src/glew_glx_fun.c | 5 ++++ auto/src/glew_glx_head.c | 4 +-- auto/src/glew_glx_init.c | 3 -- auto/src/glew_glx_tail.c | 2 ++ auto/src/glew_glx_var.c | 5 ++++ auto/src/glew_str_glx.c | 14 +++++++++- auto/src/glew_str_tail.c | 3 +- auto/src/glew_str_wgl.c | 14 +++++++++- auto/src/glew_wgl_var.c | 5 ++++ auto/src/glxew_tail.h | 6 ++++ auto/src/wglew_tail.h | 6 ++++ build/vc6/Makefile | 8 ++++++ build/vc6/glew_shared.dsp | 18 +++++++++++- build/vc6/glew_static.dsp | 18 +++++++++++- 21 files changed, 158 insertions(+), 35 deletions(-) rename auto/bin/{make_def.pl => make_def_fun.pl} (76%) create mode 100755 auto/bin/make_def_var.pl create mode 100644 auto/src/glew_gl_fun.c create mode 100644 auto/src/glew_gl_var.c create mode 100644 auto/src/glew_glx_fun.c create mode 100644 auto/src/glew_glx_var.c create mode 100644 auto/src/glew_wgl_var.c diff --git a/auto/Makefile b/auto/Makefile index 9d982b3..22ff2fa 100644 --- a/auto/Makefile +++ b/auto/Makefile @@ -95,14 +95,18 @@ $(I.DEST)/glxew.h: $(EXT)/.dummy $(S.DEST)/glew_gl.c: $(EXT)/.dummy cp -f $(SRC)/glew_gl_head.c $@ - $(BIN)/make_def.pl GL $(CORE)/GL_VERSION* $(EXT)/GL_* >> $@ + $(BIN)/make_def_fun.pl GL $(CORE)/GL_VERSION* >> $@ + $(BIN)/make_def_fun.pl GL $(EXT)/GL_* >> $@ + cat $(SRC)/glew_gl_fun.c >> $@ + $(BIN)/make_def_var.pl GL $(CORE)/GL_VERSION* >> $@ + $(BIN)/make_def_var.pl GL $(EXT)/GL_* >> $@ + cat $(SRC)/glew_gl_var.c >> $@ $(BIN)/make_init.pl GL $(CORE)/GL_VERSION* >> $@ $(BIN)/make_init.pl GL $(EXT)/GL_* >> $@ cat $(SRC)/glew_gl_init.c >> $@ $(BIN)/make_list.pl $(CORE)/GL_VERSION* | grep -v '\"GL_VERSION' >> $@ $(BIN)/make_list.pl $(EXT)/GL_* >> $@ cat $(SRC)/glew_gl_tail.c >> $@ -# $(BIN)/fix_OML_sync_control.sh $@ perl -e "s/GLEW_VERSION_STRING/$(GLEW_MAJOR)\.$(GLEW_MINOR)\.$(GLEW_MICRO)/g" -pi $@ perl -e "s/GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader\(GLEW_CONTEXT_ARG_VAR_INIT\);/{ GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); _glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); }/g" -pi $@ rm -f $@.bak @@ -110,19 +114,21 @@ $(S.DEST)/glew_gl.c: $(EXT)/.dummy $(S.DEST)/glew_wgl.c: $(EXT)/.dummy cp -f $(SRC)/glew_wgl_head.c $@ $(BIN)/make_def.pl WGL $(EXT)/WGL_* >> $@ - echo -e "\n#endif /* !GLEW_MX */\n" >> $@ + cat $(SRC)/glew_wgl_def.c >> $@ $(BIN)/make_init.pl WGL $(EXT)/WGL_* >> $@ cat $(SRC)/glew_wgl_init.c >> $@ $(BIN)/make_list.pl $(EXT)/WGL_* >> $@ cat $(SRC)/glew_wgl_tail.c >> $@ - $(BIN)/fix_OML_sync_control.sh $@ rm -f $@.bak $(S.DEST)/glew_glx.c: $(EXT)/.dummy cp -f $(SRC)/glew_glx_head.c $@ - echo -e "#if !defined(__APPLE__) || defined(GLEW_APPLE_GLX)" >> $@ - $(BIN)/make_def.pl GLX $(CORE)/GLX_VERSION* $(EXT)/GLX_* >> $@ - echo -e "\n#endif /* !__APPLE__ */\n" >> $@ + $(BIN)/make_def_fun.pl GLX $(CORE)/GLX_VERSION* >> $@ + $(BIN)/make_def_fun.pl GLX $(EXT)/GLX_* >> $@ + cat $(SRC)/glew_glx_fun.c >> $@ + $(BIN)/make_def_var.pl GLX $(CORE)/GLX_VERSION* >> $@ + $(BIN)/make_def_var.pl GLX $(EXT)/GLX_* >> $@ + cat $(SRC)/glew_glx_var.c >> $@ $(BIN)/make_init.pl GLX $(CORE)/GLX_VERSION* >> $@ $(BIN)/make_init.pl GLX $(EXT)/GLX_* >> $@ cat $(SRC)/glew_glx_init.c >> $@ diff --git a/auto/bin/make_def.pl b/auto/bin/make_def_fun.pl similarity index 76% rename from auto/bin/make_def.pl rename to auto/bin/make_def_fun.pl index 40270ca..8f3a3b3 100755 --- a/auto/bin/make_def.pl +++ b/auto/bin/make_def_fun.pl @@ -36,13 +36,3 @@ foreach my $ext (sort @extlist) my ($extname, $exturl, $types, $tokens, $functions, $exacts) = parse_ext($ext); output_decls($functions, \&make_pfn_decl); } - -print "\n"; - -foreach my $ext (sort @extlist) -{ - my ($extname, $exturl, $types, $tokens, $functions, $exacts) = parse_ext($ext); - my $extvar = $extname; - $extvar =~ s/GL(X*)_/GL$1EW_/; - print "GLboolean " . prefix_varname($extvar) . " = GL_FALSE;\n"; -} diff --git a/auto/bin/make_def_var.pl b/auto/bin/make_def_var.pl new file mode 100755 index 0000000..678220e --- /dev/null +++ b/auto/bin/make_def_var.pl @@ -0,0 +1,34 @@ +#!/usr/bin/perl +## +## Copyright (C) 2004, 2003 Marcelo E. Magallon +## Copyright (C) 2004, 2003 Milan Ikits +## +## This program is distributed under the terms and conditions of the GNU +## General Public License Version 2 as published by the Free Software +## Foundation or, at your option, any later version. + +use strict; +use warnings; + +do 'bin/make.pl'; + +my @extlist = (); +my %extensions = (); + +our $type = shift; + +if (@ARGV) +{ + @extlist = @ARGV; +} else { + local $/; + @extlist = split "\n", (<>); +} + +foreach my $ext (sort @extlist) +{ + my ($extname, $exturl, $types, $tokens, $functions, $exacts) = parse_ext($ext); + my $extvar = $extname; + $extvar =~ s/GL(X*)_/GL$1EW_/; + print "GLboolean " . prefix_varname($extvar) . " = GL_FALSE;\n"; +} diff --git a/auto/src/glew_gl_fun.c b/auto/src/glew_gl_fun.c new file mode 100644 index 0000000..2fbdc77 --- /dev/null +++ b/auto/src/glew_gl_fun.c @@ -0,0 +1,6 @@ + +#endif /* !WIN32 || !GLEW_MX */ + +#if !defined(GLEW_MX) + +GLboolean __GLEW_VERSION_1_1 = GL_FALSE; diff --git a/auto/src/glew_gl_head.c b/auto/src/glew_gl_head.c index f99abf3..e2756ff 100644 --- a/auto/src/glew_gl_head.c +++ b/auto/src/glew_gl_head.c @@ -32,5 +32,3 @@ #include "glew_utils.h" #if !defined(_WIN32) || !defined(GLEW_MX) - -GLboolean __GLEW_VERSION_1_1 = GL_FALSE; diff --git a/auto/src/glew_gl_tail.c b/auto/src/glew_gl_tail.c index b912470..865dcd5 100644 --- a/auto/src/glew_gl_tail.c +++ b/auto/src/glew_gl_tail.c @@ -1,8 +1,6 @@ return GLEW_OK; } -#endif /* _WIN32 */ - /* ------------------------------------------------------------------------ */ const GLubyte* glewGetErrorString (GLenum error) @@ -55,8 +53,5 @@ GLenum glewInit () #endif /* _WIN32 */ } -#else - - #endif diff --git a/auto/src/glew_gl_var.c b/auto/src/glew_gl_var.c new file mode 100644 index 0000000..b6ae68d --- /dev/null +++ b/auto/src/glew_gl_var.c @@ -0,0 +1,5 @@ + +#endif /* !GLEW_MX */ + +/* ------------------------------------------------------------------------- */ + diff --git a/auto/src/glew_glx_fun.c b/auto/src/glew_glx_fun.c new file mode 100644 index 0000000..1b880e2 --- /dev/null +++ b/auto/src/glew_glx_fun.c @@ -0,0 +1,5 @@ + +#if !defined(GLEW_MX) + +GLboolean __GLXEW_VERSION_1_0 = GL_FALSE; +GLboolean __GLXEW_VERSION_1_1 = GL_FALSE; diff --git a/auto/src/glew_glx_head.c b/auto/src/glew_glx_head.c index 297f6dd..9aeed61 100644 --- a/auto/src/glew_glx_head.c +++ b/auto/src/glew_glx_head.c @@ -31,6 +31,4 @@ #include "glew_utils.h" -GLboolean __GLXEW_VERSION_1_0 = GL_FALSE; -GLboolean __GLXEW_VERSION_1_1 = GL_FALSE; - +#if !defined(__APPLE__) || defined(GLEW_APPLE_GLX) diff --git a/auto/src/glew_glx_init.c b/auto/src/glew_glx_init.c index e62445a..5f527dd 100644 --- a/auto/src/glew_glx_init.c +++ b/auto/src/glew_glx_init.c @@ -1,6 +1,3 @@ - -#if !defined(__APPLE__) || defined(GLEW_APPLE_GLX) /* _UNIX */ - GLboolean glxewGetExtension (const char* name) { GLubyte* p; diff --git a/auto/src/glew_glx_tail.c b/auto/src/glew_glx_tail.c index a6c603a..5838920 100644 --- a/auto/src/glew_glx_tail.c +++ b/auto/src/glew_glx_tail.c @@ -1,2 +1,4 @@ return GLEW_OK; } + +#endif /* !__APPLE__ || GLEW_APPLE_GLX */ diff --git a/auto/src/glew_glx_var.c b/auto/src/glew_glx_var.c new file mode 100644 index 0000000..b6ae68d --- /dev/null +++ b/auto/src/glew_glx_var.c @@ -0,0 +1,5 @@ + +#endif /* !GLEW_MX */ + +/* ------------------------------------------------------------------------- */ + diff --git a/auto/src/glew_str_glx.c b/auto/src/glew_str_glx.c index bce2321..0ba4d48 100644 --- a/auto/src/glew_str_glx.c +++ b/auto/src/glew_str_glx.c @@ -1,4 +1,16 @@ } + return GL_FALSE; +} + #elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) - else if(_glewStrSame2(&pos, &len, (const GLubyte*)"GLX_", 4)) + +#if defined(GLEW_MX) +GLboolean glxewContextIsSupported (GLXEWContext* ctx, const char* name) +#else +GLboolean glxewIsSupported (const char* name) +#endif +{ + GLubyte* pos = (GLubyte*)name; + GLuint len = _glewStrLen(pos); + if(_glewStrSame2(&pos, &len, (const GLubyte*)"GLX_", 4)) { diff --git a/auto/src/glew_str_tail.c b/auto/src/glew_str_tail.c index fa7c366..3ae4429 100644 --- a/auto/src/glew_str_tail.c +++ b/auto/src/glew_str_tail.c @@ -1,4 +1,5 @@ } -#endif /* */ return GL_FALSE; } + +#endif /* _WIN32 */ diff --git a/auto/src/glew_str_wgl.c b/auto/src/glew_str_wgl.c index 581674f..bdee238 100644 --- a/auto/src/glew_str_wgl.c +++ b/auto/src/glew_str_wgl.c @@ -1,4 +1,16 @@ } + return GL_FALSE; +} + #if defined(_WIN32) - else if(_glewStrSame2(&pos, &len, (const GLubyte*)"WGL_", 4)) + +#if defined(GLEW_MX) +GLboolean wglewContextIsSupported (WGLEWContext* ctx, const char* name) +#else +GLboolean wglewIsSupported (const char* name) +#endif +{ + GLubyte* pos = (GLubyte*)name; + GLuint len = _glewStrLen(pos); + if(_glewStrSame2(&pos, &len, (const GLubyte*)"WGL_", 4)) { diff --git a/auto/src/glew_wgl_var.c b/auto/src/glew_wgl_var.c new file mode 100644 index 0000000..b6ae68d --- /dev/null +++ b/auto/src/glew_wgl_var.c @@ -0,0 +1,5 @@ + +#endif /* !GLEW_MX */ + +/* ------------------------------------------------------------------------- */ + diff --git a/auto/src/glxew_tail.h b/auto/src/glxew_tail.h index b66bf82..ed3be17 100644 --- a/auto/src/glxew_tail.h +++ b/auto/src/glxew_tail.h @@ -4,6 +4,10 @@ typedef struct GLXEWContextStruct GLXEWContext; extern GLenum glxewContextInit (GLXEWContext* ctx); +extern GLboolean glxewContextIsSupported (GLXEWContext* ctx, const char* name); + +#define glxewInit() glxewContextInit(glxewGetContext()) +#define glxewIsSupported(x) glxewContextIsSupported(glxewGetContext(), x) #define GLXEW_GET_VAR(x) glxewGetContext()->x #define GLXEW_GET_FUN(x) x @@ -13,6 +17,8 @@ extern GLenum glxewContextInit (GLXEWContext* ctx); #define GLXEW_GET_VAR(x) x #define GLXEW_GET_FUN(x) x +extern GLboolean glxewIsSupported (const char* name); + #endif /* GLEW_MX */ extern GLboolean glxewGetExtension (const char* name); diff --git a/auto/src/wglew_tail.h b/auto/src/wglew_tail.h index 7e63a90..2addbcf 100644 --- a/auto/src/wglew_tail.h +++ b/auto/src/wglew_tail.h @@ -4,6 +4,10 @@ typedef struct WGLEWContextStruct WGLEWContext; GLEWAPI GLenum wglewContextInit (WGLEWContext* ctx); +GLEWAPI GLboolean wglewContextIsSupported (WGLEWContext* ctx, const char* name); + +#define wglewInit() wglewContextInit(wglewGetContext()) +#define wglewIsSupported(x) wglewContextIsSupported(wglewGetContext(), x) #define WGLEW_GET_VAR(x) wglewGetContext()->x #define WGLEW_GET_FUN(x) wglewGetContext()->x @@ -13,6 +17,8 @@ GLEWAPI GLenum wglewContextInit (WGLEWContext* ctx); #define WGLEW_GET_VAR(x) x #define WGLEW_GET_FUN(x) x +GLEWAPI GLboolean wglewIsSupported (const char* name); + #endif /* GLEW_MX */ GLEWAPI GLboolean wglewGetExtension (const char* name); diff --git a/build/vc6/Makefile b/build/vc6/Makefile index 326a1e6..9f0ab41 100644 --- a/build/vc6/Makefile +++ b/build/vc6/Makefile @@ -8,6 +8,13 @@ default: "glewinfo - Win32 Release" \ "visualinfo - Win32 Release" /build +mx: + $(MSDEV) glew.dsw /make \ + "glew_static - Win32 Release MX" \ + "glew_shared - Win32 Release MX" \ + "glewinfo - Win32 Release MX" \ + "visualinfo - Win32 Release MX" /build + debug: $(MSDEV) glew.dsw /make \ "glew_static - Win32 Debug" \ @@ -15,6 +22,7 @@ debug: "glewinfo - Win32 Debug" \ "visualinfo - Win32 Debug" /build + clean: $(MSDEV) glew.dsw /make all /clean $(RM) static shared *.plg *.ncb *.opt diff --git a/build/vc6/glew_shared.dsp b/build/vc6/glew_shared.dsp index 6c0d64d..d6928e1 100644 --- a/build/vc6/glew_shared.dsp +++ b/build/vc6/glew_shared.dsp @@ -153,7 +153,19 @@ LINK32=link.exe # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File -SOURCE=..\..\src\glew.c +SOURCE=..\..\src\glew_gl.c +# End Source File +# Begin Source File + +SOURCE=..\..\src\glew_wgl.c +# End Source File +# Begin Source File + +SOURCE=..\..\src\glew_str.c +# End Source File +# Begin Source File + +SOURCE=..\..\src\glew_utils.c # End Source File # End Group # Begin Group "Header Files" @@ -167,6 +179,10 @@ SOURCE=..\..\include\GL\glew.h SOURCE=..\..\include\GL\wglew.h # End Source File +# Begin Source File + +SOURCE=..\..\src\glew_utils.h +# End Source File # End Group # End Target # End Project diff --git a/build/vc6/glew_static.dsp b/build/vc6/glew_static.dsp index 82c7cec..0de0d28 100644 --- a/build/vc6/glew_static.dsp +++ b/build/vc6/glew_static.dsp @@ -135,7 +135,19 @@ LIB32=link.exe -lib # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File -SOURCE=..\..\src\glew.c +SOURCE=..\..\src\glew_gl.c +# End Source File +# Begin Source File + +SOURCE=..\..\src\glew_wgl.c +# End Source File +# Begin Source File + +SOURCE=..\..\src\glew_str.c +# End Source File +# Begin Source File + +SOURCE=..\..\src\glew_utils.c # End Source File # End Group # Begin Group "Header Files" @@ -149,6 +161,10 @@ SOURCE=..\..\include\GL\glew.h SOURCE=..\..\include\GL\wglew.h # End Source File +# Begin Source File + +SOURCE=..\..\src\glew_utils.h +# End Source File # End Group # End Target # End Project