summaryrefslogtreecommitdiffstats
path: root/make
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-03-09 08:57:24 +0100
committerSven Gothel <[email protected]>2015-03-09 08:57:24 +0100
commit99d37df6cf410117cb8d49774ef7550bcf847c7b (patch)
treee0a8b810dfee33f0ff570bc9e9e3e80115935c96 /make
parente3385993b4133f88fd1b8e335438f5f2cd305555 (diff)
Bug 1135 - (Re-)Include GL header for in generated native code, allowing 'ProcAddrTypedef' validation
Include GL header for in generated native code, since we need the public 'ProcAddrTypedef' to be validated against the GlueGen generated variant by the c-compiler. The 'ProcAddrTypedef' validation semantic has been introduced in GlueGen w/ commit 10060b091b76bee35246c5165d49ab546ebc4e37. Originally the GL header were always included, however, JOGL commit 0d59bd4c655ef9a27f127000848aae7f07f240ae removed the inclusion to simplify handling GL extension collisions mitigated via gl*-supplement.h. The latter produces 'redefine' errors via c-compiler. The 'redefine' issue above is resolved by conditional code (#ifdef __GLUEGEN__ ..) in glext-supplement.h.
Diffstat (limited to 'make')
-rw-r--r--make/config/jogl/es1-headers.cfg8
-rw-r--r--make/config/jogl/es3-headers.cfg9
-rw-r--r--make/config/jogl/gl-common.cfg6
-rw-r--r--make/config/jogl/gl-es1.cfg2
-rw-r--r--make/config/jogl/gl-es3-impl.cfg2
-rw-r--r--make/config/jogl/gl-gl4bc.cfg2
-rw-r--r--make/config/jogl/gl-headers.cfg16
-rw-r--r--make/config/jogl/gl-if-es2.cfg2
-rw-r--r--make/config/jogl/gl-if-es3.cfg2
-rw-r--r--make/config/jogl/gl-if-gl.cfg2
-rw-r--r--make/config/jogl/gl-if-gl2.cfg2
-rw-r--r--make/config/jogl/gl-if-gl2_es1.cfg2
-rw-r--r--make/config/jogl/gl-if-gl2_es2.cfg2
-rw-r--r--make/config/jogl/gl-if-gl2_es3.cfg2
-rw-r--r--make/config/jogl/gl-if-gl2_gl3.cfg2
-rw-r--r--make/config/jogl/gl-if-gl2es3-subset.cfg2
-rw-r--r--make/config/jogl/gl-if-gl3_es3.cfg2
-rw-r--r--make/config/jogl/gl-if-gl3bc.cfg2
-rw-r--r--make/config/jogl/gl-if-gl4_es3.cfg2
-rw-r--r--make/config/jogl/glu-common.cfg4
-rw-r--r--make/config/jogl/glx-CustomCCode.c4
-rw-r--r--make/config/jogl/glx-headers.cfg29
-rw-r--r--make/config/jogl/glx-x11.cfg7
-rw-r--r--make/config/jogl/glxext.cfg4
-rw-r--r--make/config/jogl/wgl-win32.cfg8
-rw-r--r--make/config/jogl/wglext.cfg2
-rwxr-xr-xmake/scripts/tests-win.bat4
-rwxr-xr-xmake/scripts/tests-x64-dbg.bat4
-rw-r--r--make/scripts/tests.sh4
-rw-r--r--make/stub_includes/opengl/GL/gl-platform.h54
-rw-r--r--make/stub_includes/opengl/GL/gl.h4
-rw-r--r--make/stub_includes/opengl/GL/glext-supplement.h24
-rw-r--r--make/stub_includes/opengl/GL/glx.h13
-rw-r--r--make/stub_includes/opengl/GLES/glext-supplement.h1
-rw-r--r--make/stub_includes/opengl/GLES2/gl2ext-supplement.h1
-rw-r--r--make/stub_includes/opengl/gl2.c2
-rw-r--r--make/stub_includes/opengl/gl3bc.c2
-rw-r--r--make/stub_includes/opengl/gl4bc.c2
-rw-r--r--make/stub_includes/opengl/gles1.c2
-rw-r--r--make/stub_includes/opengl/gles2.c2
-rw-r--r--make/stub_includes/win32/wglext.c14
-rw-r--r--make/stub_includes/x11/glxext.c15
-rw-r--r--make/stub_includes/x11/window-system1.c15
43 files changed, 172 insertions, 118 deletions
diff --git a/make/config/jogl/es1-headers.cfg b/make/config/jogl/es1-headers.cfg
index e01d40498..6dc3696c3 100644
--- a/make/config/jogl/es1-headers.cfg
+++ b/make/config/jogl/es1-headers.cfg
@@ -1,5 +1,9 @@
CustomCCode #include <stdio.h> /* android */
CustomCCode #include <GLES/glplatform.h>
-CustomCCode #include <gl-types.h>
+CustomCCode // Define GL_GLEXT_PROTOTYPES so that the OpenGL extension prototypes in
+CustomCCode // "glext.h" are parsed.
+CustomCCode #define GL_GLEXT_PROTOTYPES
+CustomCCode #include <GLES/gl.h>
+CustomCCode #include <GLES/glext.h>
+CustomCCode #include <GLES/glext-supplement.h>
CustomCCode #include <stdlib.h>
-
diff --git a/make/config/jogl/es3-headers.cfg b/make/config/jogl/es3-headers.cfg
index bdf19fa4a..41f6d5a6b 100644
--- a/make/config/jogl/es3-headers.cfg
+++ b/make/config/jogl/es3-headers.cfg
@@ -1,4 +1,11 @@
CustomCCode #include <stdio.h> /* android */
CustomCCode #include <GLES2/gl2platform.h>
-CustomCCode #include <gl-types.h>
+CustomCCode // Define GL_GLEXT_PROTOTYPES so that the OpenGL extension prototypes in
+CustomCCode // "gl2ext.h" and "gl3ext.h" are parsed.
+CustomCCode #define GL_GLEXT_PROTOTYPES
+CustomCCode #include <GLES3/gl31.h>
+CustomCCode #include <GLES3/gl3ext.h>
+CustomCCode /** Shared between ES2 and ES3 .. */
+CustomCCode #include <GLES2/gl2ext.h>
+CustomCCode #include <GLES2/gl2ext-supplement.h>
CustomCCode #include <stdlib.h>
diff --git a/make/config/jogl/gl-common.cfg b/make/config/jogl/gl-common.cfg
index b881ce4d0..1711d962e 100644
--- a/make/config/jogl/gl-common.cfg
+++ b/make/config/jogl/gl-common.cfg
@@ -17,17 +17,17 @@ RelaxedEqualSemanticsTest true
# Inform the glue code generator of the association between #defines
# and functions and the extensions in which they are defined
# _for_ API documentation only!
-GLDocHeader GL/glext-supplement.h
GLDocHeader GL/gl.h
+GLDocHeader GL/glext-supplement.h
GLDocHeader GL/glext-20130207.h
GLDocHeader GL/glext.h
GLDocHeader GL/glcorearb.h
GLDocHeader GL/glcorearbext.h
-GLDocHeader GLES/glext-supplement.h
GLDocHeader GLES/gl.h
+GLDocHeader GLES/glext-supplement.h
GLDocHeader GLES/glext.h
-GLDocHeader GLES2/gl2ext-supplement.h
GLDocHeader GLES2/gl2.h
+GLDocHeader GLES2/gl2ext-supplement.h
GLDocHeader GLES2/gl2ext.h
GLDocHeader GLES3/gl31.h
GLDocHeader GLES3/gl3ext.h
diff --git a/make/config/jogl/gl-es1.cfg b/make/config/jogl/gl-es1.cfg
index 98d892247..6ce59770e 100644
--- a/make/config/jogl/gl-es1.cfg
+++ b/make/config/jogl/gl-es1.cfg
@@ -5,8 +5,8 @@ NativeOutputDir gensrc/native/jogl/es1
# Inform the glue code generator of the association between #defines
# and functions and the extensions in which they are defined
# _for_ code generation. This shall match the parsed header files!
-GLSemHeader GLES/glext-supplement.h
GLSemHeader GLES/gl.h
+GLSemHeader GLES/glext-supplement.h
GLSemHeader GLES/glext.h
ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/com/jogamp/opengl/GL.java
diff --git a/make/config/jogl/gl-es3-impl.cfg b/make/config/jogl/gl-es3-impl.cfg
index 443f91c1c..01ef034f6 100644
--- a/make/config/jogl/gl-es3-impl.cfg
+++ b/make/config/jogl/gl-es3-impl.cfg
@@ -5,9 +5,9 @@ NativeOutputDir gensrc/native/jogl/es3
# Inform the glue code generator of the association between #defines
# and functions and the extensions in which they are defined
# _for_ code generation. This shall match the parsed header files!
-GLSemHeader GLES2/gl2ext-supplement.h
GLSemHeader GLES3/gl31.h
GLSemHeader GLES3/gl3ext.h
+GLSemHeader GLES2/gl2ext-supplement.h
GLSemHeader GLES2/gl2ext.h
ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/com/jogamp/opengl/GL.java
diff --git a/make/config/jogl/gl-gl4bc.cfg b/make/config/jogl/gl-gl4bc.cfg
index 034faa59e..ae3ebb22f 100644
--- a/make/config/jogl/gl-gl4bc.cfg
+++ b/make/config/jogl/gl-gl4bc.cfg
@@ -5,8 +5,8 @@ NativeOutputDir gensrc/native/jogl/gl4
# Inform the glue code generator of the association between #defines
# and functions and the extensions in which they are defined
# _for_ code generation. This shall match the parsed header files!
-GLSemHeader GL/glext-supplement.h
GLSemHeader GL/gl.h
+GLSemHeader GL/glext-supplement.h
GLSemHeader GL/glext-20130207.h
GLSemHeader GL/glext.h
GLSemHeader GL/glcorearb.h
diff --git a/make/config/jogl/gl-headers.cfg b/make/config/jogl/gl-headers.cfg
index 3692cd804..7a5315ebb 100644
--- a/make/config/jogl/gl-headers.cfg
+++ b/make/config/jogl/gl-headers.cfg
@@ -1,13 +1,23 @@
CustomCCode #include <stdio.h> /* android */
CustomCCode #include <GL/gl-platform.h>
-CustomCCode #include <gl-types.h>
+CustomCCode // Define GL_GLEXT_PROTOTYPES so that the OpenGL extension prototypes in
+CustomCCode // "glext.h" are parsed.
+CustomCCode #define GL_GLEXT_PROTOTYPES
CustomCCode #if defined(_WIN32)
CustomCCode #include <stdlib.h>
CustomCCode #include <stddef.h>
CustomCCode #include <malloc.h>
+CustomCCode /* Include the OpenGL headers */
+CustomCCode #include <GL/gl.h>
+CustomCCode #include <GL/glext.h>
+CustomCCode #include <GL/glext-supplement.h>
CustomCCode #elif defined(__APPLE__)
CustomCCode #include <inttypes.h>
CustomCCode #include <stdlib.h>
+CustomCCode /* Include the OpenGL headers */
+CustomCCode #include <GL/gl.h>
+CustomCCode #include <GL/glext.h>
+CustomCCode #include <GL/glext-supplement.h>
CustomCCode #include <machine/types.h>
CustomCCode /* Provide Windows typedefs */
CustomCCode typedef void* LPVOID;
@@ -16,6 +26,10 @@ CustomCCode #elif defined(__unix__)
CustomCCode #include <inttypes.h>
CustomCCode #include <stdlib.h>
CustomCCode #include <X11/Xlib.h>
+CustomCCode /* Include the OpenGL headers */
+CustomCCode #include <GL/gl.h>
+CustomCCode #include <GL/glext.h>
+CustomCCode #include <GL/glext-supplement.h>
CustomCCode /* Provide Windows typedefs */
CustomCCode typedef void* LPVOID;
CustomCCode typedef unsigned int* PUINT;
diff --git a/make/config/jogl/gl-if-es2.cfg b/make/config/jogl/gl-if-es2.cfg
index 49b1973cc..4199f2069 100644
--- a/make/config/jogl/gl-if-es2.cfg
+++ b/make/config/jogl/gl-if-es2.cfg
@@ -5,8 +5,8 @@ NativeOutputDir gensrc/native/jogl/es2
# Inform the glue code generator of the association between #defines
# and functions and the extensions in which they are defined
# _for_ code generation. This shall match the parsed header files!
-GLSemHeader GLES2/gl2ext-supplement.h
GLSemHeader GLES2/gl2.h
+GLSemHeader GLES2/gl2ext-supplement.h
GLSemHeader GLES2/gl2ext.h
ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/com/jogamp/opengl/GL.java
diff --git a/make/config/jogl/gl-if-es3.cfg b/make/config/jogl/gl-if-es3.cfg
index cf56e9f0d..573a79f85 100644
--- a/make/config/jogl/gl-if-es3.cfg
+++ b/make/config/jogl/gl-if-es3.cfg
@@ -4,8 +4,8 @@ JavaOutputDir gensrc/classes
# Inform the glue code generator of the association between #defines
# and functions and the extensions in which they are defined
# _for_ code generation. This shall match the parsed header files!
-GLSemHeader GLES2/gl2ext-supplement.h
GLSemHeader GLES3/gl31.h
+GLSemHeader GLES2/gl2ext-supplement.h
GLSemHeader GLES3/gl3ext.h
GLSemHeader GLES2/gl2ext.h
diff --git a/make/config/jogl/gl-if-gl.cfg b/make/config/jogl/gl-if-gl.cfg
index 8716e5cdd..c9f93d35d 100644
--- a/make/config/jogl/gl-if-gl.cfg
+++ b/make/config/jogl/gl-if-gl.cfg
@@ -7,8 +7,8 @@ Extends GL GLBase
# Inform the glue code generator of the association between #defines
# and functions and the extensions in which they are defined
# _for_ code generation. This shall match the parsed header files!
-GLSemHeader GLES2/gl2ext-supplement.h
GLSemHeader GLES2/gl2.h
+GLSemHeader GLES2/gl2ext-supplement.h
GLSemHeader GLES2/gl2ext.h
ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/com/jogamp/opengl/GLBase.java
diff --git a/make/config/jogl/gl-if-gl2.cfg b/make/config/jogl/gl-if-gl2.cfg
index bff2e5fed..e539633ad 100644
--- a/make/config/jogl/gl-if-gl2.cfg
+++ b/make/config/jogl/gl-if-gl2.cfg
@@ -5,8 +5,8 @@ NativeOutputDir gensrc/native/jogl/gl2
# Inform the glue code generator of the association between #defines
# and functions and the extensions in which they are defined
# _for_ code generation. This shall match the parsed header files!
-GLSemHeader GL/glext-supplement.h
GLSemHeader GL/gl.h
+GLSemHeader GL/glext-supplement.h
GLSemHeader GL/glext-20130207.h
GLSemHeader GL/glext.h
diff --git a/make/config/jogl/gl-if-gl2_es1.cfg b/make/config/jogl/gl-if-gl2_es1.cfg
index 9fb2fbf83..c2484fcb2 100644
--- a/make/config/jogl/gl-if-gl2_es1.cfg
+++ b/make/config/jogl/gl-if-gl2_es1.cfg
@@ -11,8 +11,8 @@ Extends GL2ES1 GLLightingFunc
# Inform the glue code generator of the association between #defines
# and functions and the extensions in which they are defined
# _for_ code generation. This shall match the parsed header files!
-GLSemHeader GLES/glext-supplement.h
GLSemHeader GLES/gl.h
+GLSemHeader GLES/glext-supplement.h
GLSemHeader GLES/glext.h
ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/com/jogamp/opengl/GL.java
diff --git a/make/config/jogl/gl-if-gl2_es2.cfg b/make/config/jogl/gl-if-gl2_es2.cfg
index 97adaead1..a7e1dd333 100644
--- a/make/config/jogl/gl-if-gl2_es2.cfg
+++ b/make/config/jogl/gl-if-gl2_es2.cfg
@@ -5,8 +5,8 @@ NativeOutputDir gensrc/native/jogl
# Inform the glue code generator of the association between #defines
# and functions and the extensions in which they are defined
# _for_ code generation. This shall match the parsed header files!
-GLSemHeader GLES2/gl2ext-supplement.h
GLSemHeader GLES2/gl2.h
+GLSemHeader GLES2/gl2ext-supplement.h
GLSemHeader GLES2/gl2ext.h
ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/com/jogamp/opengl/GL.java
diff --git a/make/config/jogl/gl-if-gl2_es3.cfg b/make/config/jogl/gl-if-gl2_es3.cfg
index 34032d7b9..ecad4a188 100644
--- a/make/config/jogl/gl-if-gl2_es3.cfg
+++ b/make/config/jogl/gl-if-gl2_es3.cfg
@@ -5,8 +5,8 @@ NativeOutputDir gensrc/native/jogl
# Inform the glue code generator of the association between #defines
# and functions and the extensions in which they are defined
# _for_ code generation. This shall match the parsed header files!
-GLSemHeader GL/glext-supplement.h
GLSemHeader GL/gl.h
+GLSemHeader GL/glext-supplement.h
GLSemHeader GL/glext-20130207.h
GLSemHeader GL/glext.h
diff --git a/make/config/jogl/gl-if-gl2_gl3.cfg b/make/config/jogl/gl-if-gl2_gl3.cfg
index 02142b726..446bf0b6b 100644
--- a/make/config/jogl/gl-if-gl2_gl3.cfg
+++ b/make/config/jogl/gl-if-gl2_gl3.cfg
@@ -10,8 +10,8 @@ Extends GL2GL3 GL2ES3
# Inform the glue code generator of the association between #defines
# and functions and the extensions in which they are defined
# _for_ code generation. This shall match the parsed header files!
-GLSemHeader GL/glext-supplement.h
GLSemHeader GL/gl.h
+GLSemHeader GL/glext-supplement.h
GLSemHeader GL/glext-20130207.h
GLSemHeader GL/glext.h
diff --git a/make/config/jogl/gl-if-gl2es3-subset.cfg b/make/config/jogl/gl-if-gl2es3-subset.cfg
index 92099249c..f7c46e859 100644
--- a/make/config/jogl/gl-if-gl2es3-subset.cfg
+++ b/make/config/jogl/gl-if-gl2es3-subset.cfg
@@ -4,9 +4,9 @@ JavaOutputDir ../../build-temp/gluegen-set
# Inform the glue code generator of the association between #defines
# and functions and the extensions in which they are defined
# _for_ code generation. This shall match the parsed header files!
-GLSemHeader GLES2/gl2ext-supplement.h
GLSemHeader GLES3/gl31.h
GLSemHeader GLES3/gl3ext.h
+GLSemHeader GLES2/gl2ext-supplement.h
GLSemHeader GLES2/gl2ext.h
Package com.jogamp.opengl
diff --git a/make/config/jogl/gl-if-gl3_es3.cfg b/make/config/jogl/gl-if-gl3_es3.cfg
index a66e4897c..86823a3f4 100644
--- a/make/config/jogl/gl-if-gl3_es3.cfg
+++ b/make/config/jogl/gl-if-gl3_es3.cfg
@@ -5,9 +5,9 @@ NativeOutputDir gensrc/native/jogl
# Inform the glue code generator of the association between #defines
# and functions and the extensions in which they are defined
# _for_ code generation. This shall match the parsed header files!
-GLSemHeader GLES2/gl2ext-supplement.h
GLSemHeader GLES3/gl31.h
GLSemHeader GLES3/gl3ext.h
+GLSemHeader GLES2/gl2ext-supplement.h
GLSemHeader GLES2/gl2ext.h
Package com.jogamp.opengl
diff --git a/make/config/jogl/gl-if-gl3bc.cfg b/make/config/jogl/gl-if-gl3bc.cfg
index bf31ab3ae..1be0b8bcf 100644
--- a/make/config/jogl/gl-if-gl3bc.cfg
+++ b/make/config/jogl/gl-if-gl3bc.cfg
@@ -5,8 +5,8 @@ NativeOutputDir gensrc/native/jogl/gl3
# Inform the glue code generator of the association between #defines
# and functions and the extensions in which they are defined
# _for_ code generation. This shall match the parsed header files!
-GLSemHeader GL/glext-supplement.h
GLSemHeader GL/gl.h
+GLSemHeader GL/glext-supplement.h
GLSemHeader GL/glext-20130207.h
GLSemHeader GL/glext.h
GLSemHeader GL/glcorearb.h
diff --git a/make/config/jogl/gl-if-gl4_es3.cfg b/make/config/jogl/gl-if-gl4_es3.cfg
index 2b090eb91..776e82921 100644
--- a/make/config/jogl/gl-if-gl4_es3.cfg
+++ b/make/config/jogl/gl-if-gl4_es3.cfg
@@ -5,9 +5,9 @@ NativeOutputDir gensrc/native/jogl
# Inform the glue code generator of the association between #defines
# and functions and the extensions in which they are defined
# _for_ code generation. This shall match the parsed header files!
-GLSemHeader GLES2/gl2ext-supplement.h
GLSemHeader GLES3/gl31.h
GLSemHeader GLES3/gl3ext.h
+GLSemHeader GLES2/gl2ext-supplement.h
GLSemHeader GLES2/gl2ext.h
Package com.jogamp.opengl
diff --git a/make/config/jogl/glu-common.cfg b/make/config/jogl/glu-common.cfg
index bc039ee8d..ed80f1133 100644
--- a/make/config/jogl/glu-common.cfg
+++ b/make/config/jogl/glu-common.cfg
@@ -6,10 +6,6 @@ HierarchicalNativeOutput false
# Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums
TagNativeBinding true
-# Desktop GL and GLES* headers types slightly differ
-# but still are compatible related to actual storage size.
-RelaxedEqualSemanticsTest true
-
#
# Imports needed by all glue code
#
diff --git a/make/config/jogl/glx-CustomCCode.c b/make/config/jogl/glx-CustomCCode.c
index 7216e5b65..b4b4f5b0a 100644
--- a/make/config/jogl/glx-CustomCCode.c
+++ b/make/config/jogl/glx-CustomCCode.c
@@ -1,7 +1,3 @@
-#include <inttypes.h>
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <GL/glx.h>
/* Linux headers don't work properly */
#define __USE_GNU
#include <dlfcn.h>
diff --git a/make/config/jogl/glx-headers.cfg b/make/config/jogl/glx-headers.cfg
index b38881f74..d5d4f5f2d 100644
--- a/make/config/jogl/glx-headers.cfg
+++ b/make/config/jogl/glx-headers.cfg
@@ -1,40 +1,41 @@
CustomCCode #include <stdio.h> /* android */
-CustomCCode /** Define GL_GLEXT_PROTOTYPES so that the OpenGL extension prototypes are parsed. */
-CustomCCode #define GL_GLEXT_PROTOTYPES
+CustomCCode #include <GL/gl-platform.h>
CustomCCode #if defined(_WIN32)
-CustomCCode #define WIN32_LEAN_AND_MEAN
-CustomCCode #include <windows.h>
-CustomCCode #undef WIN32_LEAN_AND_MEAN
CustomCCode #include <stdlib.h>
CustomCCode #include <stddef.h>
CustomCCode #include <malloc.h>
-CustomCCode /* Define WGL_GLEXT_PROTOTYPES so that the OpenGL extension prototypes in
+CustomCCode /* Define WGL_WGLEXT_PROTOTYPES so that the OpenGL extension prototypes in
CustomCCode "wglext.h" are parsed. */
-CustomCCode #define WGL_GLEXT_PROTOTYPES
-CustomCCode /* Include the OpenGL headers */
-CustomCCode #include <GL/gl.h>
+CustomCCode #define WGL_WGLEXT_PROTOTYPES
+CustomCCode /* included implicit via windows header: #include <wingdi.h> */
+CustomCCode #include <gl-types.h>
CustomCCode #include <GL/wglext.h>
CustomCCode #elif defined(__APPLE__)
CustomCCode #include <inttypes.h>
CustomCCode #include <stdlib.h>
-CustomCCode #include <machine/types.h>
CustomCCode /* Provide Windows typedefs */
CustomCCode typedef void* LPVOID;
CustomCCode typedef unsigned int* PUINT;
CustomCCode /* Include the OpenGL headers */
CustomCCode #include <GL/gl.h>
+CustomCCode #include <GL/glext.h>
+CustomCCode #include <GL/glext-supplement.h>
+CustomCCode #include <machine/types.h>
+CustomCCode /* Provide Windows typedefs */
+CustomCCode typedef void* LPVOID;
+CustomCCode typedef unsigned int* PUINT;
CustomCCode #elif defined(__unix__)
CustomCCode #include <inttypes.h>
CustomCCode #include <stdlib.h>
CustomCCode #include <X11/Xlib.h>
-CustomCCode /* Provide Windows typedefs */
-CustomCCode typedef void* LPVOID;
-CustomCCode typedef unsigned int* PUINT;
CustomCCode /* Define GLX_GLXEXT_PROTOTYPES so that the OpenGL extension prototypes in
CustomCCode "glxext.h" are parsed. */
CustomCCode #define GLX_GLXEXT_PROTOTYPES
-CustomCCode #include <GL/gl.h>
+CustomCCode #include <gl-types.h>
CustomCCode #include <GL/glx.h>
CustomCCode #include <GL/glxext.h>
+CustomCCode /* Provide Windows typedefs */
+CustomCCode typedef void* LPVOID;
+CustomCCode typedef unsigned int* PUINT;
CustomCCode #endif
diff --git a/make/config/jogl/glx-x11.cfg b/make/config/jogl/glx-x11.cfg
index 8a127558f..17b5fa8d7 100644
--- a/make/config/jogl/glx-x11.cfg
+++ b/make/config/jogl/glx-x11.cfg
@@ -3,6 +3,10 @@
JavaOutputDir gensrc/classes
NativeOutputDir gensrc/native/jogl/X11
+#GLSemHeader GL/gl.h
+#GLSemHeader GL/glext-supplement.h
+#GLSemHeader GL/glext.h
+GLSemHeader gl-types.h
GLSemHeader GL/glx.h
GLSemHeader GL/glxext.h
@@ -30,7 +34,10 @@ CustomJavaCode GLX private static GLXProcAddressTable glxProcAddressTable = new
CustomJavaCode GLX public static GLXProcAddressTable getGLXProcAddressTable() { return glxProcAddressTable; }
IncludeAs CustomJavaCode GLX glx-CustomJavaCode.java
+
+Include glx-headers.cfg
IncludeAs CustomCCode glx-CustomCCode.c
+
ForceStaticInitCode GLX
ArgumentIsString XOpenDisplay 0
diff --git a/make/config/jogl/glxext.cfg b/make/config/jogl/glxext.cfg
index 7f3defe15..c6e6d2aa4 100644
--- a/make/config/jogl/glxext.cfg
+++ b/make/config/jogl/glxext.cfg
@@ -3,6 +3,10 @@
JavaOutputDir gensrc/classes
NativeOutputDir gensrc/native/jogl/X11
+#GLSemHeader GL/gl.h
+#GLSemHeader GL/glext-supplement.h
+#GLSemHeader GL/glext.h
+GLSemHeader gl-types.h
GLSemHeader GL/glx.h
GLSemHeader GL/glxext.h
diff --git a/make/config/jogl/wgl-win32.cfg b/make/config/jogl/wgl-win32.cfg
index c5c6db0db..b3db05cec 100644
--- a/make/config/jogl/wgl-win32.cfg
+++ b/make/config/jogl/wgl-win32.cfg
@@ -13,6 +13,7 @@ Include gl-common-extensions.cfg
Include gl-desktop.cfg
GLSemHeader wingdi.h
+GLSemHeader gl-types.h
GLSemHeader GL/wglext.h
ForceProcAddressGen __ALL__
@@ -39,12 +40,7 @@ CustomJavaCode WGL public static WGLProcAddressTable getWGLProcAddressTable() {
# of byte[]
ArgumentIsString wglGetProcAddress 0
-CustomCCode #define WIN32_LEAN_AND_MEAN
-CustomCCode #include <windows.h>
-CustomCCode #undef WIN32_LEAN_AND_MEAN
-CustomCCode #include <gluegen_stdint.h>
-CustomCCode #include <gluegen_stddef.h>
-CustomCCode #include <wingdi.h>
+Include glx-headers.cfg
DropUniqVendorExtensions AMD
# We need GL_APPLE_float_pixels for our pbuffer implementation
diff --git a/make/config/jogl/wglext.cfg b/make/config/jogl/wglext.cfg
index 6b5815fdf..4c0061372 100644
--- a/make/config/jogl/wglext.cfg
+++ b/make/config/jogl/wglext.cfg
@@ -18,6 +18,7 @@ NIOOnly __ALL__
NIODirectOnly __ALL__
GLSemHeader wingdi.h
+GLSemHeader gl-types.h
GLSemHeader GL/wglext.h
EmitProcAddressTable true
@@ -35,7 +36,6 @@ Include glx-headers.cfg
# JSR-239 NIO subset (remove once we have Java SE classes running on CVM)
# Inform the glue code generator of the association between #defines
# and functions and the extensions in which they are defined
-GLSemHeader GL/wglext.h
IgnoreExtension WGL_OML_sync_control
IgnoreExtension WGL_NV_gpu_affinity
diff --git a/make/scripts/tests-win.bat b/make/scripts/tests-win.bat
index 8a94a0fa2..e64e14b09 100755
--- a/make/scripts/tests-win.bat
+++ b/make/scripts/tests-win.bat
@@ -12,7 +12,7 @@ REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGe
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT -vsync -time 40000 -width 100 -height 100 -screen 0 %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.gl2.awt.TestGearsAWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2AWT %*
-scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2GLJPanelAWT %*
+REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2GLJPanelAWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2GLJPanelsAWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.awt.DemoGLJPanelPerf02AWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasAWT %*
@@ -175,7 +175,7 @@ REM scripts\java-win.bat com.jogamp.opengl.test.junit.newt.mm.TestScreenMode01bN
REM scripts\java-win.bat com.jogamp.opengl.test.junit.newt.mm.TestScreenMode01cNEWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.newt.mm.TestScreenMode01dNEWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.newt.mm.TestScreenMode02aNEWT %*
-REM scripts\java-win.bat com.jogamp.opengl.test.junit.newt.mm.TestScreenMode02bNEWT %*
+scripts\java-win.bat com.jogamp.opengl.test.junit.newt.mm.TestScreenMode02bNEWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.newt.mm.ManualScreenMode03sNEWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.newt.TestDisplayLifecycle01NEWT
diff --git a/make/scripts/tests-x64-dbg.bat b/make/scripts/tests-x64-dbg.bat
index 0439e0f78..55c1288dd 100755
--- a/make/scripts/tests-x64-dbg.bat
+++ b/make/scripts/tests-x64-dbg.bat
@@ -65,7 +65,7 @@ REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.Animator" "-Djogl.debug.GLC
REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.Animator" "-Djogl.debug.GLContext" "-Djogl.debug.GLContext.TraceSwitch"
REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.GLJPanel" "-Djogl.debug.TileRenderer" "-Djogl.debug.TileRenderer.PNG"
REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.GLJPanel" "-Djogl.debug.TileRenderer"
-set D_ARGS="-Djogl.debug.GLContext" "-Djogl.debug.GLJPanel"
+REM set D_ARGS="-Djogl.debug.GLContext" "-Djogl.debug.GLJPanel"
REM set D_ARGS="-Djogl.gljpanel.noverticalflip"
REM set D_ARGS="-Dnewt.debug=all"
REM set D_ARGS="-Dnewt.debug.Window"
@@ -82,7 +82,7 @@ REM set D_ARGS="-Dnativewindow.debug.TraceLock"
REM set D_ARGS="-Dnewt.debug.Display" "-Dnewt.debug.EDT" "-Dnewt.debug.Window"
REM set D_ARGS="-Dnewt.debug.Window" "-Dnewt.debug.Display" "-Dnewt.debug.EDT" "-Djogl.debug.GLContext"
REM set D_ARGS="-Dnewt.debug.Screen" "-Dnewt.debug.EDT" "-Dnativewindow.debug=all"
-REM set D_ARGS="-Dnewt.debug.Screen"
+set D_ARGS="-Dnewt.debug.Screen"
REM set D_ARGS="-Dnewt.debug.Screen" "-Dnewt.debug.Window"
REM set D_ARGS="-Dnewt.debug.Window" "-Dnewt.debug.Display" "-Dnewt.test.Window.reparent.incompatible=true"
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index f9239345b..b5e8cee6f 100644
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -397,7 +397,7 @@ function testawtswt() {
#testnoawt com.jogamp.newt.NewtVersion $*
#testnoawt com.jogamp.oculusvr.OVRVersion $*
-testnoawt com.jogamp.newt.opengl.GLWindow $*
+#testnoawt com.jogamp.newt.opengl.GLWindow $*
#testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLVersionParsing00NEWT $*
#testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestMainVersionGLWindowNEWT $*
#testawt com.jogamp.opengl.test.junit.jogl.acore.TestMainVersionGLCanvasAWT $*
@@ -621,7 +621,7 @@ testnoawt com.jogamp.newt.opengl.GLWindow $*
#testnoawt com.jogamp.opengl.test.junit.newt.mm.TestScreenMode01cNEWT $*
#testnoawt com.jogamp.opengl.test.junit.newt.mm.TestScreenMode01dNEWT $*
#testnoawt com.jogamp.opengl.test.junit.newt.mm.TestScreenMode02aNEWT $*
-#testnoawt com.jogamp.opengl.test.junit.newt.mm.TestScreenMode02bNEWT $*
+testnoawt com.jogamp.opengl.test.junit.newt.mm.TestScreenMode02bNEWT $*
#testnoawt com.jogamp.opengl.test.junit.newt.mm.ManualScreenMode03aNEWT $*
#testnoawt -Djava.awt.headless=true com.jogamp.opengl.test.junit.newt.TestGLWindows01NEWT $*
#testnoawt com.jogamp.opengl.test.junit.newt.TestGLWindowWarpPointer01NEWT $*
diff --git a/make/stub_includes/opengl/GL/gl-platform.h b/make/stub_includes/opengl/GL/gl-platform.h
index d55410b0a..f3680f28c 100644
--- a/make/stub_includes/opengl/GL/gl-platform.h
+++ b/make/stub_includes/opengl/GL/gl-platform.h
@@ -13,6 +13,20 @@
#define __WIN32__
#endif
+/*
+ * WINDOWS: Include windows.h here to define APIENTRY.
+ * It is also useful when applications include this file by
+ * including only glut.h, since glut.h depends on windows.h.
+ * Applications needing to include windows.h with parms other
+ * than "WIN32_LEAN_AND_MEAN" may include windows.h before
+ * glut.h or gl.h.
+ */
+#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
+#define WIN32_LEAN_AND_MEAN 1
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+#endif
+
#if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__))
# if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
# define GLAPI __declspec(dllexport)
@@ -31,32 +45,19 @@
# endif
# ifndef APIENTRY
# define APIENTRY
-# endif /* APIENTRY */
+# endif
#endif /* WIN32 / CYGWIN bracket */
-#if (defined(__BEOS__) && defined(__POWERPC__)) || defined(__QUICKDRAW__)
-# define PRAGMA_EXPORT_SUPPORTED 1
+#ifndef GLAPI
+#define GLAPI extern
#endif
-
-/*
- * WINDOWS: Include windows.h here to define APIENTRY.
- * It is also useful when applications include this file by
- * including only glut.h, since glut.h depends on windows.h.
- * Applications needing to include windows.h with parms other
- * than "WIN32_LEAN_AND_MEAN" may include windows.h before
- * glut.h or gl.h.
- */
-#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
-#define WIN32_LEAN_AND_MEAN 1
-#include <windows.h>
-#undef WIN32_LEAN_AND_MEAN
+#ifndef APIENTRYP
+#define APIENTRYP APIENTRY *
#endif
-/**
-#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) && !defined(__CYGWIN__)
-#include <gl/mesa_wgl.h>
+#if (defined(__BEOS__) && defined(__POWERPC__)) || defined(__QUICKDRAW__)
+# define PRAGMA_EXPORT_SUPPORTED 1
#endif
-*/
#if defined(macintosh) && PRAGMA_IMPORT_SUPPORTED
#pragma import on
@@ -70,18 +71,5 @@
#pragma export on
#endif
-/**
- * The defaults for all ..
- */
-#ifndef APIENTRY
-#define APIENTRY
-#endif
-#ifndef APIENTRYP
-#define APIENTRYP APIENTRY *
-#endif
-#ifndef GLAPI
-#define GLAPI extern
-#endif
-
#endif /* __gl_platform_h_ */
diff --git a/make/stub_includes/opengl/GL/gl.h b/make/stub_includes/opengl/GL/gl.h
index 56812a531..430846e29 100644
--- a/make/stub_includes/opengl/GL/gl.h
+++ b/make/stub_includes/opengl/GL/gl.h
@@ -1314,7 +1314,9 @@ GLAPI void APIENTRY glCopyTexSubImage2D( GLenum target, GLint level, GLint xoffs
#endif /* GL_VERSION_1_1 */
/* Include Post-GL 1.1 changes and extensions */
-#include <GL/glext.h>
+// Due to 'glext-supplement.h', we prefer to include it manually afterwards.
+// This gives us the same behavior as the vanilla GLES, GLES2, GLES3 and glcorearb header.
+// #include <GL/glext.h>
/**********************************************************************
diff --git a/make/stub_includes/opengl/GL/glext-supplement.h b/make/stub_includes/opengl/GL/glext-supplement.h
index cbcf7e0a7..0ea284f28 100644
--- a/make/stub_includes/opengl/GL/glext-supplement.h
+++ b/make/stub_includes/opengl/GL/glext-supplement.h
@@ -35,7 +35,6 @@ extern "C" {
/* Function declaration macros - to move into gl-platform.h */
#include "gl-platform.h"
-#include "gl-types.h"
/**
* GL_EXT_texture_storage == GL_ARB_texture_storage
@@ -74,9 +73,11 @@ extern "C" {
typedef void (APIENTRYP PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
typedef void (APIENTRYP PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
typedef void (APIENTRYP PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+#ifdef __GLUEGEN__
typedef void (APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+#endif
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glTexStorage1DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
GLAPI void APIENTRY glTexStorage2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
@@ -92,8 +93,14 @@ GLAPI void APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsize
* which collides from GL/glext.h. The latter is obsolete and has different semantics!
* This variant will override the 'odd' GL/glext.h one.
* See gl-common.cfg!
+ * This extension is only included while running GlueGen,
+ * due to redefined in glext.h under a different extension.
+ * However, native compilation will validate GlueGen's
+ * 'ProcAddrTypedef' w/ the glext.h variant!
*/
+#ifdef __GLUEGEN__
#ifndef GL_EXT_separate_shader_objects
+typedef char GLchar;
#define GL_EXT_separate_shader_objects 1
#define GL_ACTIVE_PROGRAM_EXT 0x8259
#define GL_VERTEX_SHADER_BIT_EXT 0x00000001
@@ -190,8 +197,21 @@ GLAPI void APIENTRY glProgramUniformMatrix2x4fvEXT (GLuint program, GLint locati
GLAPI void APIENTRY glProgramUniformMatrix4x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
GLAPI void APIENTRY glProgramUniformMatrix3x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
GLAPI void APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-#endif
+#endif /* GL_GLEXT_PROTOTYPES */
#endif /* GL_EXT_separate_shader_objects */
+#else /* __GLUEGEN_ */
+// GL/glext.h only has the non EXT (subsumed) variants of the following symbols
+typedef void (APIENTRYP PFNGLACTIVESHADERPROGRAMEXTPROC) (GLuint pipeline, GLuint program);
+typedef void (APIENTRYP PFNGLBINDPROGRAMPIPELINEEXTPROC) (GLuint pipeline);
+typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMVEXTPROC) (GLenum type, GLsizei count, const GLchar **strings);
+typedef void (APIENTRYP PFNGLDELETEPROGRAMPIPELINESEXTPROC) (GLsizei n, const GLuint *pipelines);
+typedef void (APIENTRYP PFNGLGENPROGRAMPIPELINESEXTPROC) (GLsizei n, GLuint *pipelines);
+typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEIVEXTPROC) (GLuint pipeline, GLenum pname, GLint *params);
+typedef GLboolean (APIENTRYP PFNGLISPROGRAMPIPELINEEXTPROC) (GLuint pipeline);
+typedef void (APIENTRYP PFNGLUSEPROGRAMSTAGESEXTPROC) (GLuint pipeline, GLbitfield stages, GLuint program);
+typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEEXTPROC) (GLuint pipeline);
+#endif /* __GLUEGEN_ */
#ifdef __cplusplus
}
diff --git a/make/stub_includes/opengl/GL/glx.h b/make/stub_includes/opengl/GL/glx.h
index a74cd23e8..dc4b85dac 100644
--- a/make/stub_includes/opengl/GL/glx.h
+++ b/make/stub_includes/opengl/GL/glx.h
@@ -44,8 +44,10 @@
#pragma message enable nosimpint
#endif
#endif
-#include <GL/gl.h>
+// Due to 'glext-supplement.h', we prefer to include it manually afterwards.
+// This gives us the same behavior as the vanilla GLES, GLES2, GLES3 and glcorearb header.
+// #include <GL/gl.h>
#if defined(USE_MGL_NAMESPACE)
#include <GL/glx_mangle.h>
@@ -176,7 +178,7 @@ typedef void ( *__GLXextFuncPtr)(void);
#define GLX_SAMPLE_BUFFERS 100000
#define GLX_SAMPLES 100001
typedef __GLXextFuncPtr ( *PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName);
-#ifdef GL_GLEXT_PROTOTYPES
+#ifdef GLX_GLXEXT_PROTOTYPES
__GLXextFuncPtr glXGetProcAddress (const GLubyte *procName);
#endif
#endif /* GLX_VERSION_1_4 */
@@ -184,13 +186,14 @@ __GLXextFuncPtr glXGetProcAddress (const GLubyte *procName);
#ifndef GLX_ARB_get_proc_address
#define GLX_ARB_get_proc_address 1
typedef __GLXextFuncPtr ( *PFNGLXGETPROCADDRESSARBPROC) (const GLubyte *procName);
-#ifdef GL_GLEXT_PROTOTYPES
+#ifdef GLX_GLXEXT_PROTOTYPES
__GLXextFuncPtr glXGetProcAddressARB (const GLubyte *procName);
#endif
#endif /* GLX_ARB_get_proc_address */
-
-#include <GL/glxext.h>
+// Due to 'glext-supplement.h', we prefer to include it manually afterwards.
+// This gives us the same behavior as the vanilla GLES, GLES2, GLES3 and glcorearb header.
+// #include <GL/glxext.h>
#ifdef __cplusplus
}
diff --git a/make/stub_includes/opengl/GLES/glext-supplement.h b/make/stub_includes/opengl/GLES/glext-supplement.h
index 034c23827..da3e97df6 100644
--- a/make/stub_includes/opengl/GLES/glext-supplement.h
+++ b/make/stub_includes/opengl/GLES/glext-supplement.h
@@ -29,7 +29,6 @@ extern "C" {
*/
#include <GLES/glplatform.h>
-#include "gl-types.h"
#ifndef GL_APIENTRYP
#define GL_APIENTRYP GL_APIENTRY*
diff --git a/make/stub_includes/opengl/GLES2/gl2ext-supplement.h b/make/stub_includes/opengl/GLES2/gl2ext-supplement.h
index 7cf5395b3..812f6abcd 100644
--- a/make/stub_includes/opengl/GLES2/gl2ext-supplement.h
+++ b/make/stub_includes/opengl/GLES2/gl2ext-supplement.h
@@ -34,7 +34,6 @@ extern "C" {
*/
#include <GLES2/gl2platform.h>
-#include "gl-types.h"
#ifndef GL_APIENTRYP
#define GL_APIENTRYP GL_APIENTRY*
diff --git a/make/stub_includes/opengl/gl2.c b/make/stub_includes/opengl/gl2.c
index 037d67d0b..343b6bafd 100644
--- a/make/stub_includes/opengl/gl2.c
+++ b/make/stub_includes/opengl/gl2.c
@@ -4,6 +4,6 @@
// "glext.h" are parsed.
#define GL_GLEXT_PROTOTYPES
-#include <GL/glext-supplement.h>
#include <GL/gl.h>
+#include <GL/glext-supplement.h>
#include <GL/glext.h>
diff --git a/make/stub_includes/opengl/gl3bc.c b/make/stub_includes/opengl/gl3bc.c
index 81f7a50d6..78006575d 100644
--- a/make/stub_includes/opengl/gl3bc.c
+++ b/make/stub_includes/opengl/gl3bc.c
@@ -3,8 +3,8 @@
// Define GL_GLEXT_PROTOTYPES so that the OpenGL extension prototypes are parsed.
#define GL_GLEXT_PROTOTYPES
-#include <GL/glext-supplement.h>
#include <GL/gl.h>
+#include <GL/glext-supplement.h>
#include <GL/glext.h>
#include <GL/glcorearbext.h>
diff --git a/make/stub_includes/opengl/gl4bc.c b/make/stub_includes/opengl/gl4bc.c
index 81f7a50d6..78006575d 100644
--- a/make/stub_includes/opengl/gl4bc.c
+++ b/make/stub_includes/opengl/gl4bc.c
@@ -3,8 +3,8 @@
// Define GL_GLEXT_PROTOTYPES so that the OpenGL extension prototypes are parsed.
#define GL_GLEXT_PROTOTYPES
-#include <GL/glext-supplement.h>
#include <GL/gl.h>
+#include <GL/glext-supplement.h>
#include <GL/glext.h>
#include <GL/glcorearbext.h>
diff --git a/make/stub_includes/opengl/gles1.c b/make/stub_includes/opengl/gles1.c
index f8ae02f44..2b0ed5946 100644
--- a/make/stub_includes/opengl/gles1.c
+++ b/make/stub_includes/opengl/gles1.c
@@ -5,6 +5,6 @@
// "glext.h" are parsed.
#define GL_GLEXT_PROTOTYPES
-#include <GLES/glext-supplement.h>
#include <GLES/gl.h>
+#include <GLES/glext-supplement.h>
#include <GLES/glext.h>
diff --git a/make/stub_includes/opengl/gles2.c b/make/stub_includes/opengl/gles2.c
index a1e108803..cba5de136 100644
--- a/make/stub_includes/opengl/gles2.c
+++ b/make/stub_includes/opengl/gles2.c
@@ -5,7 +5,7 @@
// "gl2ext.h" are parsed.
#define GL_GLEXT_PROTOTYPES
-#include <GLES2/gl2ext-supplement.h>
#include <GLES2/gl2.h>
+#include <GLES2/gl2ext-supplement.h>
#include <GLES2/gl2ext.h>
diff --git a/make/stub_includes/win32/wglext.c b/make/stub_includes/win32/wglext.c
index 60c1f74ac..5a3e759e5 100644
--- a/make/stub_includes/win32/wglext.c
+++ b/make/stub_includes/win32/wglext.c
@@ -1,14 +1,18 @@
#define GLAPI
-// Define GL_GLEXT_PROTOTYPES so that the OpenGL extension prototypes in
-// "glext.h" are parsed.
-#define GL_GLEXT_PROTOTYPES
+#include <GL/gl-platform.h>
+
+// Define GL_GLEXT_PROTOTYPES so that the OpenGL GLX extension prototypes in
+// "glx.h" are parsed.
+// #define GL_GLEXT_PROTOTYPES
+// #include <GL/gl.h>
+// #include <GL/glext-supplement.h>
+// #include <GL/glext.h>
+#include <gl-types.h>
-#include <GL/gl.h>
// Bring in the wgl extensions
#define WGL_WGLEXT_PROTOTYPES
-#define SKIP_WGL_HANDLE_DEFINITIONS
#include <windows.h>
#include <wingdi_types.h>
#include <GL/wglext.h>
diff --git a/make/stub_includes/x11/glxext.c b/make/stub_includes/x11/glxext.c
index e781b6e88..35ed63b5b 100644
--- a/make/stub_includes/x11/glxext.c
+++ b/make/stub_includes/x11/glxext.c
@@ -4,14 +4,21 @@
#define _Xconst const
#endif /* _Xconst */
+#include <GL/gl-platform.h>
+
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+
// Define GL_GLEXT_PROTOTYPES so that the OpenGL GLX extension prototypes in
// "glx.h" are parsed.
-#define GL_GLEXT_PROTOTYPES
+// #define GL_GLEXT_PROTOTYPES
+// #include <GL/gl.h>
+// #include <GL/glext-supplement.h>
+// #include <GL/glext.h>
+#include <gl-types.h>
// Define GLX_GLXEXT_PROTOTYPES so that the OpenGL GLX extension prototypes in
// "glxext.h" are parsed.
#define GLX_GLXEXT_PROTOTYPES
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
#include <GL/glx.h>
-// GL/glxext.h included by GL/glx.h
+#include <GL/glxext.h>
diff --git a/make/stub_includes/x11/window-system1.c b/make/stub_includes/x11/window-system1.c
index e781b6e88..35ed63b5b 100644
--- a/make/stub_includes/x11/window-system1.c
+++ b/make/stub_includes/x11/window-system1.c
@@ -4,14 +4,21 @@
#define _Xconst const
#endif /* _Xconst */
+#include <GL/gl-platform.h>
+
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+
// Define GL_GLEXT_PROTOTYPES so that the OpenGL GLX extension prototypes in
// "glx.h" are parsed.
-#define GL_GLEXT_PROTOTYPES
+// #define GL_GLEXT_PROTOTYPES
+// #include <GL/gl.h>
+// #include <GL/glext-supplement.h>
+// #include <GL/glext.h>
+#include <gl-types.h>
// Define GLX_GLXEXT_PROTOTYPES so that the OpenGL GLX extension prototypes in
// "glxext.h" are parsed.
#define GLX_GLXEXT_PROTOTYPES
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
#include <GL/glx.h>
-// GL/glxext.h included by GL/glx.h
+#include <GL/glxext.h>