summaryrefslogtreecommitdiffstats
path: root/make
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2003-07-03 00:09:30 +0000
committerKenneth Russel <[email protected]>2003-07-03 00:09:30 +0000
commit93d272a0525ec57aa3cd584f15cde6cf2a637e0c (patch)
tree3d6c9f2a305539d26c7449566bbb0d72bf74b12c /make
parent37d90a0da397a1958fb101051170a60f871fb8cc (diff)
Added pbuffer support to JOGL on X11; HWShadowmapsSimple and
ProceduralTexturePhysics demos are now working on Linux with the appropriate hardware. Moved core GLX routines out of the public GLX interface; this allowed XVisualInfo (and the new GLXFBConfig) to be removed from the public API. Added support to GlueGen for returning arrays of pointers as arrays of StructAccessors in Java and for choosing the typedef name for a pointer-to-struct if the struct itself does not have a typedef name. Added support to GLEmitter to emit ProcAddressTables under arbitrary names and to support arbitrary mechanisms for fetching those tables. Made GLU (on all platforms) and GLX (on X11) be dynamically linked. Refactored ProcAddressTable filling to be mostly shared code. Tested changes on Linux, Mac OS X and Windows. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@17 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'make')
-rw-r--r--make/Makefile219
-rw-r--r--make/gl-common.cfg16
-rw-r--r--make/gl-glx-common.cfg64
-rw-r--r--make/gl-glx-macosx.cfg10
-rw-r--r--make/gl-glx-x11.cfg8
-rw-r--r--make/gl-impl-macosx.cfg2
-rw-r--r--make/gl-impl-win32.cfg2
-rw-r--r--make/gl-impl-x11.cfg2
-rw-r--r--make/glu-impl-common-CustomJavaCode.java13
-rw-r--r--make/glu-impl-common.cfg5
-rw-r--r--make/glu-impl-macosx.cfg2
-rw-r--r--make/glu-impl-x11.cfg4
-rw-r--r--make/glx-x11.cfg86
-rw-r--r--make/stub_includes/opengl/GL/glu.h61
-rw-r--r--make/stub_includes/win32/windows.h1
-rw-r--r--make/stub_includes/win32/wingdi.h3
-rw-r--r--make/stub_includes/x11/X11/X.h1
-rw-r--r--make/stub_includes/x11/X11/Xutil.h5
-rw-r--r--make/stub_includes/x11/window-system.c138
-rw-r--r--make/wingdi-win32.cfg2
20 files changed, 275 insertions, 169 deletions
diff --git a/make/Makefile2 b/make/Makefile2
index cf9b6f655..91b9d6641 100644
--- a/make/Makefile2
+++ b/make/Makefile2
@@ -156,6 +156,7 @@ GG_JAVAFILES = \
$(GLUEGEN_DIR)/StructLayout.java \
$(GLUEGEN_DIR)/TypeInfo.java \
$(GLUEGEN_DIR)/runtime/BufferFactory.java \
+ $(GLUEGEN_DIR)/runtime/ProcAddressHelper.java \
$(GLUEGEN_DIR)/runtime/StructAccessor.java \
$(GLUEGEN_DIR)/opengl/ConvertFromGL4Java.java \
$(GLUEGEN_DIR)/opengl/CGLPAWrapperEmitter.java \
@@ -394,6 +395,7 @@ JOGL_JAVAFILES_WINDOWS = \
JOGL_GENERATED_JAVAFILES_WINDOWS = \
$(GENSRC_JOGL_IMPL_DIR)/windows/BITMAPINFO.java \
$(GENSRC_JOGL_IMPL_DIR)/windows/BITMAPINFOHEADER.java \
+ $(GENSRC_JOGL_IMPL_DIR)/windows/GLProcAddressTable.java \
$(GENSRC_JOGL_IMPL_DIR)/windows/JAWT_Win32DrawingSurfaceInfo.java \
$(GENSRC_JOGL_IMPL_DIR)/windows/PIXELFORMATDESCRIPTOR.java \
$(GENSRC_JOGL_IMPL_DIR)/windows/RGBQUAD.java \
@@ -408,12 +410,17 @@ JOGL_JAVAFILES_X11 = \
$(JOGL_IMPL_DIR)/x11/X11GLContext.java \
$(JOGL_IMPL_DIR)/x11/X11GLContextFactory.java \
$(JOGL_IMPL_DIR)/x11/X11OnscreenGLContext.java \
- $(JOGL_IMPL_DIR)/x11/X11OffscreenGLContext.java
+ $(JOGL_IMPL_DIR)/x11/X11OffscreenGLContext.java \
+ $(JOGL_IMPL_DIR)/x11/X11PbufferGLContext.java
JOGL_GENERATED_JAVAFILES_X11 = \
+ $(GENSRC_JOGL_IMPL_DIR)/x11/GLProcAddressTable.java \
$(GENSRC_JOGL_IMPL_DIR)/x11/GLX.java \
+ $(GENSRC_JOGL_IMPL_DIR)/x11/GLXFBConfig.java \
+ $(GENSRC_JOGL_IMPL_DIR)/x11/GLXProcAddressTable.java \
$(GENSRC_JOGL_IMPL_DIR)/x11/JAWT_X11DrawingSurfaceInfo.java \
- $(GENSRC_JOGL_IMPL_DIR)/x11/X11GLImpl.java
+ $(GENSRC_JOGL_IMPL_DIR)/x11/X11GLImpl.java \
+ $(GENSRC_JOGL_IMPL_DIR)/x11/XVisualInfo.java
JOGL_GENERATED_CFILES_X11 = \
$(GENSRC_GL_NATIVE_DIR)/GLX_JNI.c \
@@ -429,6 +436,7 @@ JOGL_JAVAFILES_MACOSX = \
JOGL_GENERATED_JAVAFILES_MACOSX = \
$(GENSRC_JOGL_IMPL_DIR)/macosx/CGL.java \
+ $(GENSRC_JOGL_IMPL_DIR)/macosx/GLProcAddressTable.java \
$(GENSRC_JOGL_IMPL_DIR)/macosx/JAWT_MacOSXDrawingSurfaceInfo.java \
$(GENSRC_JOGL_IMPL_DIR)/macosx/MacOSXGLImpl.java
@@ -478,7 +486,7 @@ JOGL_GENERATED_CFILES_PD=$(JOGL_GENERATED_CFILES_WINDOWS)
GL_DEFINES=/D "JOGL_EXPORTS" $(DEFINES)
GL_INCLUDES=/I"$(JOGL_STUB_INCLUDES_DIR_OPENGL)" $(INCLUDES)
GL_C_BUILD_OBJ_CMD=$(CC) /c $< $(CFLAGS) $(GL_INCLUDES) $(GL_DEFINES) /Fo"$@"
-JOGL_DSO_LINK_ADDITIONAL_LIBS=opengl32.lib glu32.lib jawt.lib gdi32.lib
+JOGL_DSO_LINK_ADDITIONAL_LIBS=opengl32.lib glu32.lib jawt.lib gdi32.lib kernel32.lib
GL_LINKFLAGS=$(LINKFLAGS) $(JOGL_DSO_LINK_ADDITIONAL_LIBS)
GL_C_LINK_DSO_CMD=$(LINK) /OUT:"$@" $(GL_LINKFLAGS)
endif # WIN32
@@ -551,16 +559,15 @@ JOGL_GENERATED_JAVAFILES = \
$(GENSRC_JOGL_DIR)/WGL.java \
$(GENSRC_JOGL_DIR)/GLX.java \
$(GENSRC_JOGL_DIR)/CGL.java \
- $(GENSRC_JOGL_DIR)/XVisualInfo.java \
$(GENSRC_JOGL_GLU_DIR)/GLU.java \
$(GENSRC_JOGL_GLU_DIR)/GLUquadric.java \
$(GENSRC_JOGL_GLU_IMPL_DIR)/GLUImpl.java \
+ $(GENSRC_JOGL_GLU_IMPL_DIR)/GLUProcAddressTable.java \
$(GENSRC_JOGL_IMPL_DIR)/JAWT.java \
$(GENSRC_JOGL_IMPL_DIR)/JAWTFactory.java \
$(GENSRC_JOGL_IMPL_DIR)/JAWT_DrawingSurface.java \
$(GENSRC_JOGL_IMPL_DIR)/JAWT_DrawingSurfaceInfo.java \
$(GENSRC_JOGL_IMPL_DIR)/JAWT_Rectangle.java \
- $(GENSRC_JOGL_IMPL_DIR)/ProcAddressTable.java \
$(GENSRC_JOGL_IMPL_DIR)/StaticGLInfo.java \
$(JOGL_GENERATED_JAVAFILES_PD)
@@ -878,7 +885,7 @@ $(JOGL_GENERATED_JAVAFILES) $(JOGL_GENERATED_CFILES) : $(JOGL_STUB_INCLUDES_PD)
$(JAVA) -cp "$(CLASSES_DIR)$(CP_SEPARATOR)$(CLASSPATH)" net.java.games.gluegen.GlueGen -Enet.java.games.gluegen.JavaEmitter -C$(JOGL_JAWT_CFG) $(JOGL_GLUEGEN_INCLUDES) -I"$(JAVA_INCLUDE_PATH)" "$(JAVA_INCLUDE_PATH_PD)/jawt_md.h"
# generate WGL/GLX/CGL implementation class
- $(JAVA) -cp "$(CLASSES_DIR)$(CP_SEPARATOR)$(CLASSPATH)" net.java.games.gluegen.GlueGen -Enet.java.games.gluegen.JavaEmitter -C$(JOGL_WINDOW_SYSTEM_CFG) $(JOGL_GLUEGEN_INCLUDES) -I$(JOGL_STUB_INCLUDES_DIR_OPENGL) $(JOGL_STUB_INCLUDES_DIR_PD)/window-system.c
+ $(JAVA) -cp "$(CLASSES_DIR)$(CP_SEPARATOR)$(CLASSPATH)" net.java.games.gluegen.GlueGen -Enet.java.games.gluegen.opengl.GLEmitter -C$(JOGL_WINDOW_SYSTEM_CFG) $(JOGL_GLUEGEN_INCLUDES) -I$(JOGL_STUB_INCLUDES_DIR_OPENGL) $(JOGL_STUB_INCLUDES_DIR_PD)/window-system.c
# generate StaticGLInfo class
$(JAVA) -cp "$(CLASSES_DIR)$(CP_SEPARATOR)$(CLASSPATH)" net.java.games.gluegen.opengl.BuildStaticGLInfo net.java.games.jogl.impl $(GENSRC_JOGL_IMPL_DIR) $(JOGL_HEADERS)
diff --git a/make/gl-common.cfg b/make/gl-common.cfg
index f824432d0..32664d7a0 100644
--- a/make/gl-common.cfg
+++ b/make/gl-common.cfg
@@ -7,6 +7,7 @@ RuntimeExceptionType GLException
# Imports needed by all glue code
Import java.nio.*
Import net.java.games.jogl.*
+Import net.java.games.jogl.impl.*
# Don't output #defines of GL version identifier strings as constants,
# because we don't need them java-side.
@@ -362,10 +363,6 @@ Opaque long __GLXextFuncPtr
Opaque boolean Bool
Opaque long Display *
Opaque long GLXContext
-Opaque long GLXFBConfig
-Opaque long GLXFBConfig *
-Opaque long GLXFBConfigSGIX
-Opaque long GLXFBConfigSGIX *
Opaque long Visual *
# Ignore the empty Display and Visual data structures (though made
# opaque, the references from XVisualInfo and elsewhere are still
@@ -377,3 +374,14 @@ Ignore Visual
ArgumentIsString glXGetProcAddress 0
ArgumentIsString glXGetProcAddressARB 0
ReturnsString glXQueryExtensionsString
+ReturnsString glXQueryServerString
+ReturnsString glXGetClientString
+TemporaryCVariableDeclaration glXChooseFBConfig int count;
+TemporaryCVariableAssignment glXChooseFBConfig count = _ptr3[0];
+ReturnValueLength glXChooseFBConfig count
+TemporaryCVariableDeclaration glXChooseFBConfigSGIX int count;
+TemporaryCVariableAssignment glXChooseFBConfigSGIX count = _ptr3[0];
+ReturnValueLength glXChooseFBConfigSGIX count
+TemporaryCVariableDeclaration glXGetFBConfigs int count;
+TemporaryCVariableAssignment glXGetFBConfigs count = _ptr2[0];
+ReturnValueLength glXGetFBConfigs count
diff --git a/make/gl-glx-common.cfg b/make/gl-glx-common.cfg
new file mode 100644
index 000000000..2c3a4b4dd
--- /dev/null
+++ b/make/gl-glx-common.cfg
@@ -0,0 +1,64 @@
+# This .cfg file causes the core GLX routines to be ignored from both
+# the public API as well as from the GL implementation files on
+# non-X11 platforms.
+
+# Ignore all of the core GLX routines, which are exposed only in the
+# implementation GLX class
+Ignore glXChooseVisual
+Ignore glXCreateContext
+Ignore glXDestroyContext
+Ignore glXMakeCurrent
+Ignore glXCopyContext
+Ignore glXSwapBuffers
+Ignore glXCreateGLXPixmap
+Ignore glXDestroyGLXPixmap
+Ignore glXQueryExtension
+Ignore glXQueryVersion
+Ignore glXIsDirect
+Ignore glXGetConfig
+Ignore glXGetCurrentContext
+Ignore glXGetCurrentDrawable
+Ignore glXWaitGL
+Ignore glXWaitX
+Ignore glXUseXFont
+Ignore glXQueryExtensionsString
+Ignore glXQueryServerString
+Ignore glXGetClientString
+Ignore glXGetCurrentDisplay
+Ignore glXChooseFBConfig
+Ignore glXGetFBConfigAttrib
+Ignore glXGetFBConfigs
+Ignore glXGetVisualFromFBConfig
+Ignore glXCreateWindow
+Ignore glXDestroyWindow
+Ignore glXCreatePixmap
+Ignore glXDestroyPixmap
+Ignore glXCreatePbuffer
+Ignore glXDestroyPbuffer
+Ignore glXQueryDrawable
+Ignore glXCreateNewContext
+Ignore glXMakeContextCurrent
+Ignore glXGetCurrentReadDrawable
+Ignore glXQueryContext
+Ignore glXSelectEvent
+Ignore glXGetSelectedEvent
+Ignore glXGetProcAddress
+
+# Ignore a few extensions that bring in data types we don't want to
+# expose in the public API (and that are useless anyway without
+# exposing more of the implementation)
+Ignore glXGetFBConfigAttribSGIX
+Ignore glXChooseFBConfigSGIX
+Ignore glXCreateGLXPixmapWithConfigSGIX
+Ignore glXCreateContextWithConfigSGIX
+Ignore glXGetVisualFromFBConfigSGIX
+Ignore glXGetFBConfigFromVisualSGIX
+Ignore glXCreateGLXPbufferSGIX
+Ignore glXDestroyGLXPbufferSGIX
+Ignore glXQueryGLXPbufferSGIX
+Ignore glXSelectEventSGIX
+Ignore glXGetSelectedEventSGIX
+Ignore glXCreateGLXPixmapMESA
+
+# Now we can ignore the GLXFBConfig data type in the public API
+Ignore GLXFBConfig
diff --git a/make/gl-glx-macosx.cfg b/make/gl-glx-macosx.cfg
deleted file mode 100644
index 7a6d826ce..000000000
--- a/make/gl-glx-macosx.cfg
+++ /dev/null
@@ -1,10 +0,0 @@
-# This .cfg file is used to generate the interface which contains the
-# window system-specific extensions which are exposed (via
-# inheritance) to the GL interface.
-Package net.java.games.jogl
-Style InterfaceOnly
-JavaClass MacOSXGL
-Include gl-common-macosx.cfg
-
-# Ignore everything that doesn't start with glX, GLX or XVisualInfo
-IgnoreNot ^(glX|GLX|XVisualInf).+
diff --git a/make/gl-glx-x11.cfg b/make/gl-glx-x11.cfg
index 99292615a..359e35c62 100644
--- a/make/gl-glx-x11.cfg
+++ b/make/gl-glx-x11.cfg
@@ -6,5 +6,9 @@ Style InterfaceOnly
JavaClass GLX
Include gl-common-x11.cfg
-# Ignore everything that doesn't start with glX, GLX or XVisualInfo
-IgnoreNot ^(glX|GLX|XVisualInf).+
+# Ignore everything that doesn't start with glX or GLX
+IgnoreNot ^(glX|GLX).+
+
+# Pick up ignores that must also be included in other platforms' impl
+# files
+Include gl-glx-common.cfg
diff --git a/make/gl-impl-macosx.cfg b/make/gl-impl-macosx.cfg
index 5ada8af01..5aa8ea786 100644
--- a/make/gl-impl-macosx.cfg
+++ b/make/gl-impl-macosx.cfg
@@ -6,8 +6,10 @@ JavaClass GL
ImplPackage net.java.games.jogl.impl.macosx
ImplJavaClass MacOSXGLImpl
Include gl-common-macosx.cfg
+Include gl-glx-common.cfg
EmitProcAddressTable true
+ProcAddressTableClassName GLProcAddressTable
CustomCCode #include <inttypes.h>
diff --git a/make/gl-impl-win32.cfg b/make/gl-impl-win32.cfg
index caa65180e..4891bd490 100644
--- a/make/gl-impl-win32.cfg
+++ b/make/gl-impl-win32.cfg
@@ -6,8 +6,10 @@ JavaClass GL
ImplPackage net.java.games.jogl.impl.windows
ImplJavaClass WindowsGLImpl
Include gl-common-win32.cfg
+Include gl-glx-common.cfg
EmitProcAddressTable true
+ProcAddressTableClassName GLProcAddressTable
CustomCCode #define WIN32_LEAN_AND_MEAN
CustomCCode #include <windows.h>
diff --git a/make/gl-impl-x11.cfg b/make/gl-impl-x11.cfg
index 35595e829..2ec48039e 100644
--- a/make/gl-impl-x11.cfg
+++ b/make/gl-impl-x11.cfg
@@ -6,8 +6,10 @@ JavaClass GL
ImplPackage net.java.games.jogl.impl.x11
ImplJavaClass X11GLImpl
Include gl-common-x11.cfg
+Include gl-glx-common.cfg
EmitProcAddressTable true
+ProcAddressTableClassName GLProcAddressTable
# Pick up XVisualInfo from jogl
Ignore XVisualInfo
diff --git a/make/glu-impl-common-CustomJavaCode.java b/make/glu-impl-common-CustomJavaCode.java
index 8722ea64a..04505db55 100644
--- a/make/glu-impl-common-CustomJavaCode.java
+++ b/make/glu-impl-common-CustomJavaCode.java
@@ -1,8 +1,11 @@
-/** WARNING: this function is not yet implemented! */
+/** Indicates whether the given GLU routine is available to be called. */
public boolean isFunctionAvailable(String gluFunctionName)
{
- // TODO FIXME: Implement the GLU equivalent GL.isFunctionAvailable(String)
- if (true) throw new GLException("GLU.isFunctionAvailable is not yet implemented.");
-
- return false;
+ return (gluProcAddressTable.getAddressFor(gluFunctionName) != 0);
+}
+
+private GLUProcAddressTable gluProcAddressTable;
+public GLUImpl(GLUProcAddressTable gluProcAddressTable)
+{
+ this.gluProcAddressTable = gluProcAddressTable;
}
diff --git a/make/glu-impl-common.cfg b/make/glu-impl-common.cfg
index d4fdb7911..1e6ae0699 100644
--- a/make/glu-impl-common.cfg
+++ b/make/glu-impl-common.cfg
@@ -5,9 +5,12 @@ Include glu-common.cfg
Style ImplOnly
+EmitProcAddressTable true
+ProcAddressTableClassName GLUProcAddressTable
+GetProcAddressTableExpr gluProcAddressTable
+
# Custom Java code for GLUImpl class
IncludeAs CustomJavaCode GLUImpl glu-impl-common-CustomJavaCode.java
# Custom C code for GLUImpl class
IncludeAs CustomCCode glu-impl-common-CustomCCode.c
-
diff --git a/make/glu-impl-macosx.cfg b/make/glu-impl-macosx.cfg
index cf40212d0..5e856c7ec 100644
--- a/make/glu-impl-macosx.cfg
+++ b/make/glu-impl-macosx.cfg
@@ -2,3 +2,5 @@
# Mac OS X.
Include glu-impl-common.cfg
+
+CustomCCode #include <inttypes.h>
diff --git a/make/glu-impl-x11.cfg b/make/glu-impl-x11.cfg
index 42e97a00e..3e46a73b5 100644
--- a/make/glu-impl-x11.cfg
+++ b/make/glu-impl-x11.cfg
@@ -3,8 +3,6 @@
Include glu-impl-common.cfg
-# !! FIXME: Chris doesn't have access to X11 yet, so he
-# doesn't know what CustomCCode directives to put in here.
-
+CustomCCode #include <inttypes.h>
diff --git a/make/glx-x11.cfg b/make/glx-x11.cfg
index f9a69c0b3..39098f0a8 100644
--- a/make/glx-x11.cfg
+++ b/make/glx-x11.cfg
@@ -5,13 +5,24 @@ JavaClass GLX
Style allstatic
Include gl-common-x11.cfg
+EmitProcAddressTable true
+ProcAddressTableClassName GLXProcAddressTable
+GetProcAddressTableExpr glxProcAddressTable
+# This must be present for bootstrapping
+SkipProcAddressGen glXGetProcAddressARB
+
+CustomJavaCode GLX private static GLXProcAddressTable glxProcAddressTable = new GLXProcAddressTable();
+CustomJavaCode GLX public static GLXProcAddressTable getGLXProcAddressTable() { return glxProcAddressTable; }
+CustomJavaCode GLX public static native long dlsym(String name);
+
CustomCCode #include <inttypes.h>
CustomCCode #include <X11/Xlib.h>
CustomCCode #include <X11/Xutil.h>
CustomCCode #include <GL/glx.h>
-
-# Pick up XVisualInfo from jogl
-Ignore XVisualInfo
+CustomCCode /* Linux headers don't work properly */
+CustomCCode #define __USE_GNU
+CustomCCode #include <dlfcn.h>
+CustomCCode #undef __USE_GNU
ArgumentIsString XOpenDisplay 0
@@ -26,3 +37,72 @@ CustomCCode JNIEXPORT jlong JNICALL
CustomCCode Java_net_java_games_jogl_impl_x11_GLX_RootWindow(JNIEnv *env, jclass _unused, jlong display, jint screen) {
CustomCCode return RootWindow((Display*) (intptr_t) display, screen);
CustomCCode }
+CustomCCode JNIEXPORT jlong JNICALL
+CustomCCode Java_net_java_games_jogl_impl_x11_GLX_dlsym(JNIEnv *env, jclass _unused, jstring name) {
+CustomCCode const jbyte* chars;
+CustomCCode void* res;
+CustomCCode chars = (*env)->GetStringUTFChars(env, name, NULL);
+CustomCCode res = dlsym(RTLD_DEFAULT, chars);
+CustomCCode (*env)->ReleaseStringUTFChars(env, name, chars);
+CustomCCode return (jlong) ((intptr_t) res);
+CustomCCode }
+
+# Ignore everything not in the GLX core (up through GLX 1.4) aside from glXGetProcAddress
+# FIXME: this needs to be kept in sync with the stub headers more than usual
+Ignore glXFreeContextEXT
+Ignore glXGetContextIDEXT
+Ignore glXGetCurrentDisplayEXT
+Ignore glXImportContextEXT
+Ignore glXQueryContextInfoEXT
+
+Ignore glXCopySubBufferMESA
+Ignore glXCreateGLXPixmapMESA
+Ignore glXReleaseBuffersMESA
+Ignore glXSet3DfxModeMESA
+
+Ignore glXGetSyncValuesOML
+Ignore glXGetMscRateOML
+Ignore glXSwapBuffersMscOML
+Ignore glXWaitForMscOML
+Ignore glXWaitForSbcOML
+
+Ignore glXAllocateMemoryNV
+Ignore glXFreeMemoryNV
+
+Ignore glXCushionSGI
+Ignore glXGetVideoSyncSGI
+Ignore glXWaitVideoSyncSGI
+Ignore glXSwapIntervalSGI
+Ignore glXMakeCurrentReadSGI
+Ignore glXGetCurrentReadDrawableSGI
+
+Ignore glXCreateGLXVideoSourceSGIX
+Ignore glXDestroyGLXVideoSourceSGIX
+Ignore glXGetFBConfigAttribSGIX
+Ignore glXChooseFBConfigSGIX
+Ignore glXCreateGLXPixmapWithConfigSGIX
+Ignore glXCreateContextWithConfigSGIX
+Ignore glXGetVisualFromFBConfigSGIX
+Ignore glXGetFBConfigFromVisualSGIX
+Ignore glXCreateGLXPbufferSGIX
+Ignore glXDestroyGLXPbufferSGIX
+Ignore glXQueryGLXPbufferSGIX
+Ignore glXSelectEventSGIX
+Ignore glXGetSelectedEventSGIX
+Ignore glXBindChannelToWindowSGIX
+Ignore glXChannelRectSGIX
+Ignore glXQueryChannelRectSGIX
+Ignore glXQueryChannelDeltasSGIX
+Ignore glXChannelRectSyncSGIX
+Ignore glXAssociateDMPbufferSGIX
+Ignore glXJoinSwapGroupSGIX
+Ignore glXBindSwapBarrierSGIX
+Ignore glXQueryMaxSwapBarriersSGIX
+
+Ignore glXGetTransparentIndexSUN
+
+# Ignore non-GLX GL routines and constants
+Ignore ^GL_.+
+Ignore TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB
+Ignore CLAMP_TO_EDGE_EXT
+Ignore ^gl[^X].+
diff --git a/make/stub_includes/opengl/GL/glu.h b/make/stub_includes/opengl/GL/glu.h
index 89c3f34e3..8f64238f2 100644
--- a/make/stub_includes/opengl/GL/glu.h
+++ b/make/stub_includes/opengl/GL/glu.h
@@ -330,6 +330,67 @@ GLAPI void GLAPIENTRY gluTessVertex (GLUtesselator* tess, GLdouble *location, GL
GLAPI GLint GLAPIENTRY gluUnProject (GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* objX, GLdouble* objY, GLdouble* objZ);
GLAPI GLint GLAPIENTRY gluUnProject4 (GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble nearVal, GLdouble farVal, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW);
+
+typedef void (GLAPIENTRY * PFNGLUBEGINCURVEPROC) (GLUnurbs* nurb);
+typedef void (GLAPIENTRY * PFNGLUBEGINPOLYGONPROC) (GLUtesselator* tess);
+typedef void (GLAPIENTRY * PFNGLUBEGINSURFACEPROC) (GLUnurbs* nurb);
+typedef void (GLAPIENTRY * PFNGLUBEGINTRIMPROC) (GLUnurbs* nurb);
+typedef GLint (GLAPIENTRY * PFNGLUBUILD1DMIPMAPLEVELSPROC) (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
+typedef GLint (GLAPIENTRY * PFNGLUBUILD1DMIPMAPSPROC) (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, const void *data);
+typedef GLint (GLAPIENTRY * PFNGLUBUILD2DMIPMAPLEVELSPROC) (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
+typedef GLint (GLAPIENTRY * PFNGLUBUILD2DMIPMAPSPROC) (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data);
+typedef GLint (GLAPIENTRY * PFNGLUBUILD3DMIPMAPLEVELSPROC) (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
+typedef GLint (GLAPIENTRY * PFNGLUBUILD3DMIPMAPSPROC) (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data);
+typedef GLboolean (GLAPIENTRY * PFNGLUCHECKEXTENSIONPROC) (const GLubyte *extName, const GLubyte *extString);
+typedef void (GLAPIENTRY * PFNGLUCYLINDERPROC) (GLUquadric* quad, GLdouble base, GLdouble top, GLdouble height, GLint slices, GLint stacks);
+typedef void (GLAPIENTRY * PFNGLUDELETENURBSRENDERERPROC) (GLUnurbs* nurb);
+typedef void (GLAPIENTRY * PFNGLUDELETEQUADRICPROC) (GLUquadric* quad);
+typedef void (GLAPIENTRY * PFNGLUDELETETESSPROC) (GLUtesselator* tess);
+typedef void (GLAPIENTRY * PFNGLUDISKPROC) (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops);
+typedef void (GLAPIENTRY * PFNGLUENDCURVEPROC) (GLUnurbs* nurb);
+typedef void (GLAPIENTRY * PFNGLUENDPOLYGONPROC) (GLUtesselator* tess);
+typedef void (GLAPIENTRY * PFNGLUENDSURFACEPROC) (GLUnurbs* nurb);
+typedef void (GLAPIENTRY * PFNGLUENDTRIMPROC) (GLUnurbs* nurb);
+typedef const GLubyte * (GLAPIENTRY * PFNGLUERRORSTRINGPROC) (GLenum error);
+typedef void (GLAPIENTRY * PFNGLUGETNURBSPROPERTYPROC) (GLUnurbs* nurb, GLenum property, GLfloat* data);
+typedef const GLubyte * (GLAPIENTRY * PFNGLUGETSTRINGPROC) (GLenum name);
+typedef void (GLAPIENTRY * PFNGLUGETTESSPROPERTYPROC) (GLUtesselator* tess, GLenum which, GLdouble* data);
+typedef void (GLAPIENTRY * PFNGLULOADSAMPLINGMATRICESPROC) (GLUnurbs* nurb, const GLfloat *model, const GLfloat *perspective, const GLint *view);
+typedef void (GLAPIENTRY * PFNGLULOOKATPROC) (GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ, GLdouble centerX, GLdouble centerY, GLdouble centerZ, GLdouble upX, GLdouble upY, GLdouble upZ);
+typedef GLUnurbs* (GLAPIENTRY * PFNGLUNEWNURBSRENDERERPROC) (void);
+typedef GLUquadric* (GLAPIENTRY * PFNGLUNEWQUADRICPROC) (void);
+typedef GLUtesselator* (GLAPIENTRY * PFNGLUNEWTESSPROC) (void);
+typedef void (GLAPIENTRY * PFNGLUNEXTCONTOURPROC) (GLUtesselator* tess, GLenum type);
+typedef void (GLAPIENTRY * PFNGLUNURBSCALLBACKPROC) (GLUnurbs* nurb, GLenum which, _GLUfuncptr CallBackFunc);
+typedef void (GLAPIENTRY * PFNGLUNURBSCALLBACKDATAPROC) (GLUnurbs* nurb, GLvoid* userData);
+typedef void (GLAPIENTRY * PFNGLUNURBSCALLBACKDATAEXTPROC) (GLUnurbs* nurb, GLvoid* userData);
+typedef void (GLAPIENTRY * PFNGLUNURBSCURVEPROC) (GLUnurbs* nurb, GLint knotCount, GLfloat *knots, GLint stride, GLfloat *control, GLint order, GLenum type);
+typedef void (GLAPIENTRY * PFNGLUNURBSPROPERTYPROC) (GLUnurbs* nurb, GLenum property, GLfloat value);
+typedef void (GLAPIENTRY * PFNGLUNURBSSURFACEPROC) (GLUnurbs* nurb, GLint sKnotCount, GLfloat* sKnots, GLint tKnotCount, GLfloat* tKnots, GLint sStride, GLint tStride, GLfloat* control, GLint sOrder, GLint tOrder, GLenum type);
+typedef void (GLAPIENTRY * PFNGLUORTHO2DPROC) (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top);
+typedef void (GLAPIENTRY * PFNGLUPARTIALDISKPROC) (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops, GLdouble start, GLdouble sweep);
+typedef void (GLAPIENTRY * PFNGLUPERSPECTIVEPROC) (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);
+typedef void (GLAPIENTRY * PFNGLUPICKMATRIXPROC) (GLdouble x, GLdouble y, GLdouble delX, GLdouble delY, GLint *viewport);
+typedef GLint (GLAPIENTRY * PFNGLUPROJECTPROC) (GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* winX, GLdouble* winY, GLdouble* winZ);
+typedef void (GLAPIENTRY * PFNGLUPWLCURVEPROC) (GLUnurbs* nurb, GLint count, GLfloat* data, GLint stride, GLenum type);
+typedef void (GLAPIENTRY * PFNGLUQUADRICCALLBACKPROC) (GLUquadric* quad, GLenum which, _GLUfuncptr CallBackFunc);
+typedef void (GLAPIENTRY * PFNGLUQUADRICDRAWSTYLEPROC) (GLUquadric* quad, GLenum draw);
+typedef void (GLAPIENTRY * PFNGLUQUADRICNORMALSPROC) (GLUquadric* quad, GLenum normal);
+typedef void (GLAPIENTRY * PFNGLUQUADRICORIENTATIONPROC) (GLUquadric* quad, GLenum orientation);
+typedef void (GLAPIENTRY * PFNGLUQUADRICTEXTUREPROC) (GLUquadric* quad, GLboolean texture);
+typedef GLint (GLAPIENTRY * PFNGLUSCALEIMAGEPROC) (GLenum format, GLsizei wIn, GLsizei hIn, GLenum typeIn, const void *dataIn, GLsizei wOut, GLsizei hOut, GLenum typeOut, GLvoid* dataOut);
+typedef void (GLAPIENTRY * PFNGLUSPHEREPROC) (GLUquadric* quad, GLdouble radius, GLint slices, GLint stacks);
+typedef void (GLAPIENTRY * PFNGLUTESSBEGINCONTOURPROC) (GLUtesselator* tess);
+typedef void (GLAPIENTRY * PFNGLUTESSBEGINPOLYGONPROC) (GLUtesselator* tess, GLvoid* data);
+typedef void (GLAPIENTRY * PFNGLUTESSCALLBACKPROC) (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc);
+typedef void (GLAPIENTRY * PFNGLUTESSENDCONTOURPROC) (GLUtesselator* tess);
+typedef void (GLAPIENTRY * PFNGLUTESSENDPOLYGONPROC) (GLUtesselator* tess);
+typedef void (GLAPIENTRY * PFNGLUTESSNORMALPROC) (GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ);
+typedef void (GLAPIENTRY * PFNGLUTESSPROPERTYPROC) (GLUtesselator* tess, GLenum which, GLdouble data);
+typedef void (GLAPIENTRY * PFNGLUTESSVERTEXPROC) (GLUtesselator* tess, GLdouble *location, GLvoid* data);
+typedef GLint (GLAPIENTRY * PFNGLUUNPROJECTPROC) (GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* objX, GLdouble* objY, GLdouble* objZ);
+typedef GLint (GLAPIENTRY * PFNGLUUNPROJECT4PROC) (GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble nearVal, GLdouble farVal, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW);
+
#ifdef __cplusplus
}
#endif
diff --git a/make/stub_includes/win32/windows.h b/make/stub_includes/win32/windows.h
index 24b9df4fa..fa4ae1c95 100644
--- a/make/stub_includes/win32/windows.h
+++ b/make/stub_includes/win32/windows.h
@@ -20,6 +20,7 @@ typedef HANDLE HBITMAP;
typedef HANDLE HDC;
typedef HANDLE HGDIOBJ;
typedef HANDLE HGLRC;
+typedef HANDLE HMODULE;
typedef HANDLE HPALETTE;
typedef HANDLE HWND;
typedef long LONG;
diff --git a/make/stub_includes/win32/wingdi.h b/make/stub_includes/win32/wingdi.h
index 5365a8990..3cb6f8568 100644
--- a/make/stub_includes/win32/wingdi.h
+++ b/make/stub_includes/win32/wingdi.h
@@ -115,6 +115,8 @@ typedef struct tagPIXELFORMATDESCRIPTOR
// Windows routines
WINBASEAPI DWORD WINAPI GetLastError(VOID);
+WINBASEAPI HMODULE WINAPI LoadLibraryA(LPCSTR lpLibFileName);
+WINBASEAPI PROC WINAPI GetProcAddress(HMODULE hModule, LPCSTR lpProcName);
// OpenGL-related routines
WINGDIAPI int WINAPI ChoosePixelFormat(HDC, CONST PIXELFORMATDESCRIPTOR *);
@@ -148,4 +150,3 @@ WINGDIAPI HBITMAP WINAPI CreateDIBSection(HDC, CONST BITMAPINFO *, UINT, VOID **
WINGDIAPI BOOL WINAPI DeleteDC(HDC);
WINGDIAPI BOOL WINAPI DeleteObject(HGDIOBJ);
WINGDIAPI HGDIOBJ WINAPI SelectObject(HDC, HGDIOBJ);
-
diff --git a/make/stub_includes/x11/X11/X.h b/make/stub_includes/x11/X11/X.h
index 8aa8500cb..2cd64bbf0 100644
--- a/make/stub_includes/x11/X11/X.h
+++ b/make/stub_includes/x11/X11/X.h
@@ -10,6 +10,7 @@ typedef unsigned long VisualID;
typedef XID Colormap;
typedef XID Cursor;
typedef XID Drawable;
+typedef XID Font;
typedef XID GContext;
typedef XID KeySym;
typedef XID Pixmap;
diff --git a/make/stub_includes/x11/X11/Xutil.h b/make/stub_includes/x11/X11/Xutil.h
index 017f8fb98..32c8d5be5 100644
--- a/make/stub_includes/x11/X11/Xutil.h
+++ b/make/stub_includes/x11/X11/Xutil.h
@@ -1,3 +1,6 @@
+#ifndef _XUTIL_H_
+#define _XUTIL_H_
+
#include <X11/X.h>
#include <X11/Xlib.h>
@@ -30,3 +33,5 @@ typedef struct {
#define VisualColormapSizeMask 0x80
#define VisualBitsPerRGBMask 0x100
#define VisualAllMask 0x1FF
+
+#endif /* #defined _XUTIL_H_ */
diff --git a/make/stub_includes/x11/window-system.c b/make/stub_includes/x11/window-system.c
index 55e70c7f7..6af85eeb9 100644
--- a/make/stub_includes/x11/window-system.c
+++ b/make/stub_includes/x11/window-system.c
@@ -1,140 +1,10 @@
-/*
- * Essential glX and supporting routines and data structures extracted
- * from glx.h.
- *
- * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
- */
+// 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>
-
-/*
- * Tokens for glXChooseVisual and glXGetConfig:
- */
-#define GLX_USE_GL 1
-#define GLX_BUFFER_SIZE 2
-#define GLX_LEVEL 3
-#define GLX_RGBA 4
-#define GLX_DOUBLEBUFFER 5
-#define GLX_STEREO 6
-#define GLX_AUX_BUFFERS 7
-#define GLX_RED_SIZE 8
-#define GLX_GREEN_SIZE 9
-#define GLX_BLUE_SIZE 10
-#define GLX_ALPHA_SIZE 11
-#define GLX_DEPTH_SIZE 12
-#define GLX_STENCIL_SIZE 13
-#define GLX_ACCUM_RED_SIZE 14
-#define GLX_ACCUM_GREEN_SIZE 15
-#define GLX_ACCUM_BLUE_SIZE 16
-#define GLX_ACCUM_ALPHA_SIZE 17
-
-/*
- * Error codes returned by glXGetConfig:
- */
-#define GLX_BAD_SCREEN 1
-#define GLX_BAD_ATTRIBUTE 2
-#define GLX_NO_EXTENSION 3
-#define GLX_BAD_VISUAL 4
-#define GLX_BAD_CONTEXT 5
-#define GLX_BAD_VALUE 6
-#define GLX_BAD_ENUM 7
-
-/*
- * GLX 1.3 and later:
- */
-#define GLX_CONFIG_CAVEAT 0x20
-#define GLX_DONT_CARE 0xFFFFFFFF
-#define GLX_SLOW_CONFIG 0x8001
-#define GLX_NON_CONFORMANT_CONFIG 0x800D
-#define GLX_X_VISUAL_TYPE 0x22
-#define GLX_TRANSPARENT_TYPE 0x23
-#define GLX_TRANSPARENT_INDEX_VALUE 0x24
-#define GLX_TRANSPARENT_RED_VALUE 0x25
-#define GLX_TRANSPARENT_GREEN_VALUE 0x26
-#define GLX_TRANSPARENT_BLUE_VALUE 0x27
-#define GLX_TRANSPARENT_ALPHA_VALUE 0x28
-#define GLX_MAX_PBUFFER_WIDTH 0x8016
-#define GLX_MAX_PBUFFER_HEIGHT 0x8017
-#define GLX_MAX_PBUFFER_PIXELS 0x8018
-#define GLX_PRESERVED_CONTENTS 0x801B
-#define GLX_LARGEST_PBUFFER 0x801C
-#define GLX_WIDTH 0x801D
-#define GLX_HEIGHT 0x801E
-#define GLX_EVENT_MASK 0x801F
-#define GLX_DRAWABLE_TYPE 0x8010
-#define GLX_FBCONFIG_ID 0x8013
-#define GLX_VISUAL_ID 0x800B
-#define GLX_WINDOW_BIT 0x00000001
-#define GLX_PIXMAP_BIT 0x00000002
-#define GLX_PBUFFER_BIT 0x00000004
-#define GLX_AUX_BUFFERS_BIT 0x00000010
-#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001
-#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002
-#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004
-#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008
-#define GLX_DEPTH_BUFFER_BIT 0x00000020
-#define GLX_STENCIL_BUFFER_BIT 0x00000040
-#define GLX_ACCUM_BUFFER_BIT 0x00000080
-#define GLX_DRAWABLE_TYPE 0x8010
-#define GLX_RENDER_TYPE 0x8011
-#define GLX_X_RENDERABLE 0x8012
-#define GLX_NONE 0x8000
-#define GLX_TRUE_COLOR 0x8002
-#define GLX_DIRECT_COLOR 0x8003
-#define GLX_PSEUDO_COLOR 0x8004
-#define GLX_STATIC_COLOR 0x8005
-#define GLX_GRAY_SCALE 0x8006
-#define GLX_STATIC_GRAY 0x8007
-#define GLX_TRANSPARENT_RGB 0x8008
-#define GLX_TRANSPARENT_INDEX 0x8009
-#define GLX_RGBA_TYPE 0x8014
-#define GLX_COLOR_INDEX_TYPE 0x8015
-#define GLX_COLOR_INDEX_BIT 0x00000002
-#define GLX_RGBA_BIT 0x00000001
-#define GLX_SCREEN 0x800C
-#define GLX_PBUFFER_CLOBBER_MASK 0x08000000
-#define GLX_DAMAGED 0x8020
-#define GLX_SAVED 0x8021
-#define GLX_WINDOW 0x8022
-#define GLX_PBUFFER 0x8023
-#define GLX_PBUFFER_HEIGHT 0x8040
-#define GLX_PBUFFER_WIDTH 0x8041
-
-/*
- * GLX 1.4 and later:
- */
-#define GLX_SAMPLE_BUFFERS 0x186a0 /*100000*/
-#define GLX_SAMPLES 0x186a1 /*100001*/
-
-extern XVisualInfo* glXChooseVisual( Display *dpy, int screen,
- int *attribList );
-
-extern GLXContext glXCreateContext( Display *dpy, XVisualInfo *vis,
- GLXContext shareList, Bool direct );
-
-extern void glXDestroyContext( Display *dpy, GLXContext ctx );
-
-extern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable,
- GLXContext ctx);
-
-extern void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
- unsigned long mask );
-
-extern void glXSwapBuffers( Display *dpy, GLXDrawable drawable );
-
-extern GLXPixmap glXCreateGLXPixmap( Display *dpy, XVisualInfo *visual,
- Pixmap pixmap );
-
-extern void glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap );
-
-// Use ARB version for compatibility with older GLX installations
-extern __GLXextFuncPtr glXGetProcAddressARB(const GLubyte *procname);
-
-extern int glXGetConfig( Display *dpy, XVisualInfo *visual,
- int attrib, int *value );
-
-extern const char *glXQueryExtensionsString( Display *dpy, int screen );
+#include <GL/glx.h>
// Routines needed from Xlib.h and Xutil.h (placed here to avoid having
// XVisualInfo generated multiple times)
diff --git a/make/wingdi-win32.cfg b/make/wingdi-win32.cfg
index 3b0a011fa..622cef25d 100644
--- a/make/wingdi-win32.cfg
+++ b/make/wingdi-win32.cfg
@@ -10,6 +10,8 @@ Include gl-common-win32.cfg
# Implement the first argument to wglGetProcAddress as String instead
# of byte[]
ArgumentIsString wglGetProcAddress 0
+ArgumentIsString LoadLibraryA 0
+ArgumentIsString GetProcAddress 1
CustomCCode #define WIN32_LEAN_AND_MEAN
CustomCCode #include <windows.h>