diff --git a/Makefile b/Makefile
index 8c67a95..d218d45 100644
--- a/Makefile
+++ b/Makefile
@@ -123,6 +123,10 @@ tmp/$(SYSTEM)/default/shared/glew.o: src/glew.c include/GL/glew.h include/GL/wgl
@mkdir -p $(dir $@)
$(CC) -DGLEW_NO_GLU $(CFLAGS) $(CFLAGS.SO) -o $@ -c $<
+# Force re-write of glew.pc, GLEW_DEST can vary
+
+.PHONY: glew.pc
+
glew.pc: glew.pc.in
sed \
-e "s|@prefix@|$(GLEW_DEST)|g" \
@@ -159,6 +163,10 @@ tmp/$(SYSTEM)/mx/shared/glew.o: src/glew.c include/GL/glew.h include/GL/wglew.h
@mkdir -p $(dir $@)
$(CC) -DGLEW_NO_GLU -DGLEW_MX $(CFLAGS) $(CFLAGS.SO) -o $@ -c $<
+# Force re-write of glewmx.pc, GLEW_DEST can vary
+
+.PHONY: glewmx.pc
+
glewmx.pc: glew.pc.in
sed \
-e "s|@prefix@|$(GLEW_DEST)|g" \
@@ -358,8 +366,9 @@ dist-src:
find $(TARDIR) -name CVS -o -name .cvsignore | xargs $(RM) -r
find $(TARDIR) -name .svn | xargs $(RM) -r
find $(TARDIR) -name "*.patch" | xargs $(RM) -r
- unix2dos $(TARDIR)/Makefile
- unix2dos $(TARDIR)/config/*
+ dos2unix $(TARDIR)/Makefile
+ dos2unix $(TARDIR)/auto/Makefile
+ dos2unix $(TARDIR)/config/*
unix2dos $(TARDIR)/auto/core/*
unix2dos $(TARDIR)/auto/extensions/*
find $(TARDIR) -name '*.h' | xargs unix2dos
@@ -376,6 +385,7 @@ dist-src:
rm -f ../$(DIST_SRC_ZIP)
cd .. && zip -rv9 $(DIST_SRC_ZIP) $(DIST_DIR)
dos2unix $(TARDIR)/Makefile
+ dos2unix $(TARDIR)/auto/Makefile
dos2unix $(TARDIR)/config/*
dos2unix $(TARDIR)/auto/core/*
dos2unix $(TARDIR)/auto/extensions/*
diff --git a/auto/Makefile b/auto/Makefile
index 18ecbfb..64f59c4 100644
--- a/auto/Makefile
+++ b/auto/Makefile
@@ -11,11 +11,15 @@ include ../config/version
SHELL = bash
+### Use git repository for GL extension specifications
+
+GIT_CLONE ?= git clone --branch glew https://github.com/nigels-com/glfixes.git
+
###
### Conventional desktop OpenGL settings
###
-REGISTRY = registry/gl
+REGISTRY = registry/gl/specs
EXT = extensions/gl
FILTER = filter_gl_ext.sh
CORE = core/gl
@@ -38,11 +42,11 @@ BLACKLIST = blacklist
GL_CORE_SPEC := $(CORE)/GL_VERSION*
GLX_CORE_SPEC := $(CORE)/GLX_VERSION*
ifeq (custom,$(MAKECMDGOALS))
-#GL_CORE_SPEC := $(shell grep GL_VERSION custom.txt | sed 's/\(.*\)/$(CORE)\/\1/g;')
-GL_EXT_SPEC := $(shell grep "^[ \t]*GL_" custom.txt | grep -v GL_VERSION | sed 's/\(.*\)/$(EXT)\/\1/g;')
-WGL_EXT_SPEC := $(shell grep "^[ \t]*WGL_" custom.txt | sed 's/\(.*\)/$(EXT)\/\1/g;')
-#GLX_CORE_SPEC := $(shell grep GLX_VERSION custom.txt | sed 's/\(.*\)/$(CORE)\/\1/g;')
-GLX_EXT_SPEC := $(shell grep "^[ \t]*GLX_" custom.txt | grep -v GLX_VERSION | sed 's/\(.*\)/$(EXT)\/\1/g;')
+#GL_CORE_SPEC := $(shell grep GL_VERSION custom.txt | perl -pi -e "s=^=$(CORE)/=g;")
+GL_EXT_SPEC := $(shell grep "^[ \t]*GL_" custom.txt | grep -v GL_VERSION | perl -pi -e "s=^=$(EXT)/=g;")
+WGL_EXT_SPEC := $(shell grep "^[ \t]*WGL_" custom.txt | perl -pi -e "s=^=$(EXT)/=g;")
+#GLX_CORE_SPEC := $(shell grep GLX_VERSION custom.txt | perl -pi -e "s=^=$(CORE)/=g;")
+GLX_EXT_SPEC := $(shell grep "^[ \t]*GLX_" custom.txt | grep -v GLX_VERSION | perl -pi -e "s=^=$(EXT)/=g;")
else
GL_EXT_SPEC := $(EXT)/GL_*
WGL_EXT_SPEC := $(EXT)/WGL_*
@@ -97,11 +101,11 @@ all custom: $(I.TARGETS) $(S.TARGETS) $(D.TARGETS) $(B.TARGETS)
registry: $(REGISTRY)/.dummy
ext: $(EXT)/.dummy
-$(REGISTRY)/.dummy: $(BIN)/update_registry.sh
+$(REGISTRY)/.dummy:
@echo "--------------------------------------------------------------------"
@echo "Downloading registry"
@echo "--------------------------------------------------------------------"
- $(BIN)/update_registry.sh $(REGISTRY) $(REGISTRY_URL)
+ $(GIT_CLONE) registry
touch $@
$(EXT)/.dummy: $(REGISTRY)/.dummy
@@ -138,7 +142,7 @@ $(I.DEST)/glew.h: $(EXT)/.dummy
echo -e "\n#if defined(GLEW_MX) && !defined(_WIN32)\nstruct GLEWContextStruct\n{\n#endif /* GLEW_MX */\n" >> $@
$(BIN)/make_struct_var.pl GLEW_VAR_EXPORT $(GL_CORE_SPEC) $(GL_EXT_SPEC) >> $@
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 $@
+ 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_tail.h >> $@
@@ -165,14 +169,14 @@ $(I.DEST)/glxew.h: $(EXT)/.dummy
cat $(SRC)/mesa_license.h >> $@
cat $(SRC)/khronos_license.h >> $@
cat $(SRC)/glxew_head.h >> $@
- $(BIN)/make_header.pl '' GLX $(GLX_CORE_SPEC) >> $@
- $(BIN)/make_header.pl '' GLX $(GLX_EXT_SPEC) >> $@
+ $(BIN)/make_header.pl "" GLX $(GLX_CORE_SPEC) >> $@
+ $(BIN)/make_header.pl "" GLX $(GLX_EXT_SPEC) >> $@
cat $(SRC)/glxew_mid.h >> $@
$(BIN)/make_struct_fun.pl GLXEW_FUN_EXPORT $(GLX_CORE_SPEC) $(GLX_EXT_SPEC) >> $@
echo -e "\n#if defined(GLEW_MX)\nstruct GLXEWContextStruct\n{\n#endif /* GLEW_MX */\n" >> $@
$(BIN)/make_struct_var.pl GLXEW_VAR_EXPORT $(GLX_CORE_SPEC) $(GLX_EXT_SPEC) >> $@
echo -e "\n#ifdef GLEW_MX\n}; /* GLXEWContextStruct */\n#endif /* GLEW_MX */\n" >> $@
- perl -e 's/GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_2;/GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_0;\nGLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_1;\nGLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_2;/' -pi $@
+ perl -e "s/GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_2;/GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_0;\nGLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_1;\nGLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_2;/" -pi $@
cat $(SRC)/glxew_tail.h >> $@
$(S.DEST)/glew.c: $(EXT)/.dummy
@@ -193,8 +197,9 @@ $(S.DEST)/glew.c: $(EXT)/.dummy
$(BIN)/make_init.pl GL $(GL_CORE_SPEC) >> $@
$(BIN)/make_init.pl GL $(GL_EXT_SPEC) >> $@
cat $(SRC)/glew_init_gl.c >> $@
- $(BIN)/make_list.pl $(GL_CORE_SPEC) | grep -v '\"GL_VERSION' >> $@
- $(BIN)/make_list.pl $(GL_EXT_SPEC) >> $@
+ $(BIN)/make_list_gl.pl $(GL_CORE_SPEC) | grep -v '\"GL_VERSION' >> $@
+ cat $(SRC)/glew_init_gl_2.c >> $@
+ $(BIN)/make_list_gl.pl $(GL_EXT_SPEC) >> $@
echo -e "\n return GLEW_OK;\n}\n" >> $@
echo -e "\n#if defined(_WIN32)" >> $@
echo -e "\n#if !defined(GLEW_MX)" >> $@
@@ -270,6 +275,7 @@ $(S.DEST)/glew_init.c: $(EXT)/.dummy
$(BIN)/make_init.pl GL $(GL_EXT_SPEC) >> $@
cat $(SRC)/glew_init_gl.c >> $@
$(BIN)/make_list.pl $(GL_CORE_SPEC) | grep -v '\"GL_VERSION' >> $@
+ cat $(SRC)/glew_init_gl_2.c >> $@
$(BIN)/make_list.pl $(GL_EXT_SPEC) >> $@
echo -e "\n return GLEW_OK;\n}\n\n#if defined(_WIN32)\n" >> $@;
$(BIN)/make_init.pl WGL $(WGL_EXT_SPEC) >> $@
@@ -382,4 +388,4 @@ clobber: clean
rm -rf $(EXT)
destroy: clobber
- rm -rf $(REGISTRY)
+ rm -rf registry
diff --git a/auto/bin/filter_gl_ext.sh b/auto/bin/filter_gl_ext.sh
index 34a3214..ee2662f 100755
--- a/auto/bin/filter_gl_ext.sh
+++ b/auto/bin/filter_gl_ext.sh
@@ -434,5 +434,9 @@ EOT
grep -v 'GL_BYTE' $1/GL_OES_byte_coordinates > tmp
mv tmp $1/GL_OES_byte_coordinates
+# Filter out fp64 (not widely supported) from GL_EXT_direct_state_access
+ egrep -v 'glProgramUniform.*[1234]d[v]?EXT' $1/GL_EXT_direct_state_access > tmp
+ mv tmp $1/GL_EXT_direct_state_access
+
# clean up
rm -f $1/*.bak
diff --git a/auto/bin/make_list_gl.pl b/auto/bin/make_list_gl.pl
new file mode 100755
index 0000000..0ac08f5
--- /dev/null
+++ b/auto/bin/make_list_gl.pl
@@ -0,0 +1,66 @@
+#!/usr/bin/perl
+##
+## Copyright (C) 2002-2008, Marcelo E. Magallon
GLEW is distributed
-as source and precompiled binaries. The latest release is
-1.9.0
-[08-06-12]:
+as source and precompiled binaries.
+The latest release is
+1.9.0[08-06-12]:
@@ -44,13 +44,26 @@ as source and precompiled binaries. The latest release is +
-An up-to-date copy is also available from the project repository: +An up-to-date copy is also available using git:
+-git clone git://git.code.sf.net/p/glew/code glew-code +Unsupported snapshots are also available:
+diff --git a/auto/src/glew_head.c b/auto/src/glew_head.c index 252d55a..3bfd4d7 100644 --- a/auto/src/glew_head.c +++ b/auto/src/glew_head.c @@ -247,3 +247,18 @@ static GLboolean _glewSearchExtension (const char* name, const GLubyte *start, c } return GL_FALSE; } + +static GLboolean _glewSearchExtensionArray (const char* name, const GLubyte** start, const GLubyte** end) +{ + const GLubyte** p; + GLuint len = _glewStrLen((const GLubyte*)name); + p = start; + while (p < end) + { + GLuint n = _glewStrCLen(*p, ' '); + if (len == n && _glewStrSame((const GLubyte*)name, *p, n)) return GL_TRUE; + p += 1; + } + return GL_FALSE; +} + diff --git a/auto/src/glew_head.h b/auto/src/glew_head.h index 7a37ef4..6827b68 100644 --- a/auto/src/glew_head.h +++ b/auto/src/glew_head.h @@ -8,6 +8,9 @@ #if defined(__gl2_h_) #error gl2.h included before glew.h #endif +#if defined(__gltypes_h_) +#error gltypes.h included before glew.h +#endif #if defined(__REGAL_H__) #error Regal.h included before glew.h #endif @@ -21,6 +24,7 @@ #define __gl_h_ #define __gl2_h_ #define __GL_H__ +#define __gltypes_h_ #define __REGAL_H__ #define __X_GL_H #define __glext_h_ diff --git a/auto/src/glew_init_gl.c b/auto/src/glew_init_gl.c index 5f9bf65..8f7ad33 100644 --- a/auto/src/glew_init_gl.c +++ b/auto/src/glew_init_gl.c @@ -1,14 +1,38 @@ /* ------------------------------------------------------------------------- */ GLboolean GLEWAPIENTRY glewGetExtension (const char* name) -{ +{ const GLubyte* start; const GLubyte* end; - start = (const GLubyte*)glGetString(GL_EXTENSIONS); - if (start == 0) - return GL_FALSE; - end = start + _glewStrLen(start); - return _glewSearchExtension(name, start, end); + GLuint dot; + GLint numExt, i, major; + /* query opengl version to decide how to enumerate extensions */ + start = glGetString(GL_VERSION); + dot = _glewStrCLen(start, '.'); + if (dot == 0) + return GL_FALSE; + major = start[dot-1]-'0'; + + if (major >= 3) + { + glGetIntegerv(GL_NUM_EXTENSIONS, &numExt); + for(i = 0; i < numExt; ++i) + { + start = glGetStringi(GL_EXTENSIONS, i); + end = start + _glewStrLen(start); + if(_glewSearchExtension(name, start, end) == GL_TRUE) + return GL_TRUE; + } + } + else + { + start = (const GLubyte*)glGetString(GL_EXTENSIONS); + if (start == 0) + return GL_FALSE; + end = start + _glewStrLen(start); + return _glewSearchExtension(name, start, end); + } + return GL_FALSE; } /* ------------------------------------------------------------------------- */ @@ -21,6 +45,9 @@ GLenum GLEWAPIENTRY glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST) const GLubyte* s; GLuint dot; GLint major, minor; + const GLubyte* extArray[1000]; + const GLubyte** extArrayStart; + const GLubyte** extArrayEnd; const GLubyte* extStart; const GLubyte* extEnd; /* query opengl version */ @@ -62,10 +89,4 @@ GLenum GLEWAPIENTRY glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST) CONST_CAST(GLEW_VERSION_1_1) = GLEW_VERSION_1_2 == GL_TRUE || ( major == 1 && minor >= 1 ) ? GL_TRUE : GL_FALSE; } - /* query opengl extensions string */ - extStart = glGetString(GL_EXTENSIONS); - if (extStart == 0) - extStart = (const GLubyte*)""; - extEnd = extStart + _glewStrLen(extStart); - - /* initialize extensions */ + /* initialize core */ diff --git a/auto/src/glew_init_gl_2.c b/auto/src/glew_init_gl_2.c new file mode 100644 index 0000000..fe6f540 --- /dev/null +++ b/auto/src/glew_init_gl_2.c @@ -0,0 +1,44 @@ + + /* get extensions */ + if (GLEW_VERSION_3_0 == GL_TRUE) + { + GLint numExt; + GLint i; + glGetIntegerv(GL_NUM_EXTENSIONS, &numExt); + + for(i = 0; i < numExt; ++i) + { + extArray[i] = glGetStringi(GL_EXTENSIONS, i); + } + + extArrayStart = &extArray[0]; + extArrayEnd = &extArray[i]; + } + else + { + int i; + + extStart = glGetString(GL_EXTENSIONS); + if (extStart == 0) + extStart = (const GLubyte*)""; + extEnd = extStart + _glewStrLen(extStart); + i = 0; + + while (extStart < extEnd) + { + int len = _glewStrCLen(extStart, ' '); + + if (len > 0) + { + extArray[i] = extStart; + i += 1; + } + + extStart += len + 1; + } + + extArrayStart = &extArray[0]; + extArrayEnd = &extArray[i]; + } + + /* initialize extensions */ diff --git a/auto/src/header.html b/auto/src/header.html index d93f9e9..06e9467 100644 --- a/auto/src/header.html +++ b/auto/src/header.html @@ -59,9 +59,9 @@ THE POSSIBILITY OF SUCH DAMAGE.
Last Update: 08-06-12 |
Last Update: 07-15-13 |
diff --git a/doc/advanced.html b/doc/advanced.html index 1607d01..aff712a 100644 --- a/doc/advanced.html +++ b/doc/advanced.html @@ -59,9 +59,9 @@ THE POSSIBILITY OF SUCH DAMAGE. |
Source Generation |
Credits & Copyright |
Change Log |
Project Page |
Mailing Lists |
Bug Tracker |
Project Page |
Mailing Lists |
Bug Tracker |
Last Update: 08-06-12 |
Last Update: 07-15-13 |
diff --git a/doc/basic.html b/doc/basic.html index 3283ce9..87b0faa 100644 --- a/doc/basic.html +++ b/doc/basic.html @@ -59,9 +59,9 @@ THE POSSIBILITY OF SUCH DAMAGE. |
Source Generation |
Credits & Copyright |
Change Log |
Project Page |
Mailing Lists |
Bug Tracker |
Project Page |
Mailing Lists |
Bug Tracker |
Last Update: 08-06-12 |
Last Update: 07-15-13 |
diff --git a/doc/build.html b/doc/build.html index 91a4481..b949066 100644 --- a/doc/build.html +++ b/doc/build.html @@ -59,9 +59,9 @@ THE POSSIBILITY OF SUCH DAMAGE. |
Source Generation |
Credits & Copyright |
Change Log |
Project Page |
Mailing Lists |
Bug Tracker |
Project Page |
Mailing Lists |
Bug Tracker |
Last Update: 08-06-12 |
Last Update: 07-15-13 |
diff --git a/doc/credits.html b/doc/credits.html index 28d0b3f..6498de4 100644 --- a/doc/credits.html +++ b/doc/credits.html @@ -59,9 +59,9 @@ THE POSSIBILITY OF SUCH DAMAGE. |
Source Generation |
Credits & Copyright |
Change Log |
Project Page |
Mailing Lists |
Bug Tracker |
Project Page |
Mailing Lists |
Bug Tracker |
Last Update: 08-06-12 |
Last Update: 07-15-13 |
diff --git a/doc/glew.html b/doc/glew.html index 94f331e..794a64c 100644 --- a/doc/glew.html +++ b/doc/glew.html @@ -59,9 +59,9 @@ THE POSSIBILITY OF SUCH DAMAGE. |
Source Generation |
Credits & Copyright |
Change Log |
Project Page |
Mailing Lists |
Bug Tracker |
Project Page |
Mailing Lists |
Bug Tracker |