diff --git a/Makefile b/Makefile index c4ee85e..c72a443 100644 --- a/Makefile +++ b/Makefile @@ -31,8 +31,8 @@ GLEW_DEST ?= /usr GLEW_MAJOR = 1 -GLEW_MINOR = 2 -GLEW_MICRO = 6 +GLEW_MINOR = 3 +GLEW_MICRO = 0 GLEW_VERSION = $(GLEW_MAJOR).$(GLEW_MINOR).$(GLEW_MICRO) TARDIR = ../glew-$(GLEW_VERSION) diff --git a/auto/Makefile b/auto/Makefile index fdd33d1..9d982b3 100644 --- a/auto/Makefile +++ b/auto/Makefile @@ -6,8 +6,8 @@ ## Foundation or, at your option, any later version. GLEW_MAJOR = 1 -GLEW_MINOR = 2 -GLEW_MICRO = 6 +GLEW_MINOR = 3 +GLEW_MICRO = 0 GLEW_VERSION = $(GLEW_MAJOR).$(GLEW_MINOR).$(GLEW_MICRO) SHELL = bash @@ -27,7 +27,7 @@ I.DEST = $(TOP)/include/GL S.DEST = $(TOP)/src D.DEST = $(TOP)/doc -TARGETS = $(I.DEST)/glew.h $(I.DEST)/wglew.h $(I.DEST)/glxew.h $(S.DEST)/glew.c $(S.DEST)/glewinfo.c \ +TARGETS = $(I.DEST)/glew.h $(I.DEST)/wglew.h $(I.DEST)/glxew.h $(S.DEST)/glew_gl.c $(S.DEST)/glew_str.c $(S.DEST)/glew_wgl.c $(S.DEST)/glew_glx.c $(S.DEST)/glewinfo.c \ $(D.DEST)/glew.html $(D.DEST)/wglew.html $(D.DEST)/glxew.html all: $(TARGETS) @@ -57,7 +57,7 @@ endif $(I.DEST)/glew.h: $(EXT)/.dummy test -d $(I.DEST) || mkdir -p $(I.DEST) - cp -f $(SRC)/glew_pre.h $@ + cp -f $(SRC)/glew_head.h $@ $(BIN)/make_header.pl GLAPIENTRY GL $(CORE)/GL_VERSION* >> $@ $(BIN)/make_header.pl GLAPIENTRY GL $(EXT)/GL_* >> $@ echo -e "/* ------------------------------------------------------------------------- */\n\n#if defined(GLEW_MX) && defined(_WIN32)\n#define GLEW_FUN_EXPORT\n#else\n#define GLEW_FUN_EXPORT GLEWAPI\n#endif /* GLEW_MX */\n" >> $@ @@ -69,19 +69,19 @@ $(I.DEST)/glew.h: $(EXT)/.dummy echo -e "\n#ifdef GLEW_MX\n}; /* GLEWContextStruct */\n#endif /* GLEW_MX */\n" >> $@ perl -e 's/GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2;/GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_1;\nGLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2;/' -pi $@ rm -f $@.bak - cat $(SRC)/glew_post.h >> $@ + cat $(SRC)/glew_tail.h >> $@ $(I.DEST)/wglew.h: $(EXT)/.dummy - cp -f $(SRC)/wglew_pre.h $@ + cp -f $(SRC)/wglew_head.h $@ $(BIN)/make_header.pl WINAPI WGL $(EXT)/WGL_* >> $@ echo -e "/* ------------------------------------------------------------------------- */\n\n#ifdef GLEW_MX\n#define WGLEW_EXPORT\n#else\n#define WGLEW_EXPORT GLEWAPI\n#endif /* GLEW_MX */\n\n#ifdef GLEW_MX\nstruct WGLEWContextStruct\n{\n#endif /* GLEW_MX */" >> $@ $(BIN)/make_struct_fun.pl WGLEW_EXPORT $(EXT)/WGL_* >> $@ $(BIN)/make_struct_var.pl WGLEW_EXPORT $(EXT)/WGL_* >> $@ echo -e "\n#ifdef GLEW_MX\n}; /* WGLEWContextStruct */\n#endif /* GLEW_MX */\n" >> $@ - cat $(SRC)/wglew_post.h >> $@ + cat $(SRC)/wglew_tail.h >> $@ $(I.DEST)/glxew.h: $(EXT)/.dummy - cp -f $(SRC)/glxew_pre.h $@ + cp -f $(SRC)/glxew_head.h $@ $(BIN)/make_header.pl '' GLX $(CORE)/GLX_VERSION* >> $@ $(BIN)/make_header.pl '' GLX $(EXT)/GLX_* >> $@ echo -e "/* ------------------------------------------------------------------------- */\n\n#ifdef GLEW_MX\n#define GLXEW_EXPORT\n#else\n#define GLXEW_EXPORT extern\n#endif /* GLEW_MX */" >> $@ @@ -90,44 +90,64 @@ $(I.DEST)/glxew.h: $(EXT)/.dummy $(BIN)/make_struct_var.pl GLXEW_EXPORT $(CORE)/GLX_VERSION* $(EXT)/GLX_* >> $@ echo -e "\n#ifdef GLEW_MX\n}; /* GLXEWContextStruct */\n#endif /* GLEW_MX */\n" >> $@ perl -e 's/GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_2;/GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_0;\nGLXEW_EXPORT GLboolean __GLXEW_VERSION_1_1;\nGLXEW_EXPORT GLboolean __GLXEW_VERSION_1_2;/' -pi $@ - cat $(SRC)/glxew_post.h >> $@ + cat $(SRC)/glxew_tail.h >> $@ $(BIN)/fix_OML_sync_control.sh $@ -$(S.DEST)/glew.c: $(EXT)/.dummy - cp -f $(SRC)/glew_pre.c $@ +$(S.DEST)/glew_gl.c: $(EXT)/.dummy + cp -f $(SRC)/glew_gl_head.c $@ $(BIN)/make_def.pl GL $(CORE)/GL_VERSION* $(EXT)/GL_* >> $@ - echo -e "\n#endif /* !_WIN32 || !GLEW_MX */\n" >> $@ - echo -e "#if defined(_WIN32) && !defined(GLEW_MX)" >> $@ - $(BIN)/make_def.pl WGL $(EXT)/WGL_* >> $@ - echo -e "\n#endif /* _WIN32 && !GLEW_MX */\n" >> $@ - echo -e "#if !(defined(_WIN32) || (defined(__APPLE__) && !defined(GLEW_APPLE_GLX)))" >> $@ - $(BIN)/make_def.pl GLX $(CORE)/GLX_VERSION* $(EXT)/GLX_* >> $@ - echo -e "\n#endif /* !_WIN32 */\n" >> $@ $(BIN)/make_init.pl GL $(CORE)/GL_VERSION* >> $@ $(BIN)/make_init.pl GL $(EXT)/GL_* >> $@ - echo -e "#ifdef _WIN32\n" >> $@ - $(BIN)/make_init.pl WGL $(EXT)/WGL_* >> $@ - echo -e "#else /* _UNIX */\n\n" >> $@ - $(BIN)/make_init.pl GLX $(CORE)/GLX_VERSION* >> $@ - $(BIN)/make_init.pl GLX $(EXT)/GLX_* >> $@ - echo -e "#endif /* _WIN32 */\n" >> $@ - - cat $(SRC)/glew_gl.c >> $@ + 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_wgl.c >> $@ - $(BIN)/make_list.pl $(EXT)/WGL_* >> $@ - cat $(SRC)/glew_glx.c >> $@ - $(BIN)/make_list.pl $(CORE)/GLX_VERSION_1_3 | grep -v '\"GLX_VERSION' >> $@ - $(BIN)/make_list.pl $(EXT)/GLX_* >> $@ - cat $(SRC)/glew_post.c >> $@ - $(BIN)/fix_OML_sync_control.sh $@ + 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 +$(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" >> $@ + $(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_init.pl GLX $(CORE)/GLX_VERSION* >> $@ + $(BIN)/make_init.pl GLX $(EXT)/GLX_* >> $@ + cat $(SRC)/glew_glx_init.c >> $@ + $(BIN)/make_list.pl $(CORE)/GLX_VERSION_1_3 | grep -v '\"GLX_VERSION' >> $@ + $(BIN)/make_list.pl $(EXT)/GLX_* >> $@ + cat $(SRC)/glew_glx_tail.c >> $@ + $(BIN)/fix_OML_sync_control.sh $@ + rm -f $@.bak + +$(S.DEST)/glew_str.c: $(EXT)/.dummy + cp -f $(SRC)/glew_str_head.c $@ + $(BIN)/make_str.pl $(CORE)/GL_VERSION* $(EXT)/GL_* >> $@ + cat $(SRC)/glew_str_wgl.c >> $@ + $(BIN)/make_str.pl $(EXT)/WGL_* >> $@ + cat $(SRC)/glew_str_glx.c >> $@ + $(BIN)/make_str.pl $(CORE)/GLX_VERSION* $(EXT)/GLX_* >> $@ + cat $(SRC)/glew_str_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 + + $(S.DEST)/glewinfo.c: $(EXT)/.dummy - cp -f $(SRC)/glewinfo_pre.c $@ + cp -f $(SRC)/glewinfo_head.c $@ $(BIN)/make_info.pl $(CORE)/GL_VERSION* >> $@ $(BIN)/make_info.pl $(EXT)/GL_* >> $@ echo -e "#ifdef _WIN32\n" >> $@ @@ -145,23 +165,23 @@ $(S.DEST)/glewinfo.c: $(EXT)/.dummy cat $(SRC)/glewinfo_glx.c >> $@ $(BIN)/make_info_list.pl $(CORE)/GLX_VERSION* >> $@ $(BIN)/make_info_list.pl $(EXT)/GLX_* >> $@ - cat $(SRC)/glewinfo_post.c >> $@ + cat $(SRC)/glewinfo_tail.c >> $@ $(BIN)/fix_OML_sync_control.sh $@ $(D.DEST)/glew.html: $(EXT)/.dummy - cp -f $(SRC)/glew_pre.html $@ + cp -f $(SRC)/glew_head.html $@ $(BIN)/make_html.pl $(EXT)/GL_* >> $@ - cat $(SRC)/glew_post.html >> $@ + cat $(SRC)/glew_tail.html >> $@ $(D.DEST)/wglew.html: $(EXT)/.dummy - cp -f $(SRC)/wglew_pre.html $@ + cp -f $(SRC)/wglew_head.html $@ $(BIN)/make_html.pl $(EXT)/WGL_* >> $@ - cat $(SRC)/glew_post.html >> $@ + cat $(SRC)/glew_tail.html >> $@ $(D.DEST)/glxew.html: $(EXT)/.dummy - cp -f $(SRC)/glxew_pre.html $@ + cp -f $(SRC)/glxew_head.html $@ $(BIN)/make_html.pl $(EXT)/GLX_* >> $@ - cat $(SRC)/glew_post.html >> $@ + cat $(SRC)/glew_tail.html >> $@ clean: rm -rf $(TARGETS) diff --git a/auto/bin/make_info.pl b/auto/bin/make_info.pl index 2839c35..77011e1 100755 --- a/auto/bin/make_info.pl +++ b/auto/bin/make_info.pl @@ -43,8 +43,8 @@ foreach my $ext (sort @extlist) $extpre =~ s/(GLX|GLW|GL).*/$1/; $extpre = lc $extpre; - make_separator($extname); - print "#ifdef $extname\n\n"; + #make_separator($extname); + #print "#ifdef $extname\n\n"; print "static void _glewInfo_$extname (void)\n{\n"; if ($extvar =~ /VERSION/) { @@ -57,5 +57,5 @@ foreach my $ext (sort @extlist) } output_decls($functions, \&make_pfn_info); print "}\n\n"; - print "#endif /* $extname */\n\n"; + #print "#endif /* $extname */\n\n"; } diff --git a/auto/bin/make_init.pl b/auto/bin/make_init.pl index 14879b2..5fbe07f 100755 --- a/auto/bin/make_init.pl +++ b/auto/bin/make_init.pl @@ -41,8 +41,8 @@ foreach my $ext (sort @extlist) my ($extname, $exturl, $types, $tokens, $functions, $exacts) = parse_ext($ext); - make_separator($extname); - print "#ifdef $extname\n\n"; + #make_separator($extname); + #print "#ifdef $extname\n\n"; my $extvar = $extname; my $extvardef = $extname; $extvar =~ s/GL(X*)_/GL$1EW_/; @@ -51,8 +51,8 @@ foreach my $ext (sort @extlist) print "static GLboolean _glewInit_$extname (" . $type . "EW_CONTEXT_ARG_DEF_INIT)\n{\n GLboolean r = GL_FALSE;\n"; output_decls($functions, \&make_pfn_def_init); - print "\n return r;\n}\n"; + print "\n return r;\n}\n\n"; } #print "\nGLboolean " . prefix_varname($extvar) . " = GL_FALSE;\n\n"; - print "#endif /* $extname */\n\n"; + #print "#endif /* $extname */\n\n"; } diff --git a/auto/bin/make_list.pl b/auto/bin/make_list.pl index e77bf6e..a98f472 100755 --- a/auto/bin/make_list.pl +++ b/auto/bin/make_list.pl @@ -46,7 +46,7 @@ foreach my $ext (sort @extlist) #my $pextvar = prefix_varname($extvar); - print "#ifdef $extname\n"; + #print "#ifdef $extname\n"; print " " . $extvar . " = " . $extpre . "GetExtension(\"$extname\");\n"; if (keys %$functions) { @@ -59,5 +59,5 @@ foreach my $ext (sort @extlist) print " if (glewExperimental || " . $extvar . ") " . $extvar . " = !_glewInit_$extname(GLEW_CONTEXT_ARG_VAR_INIT);\n"; } } - print "#endif /* $extname */\n"; + #print "#endif /* $extname */\n"; } diff --git a/auto/bin/make_str.pl b/auto/bin/make_str.pl new file mode 100755 index 0000000..08ab728 --- /dev/null +++ b/auto/bin/make_str.pl @@ -0,0 +1,53 @@ +#!/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 $export = shift; + +if (@ARGV) +{ + @extlist = @ARGV; +} else { + local $/; + @extlist = split "\n", (<>); +} + +my $curexttype = ""; + +foreach my $ext (sort @extlist) +{ + my ($extname, $exturl, $types, $tokens, $functions, $exacts) = parse_ext($ext); + my $exttype = $extname; + $exttype =~ s/(W*?)GL(X*?)_(.*?_)(.*)/$3/; + my $extrem = $extname; + $extrem =~ s/(W*?)GL(X*?)_(.*?_)(.*)/$4/; + my $extvar = $extname; + $extvar =~ s/(W*)GL(X*)_/$1GL$2EW_/; + if(!($exttype =~ $curexttype)) + { + if(length($curexttype) > 0) + { + print " }\n"; + } + print " if (_glewStrSame2(&pos, &len, (const GLubyte*)\"$exttype\", " . length($exttype) . "))\n"; + print " {\n"; + $curexttype = $exttype; + } + print " if (_glewStrSame3(pos, len, (const GLubyte*)\"$extrem\", ". length($extrem) . "))\n"; + print " return $extvar;\n"; +} + +print " }\n"; diff --git a/auto/src/glew_gl_head.c b/auto/src/glew_gl_head.c new file mode 100644 index 0000000..f99abf3 --- /dev/null +++ b/auto/src/glew_gl_head.c @@ -0,0 +1,36 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2004, 2003, 2002, Milan Ikits +** Copyright (C) 2004, 2003, 2002, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "glew_utils.h" + +#if !defined(_WIN32) || !defined(GLEW_MX) + +GLboolean __GLEW_VERSION_1_1 = GL_FALSE; diff --git a/auto/src/glew_gl.c b/auto/src/glew_gl_init.c similarity index 83% rename from auto/src/glew_gl.c rename to auto/src/glew_gl_init.c index c310af7..8d7645f 100644 --- a/auto/src/glew_gl.c +++ b/auto/src/glew_gl_init.c @@ -1,31 +1,5 @@ /* ------------------------------------------------------------------------- */ -/* - * GLEW, just like OpenGL or GLU, does not rely on the standard C library. - * These functions implement the functionality required in this file. - */ - -static GLuint _glewStrLen (const GLubyte* s) -{ - GLuint i=0; - while (s+i != NULL && s[i] != '\0') i++; - return i; -} - -static GLuint _glewStrCLen (const GLubyte* s, GLubyte c) -{ - GLuint i=0; - while (s+i != NULL && s[i] != '\0' && s[i] != c) i++; - return i; -} - -static GLboolean _glewStrSame (const GLubyte* a, const GLubyte* b, GLuint n) -{ - GLuint i=0; - while (i < n && a+i != NULL && b+i != NULL && a[i] == b[i]) i++; - return i == n; -} - /* * Search for name in the extensions string. Use of strstr() * is not sufficient because extension names can be prefixes of diff --git a/auto/src/glew_post.c b/auto/src/glew_gl_tail.c similarity index 87% rename from auto/src/glew_post.c rename to auto/src/glew_gl_tail.c index d819194..b912470 100644 --- a/auto/src/glew_post.c +++ b/auto/src/glew_gl_tail.c @@ -36,6 +36,12 @@ GLboolean glewExperimental = GL_FALSE; #ifndef GLEW_MX +#if defined(_WIN32) +extern GLenum wglewContextInit (void); +#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) /* _UNIX */ +extern GLenum glxewContextInit (void); +#endif /* _WIN32 */ + GLenum glewInit () { GLenum r; diff --git a/auto/src/glew_glx_head.c b/auto/src/glew_glx_head.c new file mode 100644 index 0000000..297f6dd --- /dev/null +++ b/auto/src/glew_glx_head.c @@ -0,0 +1,36 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2004, 2003, 2002, Milan Ikits +** Copyright (C) 2004, 2003, 2002, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "glew_utils.h" + +GLboolean __GLXEW_VERSION_1_0 = GL_FALSE; +GLboolean __GLXEW_VERSION_1_1 = GL_FALSE; + diff --git a/auto/src/glew_glx.c b/auto/src/glew_glx_init.c similarity index 65% rename from auto/src/glew_glx.c rename to auto/src/glew_glx_init.c index e9834d8..e62445a 100644 --- a/auto/src/glew_glx.c +++ b/auto/src/glew_glx_init.c @@ -1,7 +1,5 @@ - return GLEW_OK; -} -#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) /* _UNIX */ +#if !defined(__APPLE__) || defined(GLEW_APPLE_GLX) /* _UNIX */ GLboolean glxewGetExtension (const char* name) { @@ -23,35 +21,33 @@ GLboolean glxewGetExtension (const char* name) return GL_FALSE; } -#ifndef GLEW_MX -static -#endif GLenum glxewContextInit (GLXEW_CONTEXT_ARG_DEF_LIST) { int major, minor; /* initialize core GLX 1.2 */ if (_glewInit_GLX_VERSION_1_2(GLEW_CONTEXT_ARG_VAR_INIT)) return GLEW_ERROR_GLX_VERSION_11_ONLY; /* initialize flags */ - GLXEW_VERSION_1_0 = GL_FALSE; - GLXEW_VERSION_1_1 = GL_FALSE; - GLXEW_VERSION_1_2 = GL_FALSE; - GLXEW_VERSION_1_3 = GL_FALSE; - GLXEW_VERSION_1_4 = GL_FALSE; + GLXEW_VERSION_1_0 = GL_TRUE; + GLXEW_VERSION_1_1 = GL_TRUE; + GLXEW_VERSION_1_2 = GL_TRUE; + GLXEW_VERSION_1_3 = GL_TRUE; + GLXEW_VERSION_1_4 = GL_TRUE; /* query GLX version */ glXQueryVersion(glXGetCurrentDisplay(), &major, &minor); - switch (minor) + if (major == 1 && minor <= 3) { - case 4: - GLXEW_VERSION_1_4 = GL_TRUE; - case 3: - GLXEW_VERSION_1_3 = GL_TRUE; - case 2: - GLXEW_VERSION_1_2 = GL_TRUE; - GLXEW_VERSION_1_1 = GL_TRUE; - GLXEW_VERSION_1_0 = GL_TRUE; - break; - default: - return GLEW_ERROR_GLX_VERSION_11_ONLY; - break; + switch (minor) + { + case 3: + GLXEW_VERSION_1_4 = GL_FALSE; + break; + case 2: + GLXEW_VERSION_1_4 = GL_FALSE; + GLXEW_VERSION_1_3 = GL_FALSE; + break; + default: + return GLEW_ERROR_GLX_VERSION_11_ONLY; + break; + } } /* initialize extensions */ diff --git a/auto/src/glew_glx_tail.c b/auto/src/glew_glx_tail.c new file mode 100644 index 0000000..a6c603a --- /dev/null +++ b/auto/src/glew_glx_tail.c @@ -0,0 +1,2 @@ + return GLEW_OK; +} diff --git a/auto/src/glew_pre.h b/auto/src/glew_head.h similarity index 100% rename from auto/src/glew_pre.h rename to auto/src/glew_head.h diff --git a/auto/src/glew_pre.html b/auto/src/glew_head.html similarity index 100% rename from auto/src/glew_pre.html rename to auto/src/glew_head.html diff --git a/auto/src/glew_init_glx.c b/auto/src/glew_init_glx.c deleted file mode 100644 index 7d3677b..0000000 --- a/auto/src/glew_init_glx.c +++ /dev/null @@ -1,16 +0,0 @@ -/* ---------------------------- GLX_VERSION_1_0 ---------------------------- */ - -#ifdef GLX_VERSION_1_0 - -GLboolean GLXEW_VERSION_1_0 = GL_FALSE; - -#endif /* GLX_VERSION_1_0 */ - -/* ---------------------------- GLX_VERSION_1_1 ---------------------------- */ - -#ifdef GLX_VERSION_1_1 - -GLboolean GLXEW_VERSION_1_1 = GL_FALSE; - -#endif /* GLX_VERSION_1_1 */ - diff --git a/auto/src/glew_str_glx.c b/auto/src/glew_str_glx.c new file mode 100644 index 0000000..bce2321 --- /dev/null +++ b/auto/src/glew_str_glx.c @@ -0,0 +1,4 @@ + } +#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) + else if(_glewStrSame2(&pos, &len, (const GLubyte*)"GLX_", 4)) + { diff --git a/auto/src/glew_str_head.c b/auto/src/glew_str_head.c new file mode 100644 index 0000000..6489f95 --- /dev/null +++ b/auto/src/glew_str_head.c @@ -0,0 +1,43 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2004, 2003, 2002, Milan Ikits +** Copyright (C) 2004, 2003, 2002, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "glew_utils.h" + +#ifdef GLEW_MX +GLboolean glewContextIsSupported (GLEWContext* ctx, const char* name) +#else +GLboolean glewIsSupported (const char* name) +#endif +{ + GLubyte* pos = (GLubyte*)name; + GLuint len = _glewStrLen(pos); + if(_glewStrSame2(&pos, &len, (const GLubyte*)"GL_", 3)) + { diff --git a/auto/src/glew_str_tail.c b/auto/src/glew_str_tail.c new file mode 100644 index 0000000..fa7c366 --- /dev/null +++ b/auto/src/glew_str_tail.c @@ -0,0 +1,4 @@ + } +#endif /* */ + return GL_FALSE; +} diff --git a/auto/src/glew_str_wgl.c b/auto/src/glew_str_wgl.c new file mode 100644 index 0000000..581674f --- /dev/null +++ b/auto/src/glew_str_wgl.c @@ -0,0 +1,4 @@ + } +#if defined(_WIN32) + else if(_glewStrSame2(&pos, &len, (const GLubyte*)"WGL_", 4)) + { diff --git a/auto/src/glew_post.h b/auto/src/glew_tail.h similarity index 84% rename from auto/src/glew_post.h rename to auto/src/glew_tail.h index 69eaf29..1a24df8 100644 --- a/auto/src/glew_post.h +++ b/auto/src/glew_tail.h @@ -15,6 +15,10 @@ typedef struct GLEWContextStruct GLEWContext; GLEWAPI GLenum glewContextInit (GLEWContext* ctx); +GLEWAPI GLboolean glewContextIsSupported (GLEWContext* ctx, const char* name); + +#define glewInit() glewContextInit(glewGetContext()) +#define glewIsSupported(x) glewContextIsSupported(glewGetContext(), x) #ifdef _WIN32 # define GLEW_GET_VAR(x) glewGetContext()->x @@ -27,6 +31,7 @@ GLEWAPI GLenum glewContextInit (GLEWContext* ctx); #else /* GLEW_MX */ GLEWAPI GLenum glewInit (); +GLEWAPI GLboolean glewIsSupported (const char* name); #define GLEW_GET_VAR(x) x #define GLEW_GET_FUN(x) x diff --git a/auto/src/glew_post.html b/auto/src/glew_tail.html similarity index 100% rename from auto/src/glew_post.html rename to auto/src/glew_tail.html diff --git a/auto/src/glew_wgl_head.c b/auto/src/glew_wgl_head.c new file mode 100644 index 0000000..afca06b --- /dev/null +++ b/auto/src/glew_wgl_head.c @@ -0,0 +1,34 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2004, 2003, 2002, Milan Ikits +** Copyright (C) 2004, 2003, 2002, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "glew_utils.h" + +#if !defined(GLEW_MX) diff --git a/auto/src/glew_wgl.c b/auto/src/glew_wgl_init.c similarity index 95% rename from auto/src/glew_wgl.c rename to auto/src/glew_wgl_init.c index c5bb2bd..029abd5 100644 --- a/auto/src/glew_wgl.c +++ b/auto/src/glew_wgl_init.c @@ -1,10 +1,6 @@ - return GLEW_OK; -} /* ------------------------------------------------------------------------- */ -#ifdef _WIN32 - static PFNWGLGETEXTENSIONSSTRINGARBPROC _wglewGetExtensionsStringARB = NULL; static PFNWGLGETEXTENSIONSSTRINGEXTPROC _wglewGetExtensionsStringEXT = NULL; @@ -31,9 +27,6 @@ GLboolean wglewGetExtension (const char* name) return GL_FALSE; } -#ifndef GLEW_MX -static -#endif GLenum wglewContextInit (WGLEW_CONTEXT_ARG_DEF_LIST) { GLboolean crippled; diff --git a/auto/src/glew_wgl_tail.c b/auto/src/glew_wgl_tail.c new file mode 100644 index 0000000..a6c603a --- /dev/null +++ b/auto/src/glew_wgl_tail.c @@ -0,0 +1,2 @@ + return GLEW_OK; +} diff --git a/auto/src/glewinfo_pre.c b/auto/src/glewinfo_head.c similarity index 100% rename from auto/src/glewinfo_pre.c rename to auto/src/glewinfo_head.c diff --git a/auto/src/glewinfo_post.c b/auto/src/glewinfo_tail.c similarity index 100% rename from auto/src/glewinfo_post.c rename to auto/src/glewinfo_tail.c diff --git a/auto/src/glxew_pre.h b/auto/src/glxew_head.h similarity index 100% rename from auto/src/glxew_pre.h rename to auto/src/glxew_head.h diff --git a/auto/src/glxew_pre.html b/auto/src/glxew_head.html similarity index 100% rename from auto/src/glxew_pre.html rename to auto/src/glxew_head.html diff --git a/auto/src/glxew_post.h b/auto/src/glxew_tail.h similarity index 100% rename from auto/src/glxew_post.h rename to auto/src/glxew_tail.h diff --git a/auto/src/wglew_pre.h b/auto/src/wglew_head.h similarity index 100% rename from auto/src/wglew_pre.h rename to auto/src/wglew_head.h diff --git a/auto/src/wglew_pre.html b/auto/src/wglew_head.html similarity index 100% rename from auto/src/wglew_pre.html rename to auto/src/wglew_head.html diff --git a/auto/src/wglew_post.h b/auto/src/wglew_tail.h similarity index 100% rename from auto/src/wglew_post.h rename to auto/src/wglew_tail.h diff --git a/auto/src/wglew_tail.html b/auto/src/wglew_tail.html new file mode 100644 index 0000000..0602af8 --- /dev/null +++ b/auto/src/wglew_tail.html @@ -0,0 +1,23 @@ + + + + + +GLEW: WGL Extensions Supported + + + + + +
+ + +
+
The OpenGL Extension Wrangler + Library

+WGL Extensions Supported

diff --git a/auto/src/glew_pre.c b/src/glew_utils.c similarity index 53% rename from auto/src/glew_pre.c rename to src/glew_utils.c index a12e95a..f56e689 100644 --- a/auto/src/glew_pre.c +++ b/src/glew_utils.c @@ -1,7 +1,7 @@ /* ** The OpenGL Extension Wrangler Library -** Copyright (C) 2004, 2003, 2002, Milan Ikits -** Copyright (C) 2004, 2003, 2002, Marcelo E. Magallon +** Copyright (C) 2002-2005, Milan Ikits +** Copyright (C) 2002-2005, Marcelo E. Magallon ** Copyright (C) 2002, Lev Povalahev ** All rights reserved. ** @@ -36,32 +36,20 @@ # include #endif -#if defined(_WIN32) -# define glewGetProcAddress(name) wglGetProcAddress((LPCSTR)name) -#else -# if defined(__APPLE__) -# define glewGetProcAddress(name) NSGLGetProcAddress(name) -# else -# if defined(__sgi) || defined(__sun) -# define glewGetProcAddress(name) dlGetProcAddress(name) -# else /* __linux */ -# define glewGetProcAddress(name) (*glXGetProcAddressARB)(name) -# endif -# endif -#endif +#include "glew_utils.h" #if defined(__APPLE__) #include #include #include -static void *NSGLGetProcAddress (const GLubyte *name) +void* NSGLGetProcAddress (const GLubyte *name) { NSSymbol symbol; - char *symbolName; + char* symbolName; /* prepend a '_' for the Unix C symbol mangling convention */ - symbolName = malloc(strlen((const char *)name) + 2); - strcpy(symbolName+1, (const char *)name); + symbolName = malloc(strlen((const char*)name) + 2); + strcpy(symbolName+1, (const char*)name); symbolName[0] = '_'; symbol = NULL; if (NSIsSymbolNameDefined(symbolName)) @@ -76,10 +64,10 @@ static void *NSGLGetProcAddress (const GLubyte *name) #include #include -static void *dlGetProcAddress (const GLubyte* name) +void* dlGetProcAddress (const GLubyte* name) { - static void *h = NULL; - static void *gpa; + static void* h = NULL; + static void* gpa; if (h == NULL) { @@ -88,43 +76,61 @@ static void *dlGetProcAddress (const GLubyte* name) } if (gpa != NULL) - return ((void *(*)(const GLubyte *))gpa)(name); + return ((void*(*)(const GLubyte*))gpa)(name); else - return dlsym(h, (const char *)name); + return dlsym(h, (const char*)name); } #endif /* __sgi || __sun */ -#ifdef GLEW_MX -#define glewGetContext() ctx -#define wglewGetContext() ctx -#define glxewGetContext() ctx -#ifdef _WIN32 -#define GLEW_CONTEXT_ARG_DEF_INIT GLEWContext* ctx -#define WGLEW_CONTEXT_ARG_DEF_INIT WGLEWContext* ctx -#define GLXEW_CONTEXT_ARG_DEF_INIT GLXEWContext* ctx -#define GLEW_CONTEXT_ARG_VAR_INIT ctx -#else /* _WIN32 */ -#define GLEW_CONTEXT_ARG_DEF_INIT void -#define WGLEW_CONTEXT_ARG_DEF_INIT void -#define GLXEW_CONTEXT_ARG_DEF_INIT void -#define GLEW_CONTEXT_ARG_VAR_INIT -#endif /* _WIN32 */ -#define GLEW_CONTEXT_ARG_DEF_LIST GLEWContext* ctx -#define WGLEW_CONTEXT_ARG_DEF_LIST WGLEWContext* ctx -#define GLXEW_CONTEXT_ARG_DEF_LIST GLXEWContext* ctx -#else /* GLEW_MX */ -#define GLEW_CONTEXT_ARG_DEF_INIT void -#define WGLEW_CONTEXT_ARG_DEF_INIT void -#define GLXEW_CONTEXT_ARG_DEF_INIT void -#define GLEW_CONTEXT_ARG_DEF_LIST void -#define WGLEW_CONTEXT_ARG_DEF_LIST void -#define GLXEW_CONTEXT_ARG_DEF_LIST void -#define GLEW_CONTEXT_ARG_VAR_INIT -#endif /* GLEW_MX */ +/* + * GLEW, just like OpenGL or GLU, does not rely on the standard C library. + * These functions implement the functionality required in this file. + */ -#if !defined(_WIN32) || !defined(GLEW_MX) +GLuint _glewStrLen (const GLubyte* s) +{ + GLuint i=0; + while (s+i != NULL && s[i] != '\0') i++; + return i; +} -GLboolean __GLEW_VERSION_1_1 = GL_FALSE; -GLboolean __GLXEW_VERSION_1_0 = GL_FALSE; -GLboolean __GLXEW_VERSION_1_1 = GL_FALSE; +GLuint _glewStrCLen (const GLubyte* s, GLubyte c) +{ + GLuint i=0; + while (s+i != NULL && s[i] != '\0' && s[i] != c) i++; + return i; +} +GLboolean _glewStrSame (const GLubyte* a, const GLubyte* b, GLuint n) +{ + GLuint i=0; + while (i < n && a+i != NULL && b+i != NULL && a[i] == b[i]) i++; + return i == n ? GL_TRUE : GL_FALSE; +} + +GLboolean _glewStrSame2 (const GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) +{ + if(*na >= nb) + { + GLuint i=0; + while (i < nb && *a+i != NULL && b+i != NULL && *a[i] == b[i]) i++; + if(i == nb) + { + *a = *a + nb; + *na = *na - nb; + return GL_TRUE; + } + } + return GL_FALSE; +} + +GLboolean _glewStrSame3 (const GLubyte* a, GLuint na, const GLubyte* b, GLuint nb) +{ + if(na == nb) + { + GLuint i=0; + while (i < nb && a+i != NULL && b+i != NULL && a[i] == b[i]) i++; + return i == nb ? GL_TRUE : GL_FALSE; + } + return GL_FALSE; +} diff --git a/src/glew_utils.h b/src/glew_utils.h new file mode 100644 index 0000000..01fe502 --- /dev/null +++ b/src/glew_utils.h @@ -0,0 +1,99 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2002-2005, Milan Ikits +** Copyright (C) 2002-2005, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef __glew_utils_h__ +#define __glew_utils_h__ + +#include +#if defined(_WIN32) +# include +#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) +# include +#endif + +/* + * Define glewGetContext and related helper macros. + */ +#ifdef GLEW_MX +# define glewGetContext() ctx +# ifdef _WIN32 +# define GLEW_CONTEXT_ARG_DEF_INIT GLEWContext* ctx +# define GLEW_CONTEXT_ARG_VAR_INIT ctx +# define wglewGetContext() ctx +# define WGLEW_CONTEXT_ARG_DEF_INIT WGLEWContext* ctx +# define WGLEW_CONTEXT_ARG_DEF_LIST WGLEWContext* ctx +# else /* _WIN32 */ +# define GLEW_CONTEXT_ARG_DEF_INIT void +# define GLEW_CONTEXT_ARG_VAR_INIT +# define glxewGetContext() ctx +# define GLXEW_CONTEXT_ARG_DEF_INIT void +# define GLXEW_CONTEXT_ARG_DEF_LIST GLXEWContext* ctx +# endif /* _WIN32 */ +# define GLEW_CONTEXT_ARG_DEF_LIST GLEWContext* ctx +#else /* GLEW_MX */ +# define GLEW_CONTEXT_ARG_DEF_INIT void +# define GLEW_CONTEXT_ARG_VAR_INIT +# define GLEW_CONTEXT_ARG_DEF_LIST void +# define WGLEW_CONTEXT_ARG_DEF_INIT void +# define WGLEW_CONTEXT_ARG_DEF_LIST void +# define GLXEW_CONTEXT_ARG_DEF_INIT void +# define GLXEW_CONTEXT_ARG_DEF_LIST void +#endif /* GLEW_MX */ + +/* + * Define glewGetProcAddress. + */ +#if defined(_WIN32) +# define glewGetProcAddress(name) wglGetProcAddress((LPCSTR)name) +#else +# if defined(__APPLE__) + extern void* NSGLGetProcAddress (const GLubyte* name); +# define glewGetProcAddress(name) NSGLGetProcAddress(name) +# else +# if defined(__sgi) || defined(__sun) + extern void* dlGetProcAddress (const GLubyte* name); +# define glewGetProcAddress(name) dlGetProcAddress(name) +# else /* __linux */ +# define glewGetProcAddress(name) (*glXGetProcAddressARB)(name) +# endif +# endif +#endif + +/* + * GLEW, just like OpenGL or GLU, does not rely on the standard C library. + * These functions implement the string processing functionality required in the library. + */ +extern GLuint _glewStrLen (const GLubyte* s); +extern GLuint _glewStrCLen (const GLubyte* s, GLubyte c); +extern GLboolean _glewStrSame (const GLubyte* a, const GLubyte* b, GLuint n); +extern GLboolean _glewStrSame2 (const GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb); +extern GLboolean _glewStrSame3 (const GLubyte* a, GLuint na, const GLubyte* b, GLuint nb); +#endif /* __glew_utils_h__ */