Emscripten now working for dreamtorus.
Initial scaffolding for GLX emulation on EGL/WGL/CGL.
Ppca refinements.
Add GL_NV_blend_equation_advanced and GL_NV_blend_equation_advanced_coherent support.
RegalX11.cpp added for fake X11 purposes for GLX emulation.
GLEW refresh.
Fixups for REGAL_SYS_EMSCRIPTEN_STATIC mode.
diff --git a/Makefile.regaltest b/Makefile.regaltest
index 7e1929a..e6ac4b1 100644
--- a/Makefile.regaltest
+++ b/Makefile.regaltest
@@ -41,7 +41,7 @@
 REGALTEST.OBJS       := $(addprefix tmp/$(SYSTEM)/regaltest/static/,$(REGALTEST.SRCS.NAMES))
 REGALTEST.OBJS       := $(REGALTEST.OBJS:.cpp=.o)
 REGALTEST.DEPS       := $(REGALTEST.DEPS:.o=.d)
-REGALTEST.CFLAGS     := -Isrc/googletest/include -Isrc/googlemock/include -Isrc/regal -Isrc/boost
+REGALTEST.CFLAGS     := -Isrc/googletest/include -Isrc/googlemock/include -Isrc/regal -Isrc/boost -Isrc/lookup3
 REGALTEST.LIBS       := -Llib/$(SYSTEM) $(LDFLAGS.X11) -lm
 
 ifeq ($(filter nacl%,$(SYSTEM)),)
diff --git a/build/apitrace.inc b/build/apitrace.inc
index 6257e28..b7fbd5c 100644
--- a/build/apitrace.inc
+++ b/build/apitrace.inc
@@ -5,6 +5,7 @@
 
 # apitrace sources
 
+APITRACE.CXX :=
 APITRACE.CXX += src/apitrace/common/os_posix.cpp
 APITRACE.CXX += src/apitrace/common/os_win32.cpp
 APITRACE.CXX += src/apitrace/common/trace_callset.cpp
diff --git a/build/freetype.inc b/build/freetype.inc
index e2ebd0c..e0f3ec5 100644
--- a/build/freetype.inc
+++ b/build/freetype.inc
@@ -6,6 +6,7 @@
 
 # freetype sources
 
+FREETYPE.C :=
 FREETYPE.C += src/freetype/src/raster/rastpic.c
 FREETYPE.C += src/freetype/src/raster/ftrend1.c
 FREETYPE.C += src/freetype/src/raster/ftraster.c
@@ -199,4 +200,4 @@
 
 FREETYPE.H :=
 
-FREETYPE.H.OTHER := 
+FREETYPE.H.OTHER :=
diff --git a/build/ios/Regal/Regal.xcodeproj/project.pbxproj b/build/ios/Regal/Regal.xcodeproj/project.pbxproj
index a4ed5cc..13cf91f 100644
--- a/build/ios/Regal/Regal.xcodeproj/project.pbxproj
+++ b/build/ios/Regal/Regal.xcodeproj/project.pbxproj
@@ -52,7 +52,6 @@
 		43FC5F9915C4619B00D0177C /* RegalMarker.h in Headers */ = {isa = PBXBuildFile; fileRef = 43FC5F6C15C4619B00D0177C /* RegalMarker.h */; };
 		43FC5F9A15C4619B00D0177C /* RegalObj.h in Headers */ = {isa = PBXBuildFile; fileRef = 43FC5F6D15C4619B00D0177C /* RegalObj.h */; };
 		43FC5F9B15C4619B00D0177C /* RegalPpa.h in Headers */ = {isa = PBXBuildFile; fileRef = 43FC5F6E15C4619B00D0177C /* RegalPpa.h */; };
-		43FC5F9C15C4619B00D0177C /* RegalPpc.h in Headers */ = {isa = PBXBuildFile; fileRef = 43FC5F6F15C4619B00D0177C /* RegalPpc.h */; };
 		43FC5F9D15C4619B00D0177C /* RegalPrecompile.h in Headers */ = {isa = PBXBuildFile; fileRef = 43FC5F7015C4619B00D0177C /* RegalPrecompile.h */; };
 		43FC5F9E15C4619B00D0177C /* RegalPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 43FC5F7115C4619B00D0177C /* RegalPrivate.h */; };
 		43FC5F9F15C4619B00D0177C /* RegalState.h in Headers */ = {isa = PBXBuildFile; fileRef = 43FC5F7215C4619B00D0177C /* RegalState.h */; };
@@ -70,7 +69,6 @@
 		BC3209D716F3A0E600D1A9E0 /* RegalCacheTexture.h in Headers */ = {isa = PBXBuildFile; fileRef = BC3209D316F3A0E600D1A9E0 /* RegalCacheTexture.h */; };
 		BC59F9DB174809EE004BC2AC /* RegalBaseVertex.h in Headers */ = {isa = PBXBuildFile; fileRef = BC59F9CA174809EE004BC2AC /* RegalBaseVertex.h */; };
 		BC59F9DC174809EE004BC2AC /* RegalMutex.h in Headers */ = {isa = PBXBuildFile; fileRef = BC59F9CB174809EE004BC2AC /* RegalMutex.h */; };
-		BC59F9DD174809EE004BC2AC /* RegalPpca.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC59F9CC174809EE004BC2AC /* RegalPpca.cpp */; };
 		BC59F9DE174809EE004BC2AC /* RegalPpca.h in Headers */ = {isa = PBXBuildFile; fileRef = BC59F9CD174809EE004BC2AC /* RegalPpca.h */; };
 		BC59F9DF174809EE004BC2AC /* RegalRect.h in Headers */ = {isa = PBXBuildFile; fileRef = BC59F9CE174809EE004BC2AC /* RegalRect.h */; };
 		BC59F9E0174809EE004BC2AC /* RegalTexC.h in Headers */ = {isa = PBXBuildFile; fileRef = BC59F9CF174809EE004BC2AC /* RegalTexC.h */; };
@@ -219,7 +217,6 @@
 		43FC5F6C15C4619B00D0177C /* RegalMarker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalMarker.h; path = ../../../src/regal/RegalMarker.h; sourceTree = "<group>"; };
 		43FC5F6D15C4619B00D0177C /* RegalObj.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalObj.h; path = ../../../src/regal/RegalObj.h; sourceTree = "<group>"; };
 		43FC5F6E15C4619B00D0177C /* RegalPpa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalPpa.h; path = ../../../src/regal/RegalPpa.h; sourceTree = "<group>"; };
-		43FC5F6F15C4619B00D0177C /* RegalPpc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalPpc.h; path = ../../../src/regal/RegalPpc.h; sourceTree = "<group>"; };
 		43FC5F7015C4619B00D0177C /* RegalPrecompile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalPrecompile.h; path = ../../../src/regal/RegalPrecompile.h; sourceTree = "<group>"; };
 		43FC5F7115C4619B00D0177C /* RegalPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalPrivate.h; path = ../../../src/regal/RegalPrivate.h; sourceTree = "<group>"; };
 		43FC5F7215C4619B00D0177C /* RegalState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalState.h; path = ../../../src/regal/RegalState.h; sourceTree = "<group>"; };
@@ -237,7 +234,6 @@
 		BC3209D316F3A0E600D1A9E0 /* RegalCacheTexture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalCacheTexture.h; path = ../../../src/regal/RegalCacheTexture.h; sourceTree = "<group>"; };
 		BC59F9CA174809EE004BC2AC /* RegalBaseVertex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalBaseVertex.h; path = ../../../src/regal/RegalBaseVertex.h; sourceTree = "<group>"; };
 		BC59F9CB174809EE004BC2AC /* RegalMutex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalMutex.h; path = ../../../src/regal/RegalMutex.h; sourceTree = "<group>"; };
-		BC59F9CC174809EE004BC2AC /* RegalPpca.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalPpca.cpp; path = ../../../src/regal/RegalPpca.cpp; sourceTree = "<group>"; };
 		BC59F9CD174809EE004BC2AC /* RegalPpca.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalPpca.h; path = ../../../src/regal/RegalPpca.h; sourceTree = "<group>"; };
 		BC59F9CE174809EE004BC2AC /* RegalRect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalRect.h; path = ../../../src/regal/RegalRect.h; sourceTree = "<group>"; };
 		BC59F9CF174809EE004BC2AC /* RegalTexC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalTexC.h; path = ../../../src/regal/RegalTexC.h; sourceTree = "<group>"; };
@@ -462,8 +458,6 @@
 				BC59F9D4174809EE004BC2AC /* RegalPixelConversions.h */,
 				BCBF1847175EBB3000CB653A /* RegalPlugin.cpp */,
 				43FC5F6E15C4619B00D0177C /* RegalPpa.h */,
-				43FC5F6F15C4619B00D0177C /* RegalPpc.h */,
-				BC59F9CC174809EE004BC2AC /* RegalPpca.cpp */,
 				BC59F9CD174809EE004BC2AC /* RegalPpca.h */,
 				43FC5F7015C4619B00D0177C /* RegalPrecompile.h */,
 				43FC5F7115C4619B00D0177C /* RegalPrivate.h */,
@@ -617,7 +611,6 @@
 				43FC5F9915C4619B00D0177C /* RegalMarker.h in Headers */,
 				43FC5F9A15C4619B00D0177C /* RegalObj.h in Headers */,
 				43FC5F9B15C4619B00D0177C /* RegalPpa.h in Headers */,
-				43FC5F9C15C4619B00D0177C /* RegalPpc.h in Headers */,
 				43FC5F9D15C4619B00D0177C /* RegalPrecompile.h in Headers */,
 				43FC5F9E15C4619B00D0177C /* RegalPrivate.h in Headers */,
 				43FC5F9F15C4619B00D0177C /* RegalState.h in Headers */,
@@ -776,7 +769,6 @@
 				BC94B99316DFDDA000116D55 /* RegalFilt.cpp in Sources */,
 				BC3209D416F3A0E600D1A9E0 /* RegalCacheShader.cpp in Sources */,
 				BC3209D616F3A0E600D1A9E0 /* RegalCacheTexture.cpp in Sources */,
-				BC59F9DD174809EE004BC2AC /* RegalPpca.cpp in Sources */,
 				BC59F9E9174809EE004BC2AC /* RegalPixelConversions.cpp in Sources */,
 				BC59F9EA174809EE004BC2AC /* RegalTexC.cpp in Sources */,
 				BC59F9EB174809EE004BC2AC /* RegalXfer.cpp in Sources */,
diff --git a/build/libpng.inc b/build/libpng.inc
index d1f7209..3d0dae3 100644
--- a/build/libpng.inc
+++ b/build/libpng.inc
@@ -5,6 +5,7 @@
 
 # Sources
 
+LIBPNG.C :=
 LIBPNG.C += src/libpng/src/png.c
 LIBPNG.C += src/libpng/src/pngerror.c
 LIBPNG.C += src/libpng/src/pngget.c
diff --git a/build/mac/Regal/Regal.xcodeproj/project.pbxproj b/build/mac/Regal/Regal.xcodeproj/project.pbxproj
index 1f6da22..c2a87d1 100644
--- a/build/mac/Regal/Regal.xcodeproj/project.pbxproj
+++ b/build/mac/Regal/Regal.xcodeproj/project.pbxproj
@@ -20,7 +20,6 @@
 		438D2C2B16DE668A005E03F6 /* RegalJson.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 438D2C1F16DE668A005E03F6 /* RegalJson.cpp */; };
 		438D2C2D16DE668A005E03F6 /* RegalPixelConversions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 438D2C2116DE668A005E03F6 /* RegalPixelConversions.cpp */; };
 		438D2C2E16DE668A005E03F6 /* RegalPixelConversions.h in Headers */ = {isa = PBXBuildFile; fileRef = 438D2C2216DE668A005E03F6 /* RegalPixelConversions.h */; };
-		438D2C2F16DE668A005E03F6 /* RegalPpca.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 438D2C2416DE668A005E03F6 /* RegalPpca.cpp */; };
 		438D2C3016DE668A005E03F6 /* RegalPpca.h in Headers */ = {isa = PBXBuildFile; fileRef = 438D2C2516DE668A005E03F6 /* RegalPpca.h */; };
 		438D2C3116DE668A005E03F6 /* RegalSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 438D2C2616DE668A005E03F6 /* RegalSystem.h */; };
 		438D2C3216DE668A005E03F6 /* RegalTexC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 438D2C2716DE668A005E03F6 /* RegalTexC.cpp */; };
@@ -63,7 +62,6 @@
 		43A6C22015C48D200063667E /* RegalMarker.h in Headers */ = {isa = PBXBuildFile; fileRef = 43A6C1F315C48D200063667E /* RegalMarker.h */; };
 		43A6C22115C48D200063667E /* RegalObj.h in Headers */ = {isa = PBXBuildFile; fileRef = 43A6C1F415C48D200063667E /* RegalObj.h */; };
 		43A6C22215C48D200063667E /* RegalPpa.h in Headers */ = {isa = PBXBuildFile; fileRef = 43A6C1F515C48D200063667E /* RegalPpa.h */; };
-		43A6C22315C48D200063667E /* RegalPpc.h in Headers */ = {isa = PBXBuildFile; fileRef = 43A6C1F615C48D200063667E /* RegalPpc.h */; };
 		43A6C22415C48D200063667E /* RegalPrecompile.h in Headers */ = {isa = PBXBuildFile; fileRef = 43A6C1F715C48D200063667E /* RegalPrecompile.h */; };
 		43A6C22515C48D200063667E /* RegalPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 43A6C1F815C48D200063667E /* RegalPrivate.h */; };
 		43A6C22615C48D200063667E /* RegalState.h in Headers */ = {isa = PBXBuildFile; fileRef = 43A6C1F915C48D200063667E /* RegalState.h */; };
@@ -85,6 +83,12 @@
 		BC640C9C16554A52007DEF69 /* RegalFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC640C9A16554A52007DEF69 /* RegalFrame.cpp */; };
 		BC640C9D16554A52007DEF69 /* RegalFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = BC640C9B16554A52007DEF69 /* RegalFrame.h */; };
 		BC6C911D15EE3CDF0056E4F7 /* RegalDispatchGlobal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC6C911C15EE3CDF0056E4F7 /* RegalDispatchGlobal.cpp */; };
+		BC8E9CBD17C5AF880005C418 /* RegalDispatchGLX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC8E9CB717C5AF870005C418 /* RegalDispatchGLX.cpp */; };
+		BC8E9CBE17C5AF880005C418 /* RegalX11.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC8E9CB817C5AF870005C418 /* RegalX11.cpp */; };
+		BC8E9CBF17C5AF880005C418 /* RegalDispatchStaticEGL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC8E9CB917C5AF880005C418 /* RegalDispatchStaticEGL.cpp */; };
+		BC8E9CC017C5AF880005C418 /* RegalHint.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8E9CBA17C5AF880005C418 /* RegalHint.h */; };
+		BC8E9CC117C5AF880005C418 /* RegalNamespace.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8E9CBB17C5AF880005C418 /* RegalNamespace.h */; };
+		BC8E9CC217C5AF880005C418 /* RegalTexSto.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8E9CBC17C5AF880005C418 /* RegalTexSto.h */; };
 		BC94B98B16DFDC6200116D55 /* RegalBreak.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC94B98916DFDC6200116D55 /* RegalBreak.cpp */; };
 		BC94B98C16DFDC6200116D55 /* RegalBreak.h in Headers */ = {isa = PBXBuildFile; fileRef = BC94B98A16DFDC6200116D55 /* RegalBreak.h */; };
 		BC94B99716DFDF1F00116D55 /* RegalFilt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC94B99516DFDF1F00116D55 /* RegalFilt.cpp */; };
@@ -191,7 +195,6 @@
 		438D2C2116DE668A005E03F6 /* RegalPixelConversions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalPixelConversions.cpp; path = ../../../src/regal/RegalPixelConversions.cpp; sourceTree = "<group>"; };
 		438D2C2216DE668A005E03F6 /* RegalPixelConversions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalPixelConversions.h; path = ../../../src/regal/RegalPixelConversions.h; sourceTree = "<group>"; };
 		438D2C2316DE668A005E03F6 /* RegalPixelConversions.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = RegalPixelConversions.inl; path = ../../../src/regal/RegalPixelConversions.inl; sourceTree = "<group>"; };
-		438D2C2416DE668A005E03F6 /* RegalPpca.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalPpca.cpp; path = ../../../src/regal/RegalPpca.cpp; sourceTree = "<group>"; };
 		438D2C2516DE668A005E03F6 /* RegalPpca.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalPpca.h; path = ../../../src/regal/RegalPpca.h; sourceTree = "<group>"; };
 		438D2C2616DE668A005E03F6 /* RegalSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalSystem.h; path = ../../../src/regal/RegalSystem.h; sourceTree = "<group>"; };
 		438D2C2716DE668A005E03F6 /* RegalTexC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalTexC.cpp; path = ../../../src/regal/RegalTexC.cpp; sourceTree = "<group>"; };
@@ -235,7 +238,6 @@
 		43A6C1F315C48D200063667E /* RegalMarker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalMarker.h; path = ../../../src/regal/RegalMarker.h; sourceTree = "<group>"; };
 		43A6C1F415C48D200063667E /* RegalObj.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalObj.h; path = ../../../src/regal/RegalObj.h; sourceTree = "<group>"; };
 		43A6C1F515C48D200063667E /* RegalPpa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalPpa.h; path = ../../../src/regal/RegalPpa.h; sourceTree = "<group>"; };
-		43A6C1F615C48D200063667E /* RegalPpc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalPpc.h; path = ../../../src/regal/RegalPpc.h; sourceTree = "<group>"; };
 		43A6C1F715C48D200063667E /* RegalPrecompile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalPrecompile.h; path = ../../../src/regal/RegalPrecompile.h; sourceTree = "<group>"; };
 		43A6C1F815C48D200063667E /* RegalPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalPrivate.h; path = ../../../src/regal/RegalPrivate.h; sourceTree = "<group>"; };
 		43A6C1F915C48D200063667E /* RegalState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalState.h; path = ../../../src/regal/RegalState.h; sourceTree = "<group>"; };
@@ -257,6 +259,12 @@
 		BC640C9A16554A52007DEF69 /* RegalFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalFrame.cpp; path = ../../../src/regal/RegalFrame.cpp; sourceTree = "<group>"; };
 		BC640C9B16554A52007DEF69 /* RegalFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalFrame.h; path = ../../../src/regal/RegalFrame.h; sourceTree = "<group>"; };
 		BC6C911C15EE3CDF0056E4F7 /* RegalDispatchGlobal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalDispatchGlobal.cpp; path = ../../../src/regal/RegalDispatchGlobal.cpp; sourceTree = "<group>"; };
+		BC8E9CB717C5AF870005C418 /* RegalDispatchGLX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalDispatchGLX.cpp; path = ../../../src/regal/RegalDispatchGLX.cpp; sourceTree = "<group>"; };
+		BC8E9CB817C5AF870005C418 /* RegalX11.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalX11.cpp; path = ../../../src/regal/RegalX11.cpp; sourceTree = "<group>"; };
+		BC8E9CB917C5AF880005C418 /* RegalDispatchStaticEGL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalDispatchStaticEGL.cpp; path = ../../../src/regal/RegalDispatchStaticEGL.cpp; sourceTree = "<group>"; };
+		BC8E9CBA17C5AF880005C418 /* RegalHint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalHint.h; path = ../../../src/regal/RegalHint.h; sourceTree = "<group>"; };
+		BC8E9CBB17C5AF880005C418 /* RegalNamespace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalNamespace.h; path = ../../../src/regal/RegalNamespace.h; sourceTree = "<group>"; };
+		BC8E9CBC17C5AF880005C418 /* RegalTexSto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalTexSto.h; path = ../../../src/regal/RegalTexSto.h; sourceTree = "<group>"; };
 		BC94B98916DFDC6200116D55 /* RegalBreak.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalBreak.cpp; path = ../../../src/regal/RegalBreak.cpp; sourceTree = "<group>"; };
 		BC94B98A16DFDC6200116D55 /* RegalBreak.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalBreak.h; path = ../../../src/regal/RegalBreak.h; sourceTree = "<group>"; };
 		BC94B99516DFDF1F00116D55 /* RegalFilt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalFilt.cpp; path = ../../../src/regal/RegalFilt.cpp; sourceTree = "<group>"; };
@@ -386,6 +394,12 @@
 		43A6C1D015C48CFA0063667E /* Regal */ = {
 			isa = PBXGroup;
 			children = (
+				BC8E9CB717C5AF870005C418 /* RegalDispatchGLX.cpp */,
+				BC8E9CB817C5AF870005C418 /* RegalX11.cpp */,
+				BC8E9CB917C5AF880005C418 /* RegalDispatchStaticEGL.cpp */,
+				BC8E9CBA17C5AF880005C418 /* RegalHint.h */,
+				BC8E9CBB17C5AF880005C418 /* RegalNamespace.h */,
+				BC8E9CBC17C5AF880005C418 /* RegalTexSto.h */,
 				BCDF6687178F146B00EE9569 /* snappy */,
 				BCDF661A178F0F7500EE9569 /* apitrace */,
 				436E18CB17020061005BE93E /* jsonsl */,
@@ -468,8 +482,6 @@
 				438D2C2316DE668A005E03F6 /* RegalPixelConversions.inl */,
 				BCBF1835175EB49D00CB653A /* RegalPlugin.cpp */,
 				43A6C1F515C48D200063667E /* RegalPpa.h */,
-				43A6C1F615C48D200063667E /* RegalPpc.h */,
-				438D2C2416DE668A005E03F6 /* RegalPpca.cpp */,
 				438D2C2516DE668A005E03F6 /* RegalPpca.h */,
 				43A6C1F715C48D200063667E /* RegalPrecompile.h */,
 				43A6C1F815C48D200063667E /* RegalPrivate.h */,
@@ -615,7 +627,6 @@
 				43A6C22015C48D200063667E /* RegalMarker.h in Headers */,
 				43A6C22115C48D200063667E /* RegalObj.h in Headers */,
 				43A6C22215C48D200063667E /* RegalPpa.h in Headers */,
-				43A6C22315C48D200063667E /* RegalPpc.h in Headers */,
 				43A6C22415C48D200063667E /* RegalPrecompile.h in Headers */,
 				43A6C22515C48D200063667E /* RegalPrivate.h in Headers */,
 				43A6C22615C48D200063667E /* RegalState.h in Headers */,
@@ -686,6 +697,9 @@
 				BCDF668F178F14A400EE9569 /* snappy-c.h in Headers */,
 				BCDF6691178F14A400EE9569 /* snappy-sinksource.h in Headers */,
 				BCDF6693178F14A400EE9569 /* snappy.h in Headers */,
+				BC8E9CC017C5AF880005C418 /* RegalHint.h in Headers */,
+				BC8E9CC117C5AF880005C418 /* RegalNamespace.h in Headers */,
+				BC8E9CC217C5AF880005C418 /* RegalTexSto.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -774,7 +788,6 @@
 				BCBEC713167AD74400B38E16 /* RegalDispatchCode.cpp in Sources */,
 				438D2C2B16DE668A005E03F6 /* RegalJson.cpp in Sources */,
 				438D2C2D16DE668A005E03F6 /* RegalPixelConversions.cpp in Sources */,
-				438D2C2F16DE668A005E03F6 /* RegalPpca.cpp in Sources */,
 				438D2C3216DE668A005E03F6 /* RegalTexC.cpp in Sources */,
 				BC94B98B16DFDC6200116D55 /* RegalBreak.cpp in Sources */,
 				BC94B99716DFDF1F00116D55 /* RegalFilt.cpp in Sources */,
@@ -816,6 +829,9 @@
 				BCDF668E178F14A400EE9569 /* snappy-c.cc in Sources */,
 				BCDF6690178F14A400EE9569 /* snappy-sinksource.cc in Sources */,
 				BCDF6692178F14A400EE9569 /* snappy.cc in Sources */,
+				BC8E9CBD17C5AF880005C418 /* RegalDispatchGLX.cpp in Sources */,
+				BC8E9CBE17C5AF880005C418 /* RegalX11.cpp in Sources */,
+				BC8E9CBF17C5AF880005C418 /* RegalDispatchStaticEGL.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -887,7 +903,7 @@
 				GCC_PREPROCESSOR_DEFINITIONS = (
 					"REGAL_NO_HTTP=1",
 					"REGAL_NO_PNG=1",
-					"TRACE_OS_LOG=0"
+					"TRACE_OS_LOG=0",
 				);
 				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
 				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
diff --git a/build/regal.inc b/build/regal.inc
index f388151..1bb39ff 100644
--- a/build/regal.inc
+++ b/build/regal.inc
@@ -5,6 +5,7 @@
 
 # Regal Sources
 
+REGAL.CXX :=
 REGAL.CXX += src/regal/RegalIff.cpp
 REGAL.CXX += src/regal/Regal.cpp
 REGAL.CXX += src/regal/RegalLog.cpp
@@ -29,6 +30,7 @@
 REGAL.CXX += src/regal/RegalDispatcherGL.cpp
 REGAL.CXX += src/regal/RegalDispatcherGlobal.cpp
 REGAL.CXX += src/regal/RegalDispatchEmu.cpp
+REGAL.CXX += src/regal/RegalDispatchGLX.cpp
 REGAL.CXX += src/regal/RegalDispatchLog.cpp
 REGAL.CXX += src/regal/RegalDispatchCode.cpp
 REGAL.CXX += src/regal/RegalDispatchCache.cpp
@@ -49,10 +51,12 @@
 REGAL.CXX += src/regal/RegalSo.cpp
 REGAL.CXX += src/regal/RegalFilt.cpp
 REGAL.CXX += src/regal/RegalXfer.cpp
+REGAL.CXX += src/regal/RegalX11.cpp
 REGAL.CXX += src/regal/RegalDllMain.cpp
 
 # Regal Internal Headers
 
+REGAL.H :=
 REGAL.H += src/regal/RegalBin.h
 REGAL.H += src/regal/RegalBreak.h
 REGAL.H += src/regal/RegalCacheShader.h
@@ -112,12 +116,14 @@
 
 # Other Regal Headers
 
+REGAL.H.OTHER :=
 REGAL.H.OTHER += include/GL/Regal.h
 REGAL.H.OTHER += src/lookup3/lookup3.h
 
 #
 
-REGAL.INCLUDE   := -Isrc/regal
+REGAL.INCLUDE   :=
+REGAL.INCLUDE   += -Isrc/regal
 REGAL.INCLUDE   += -Isrc/zlib/include
 REGAL.INCLUDE   += -Isrc/libpng/include
 REGAL.INCLUDE   += -Isrc/mongoose
diff --git a/build/snappy.inc b/build/snappy.inc
index 7c37621..c74afe0 100644
--- a/build/snappy.inc
+++ b/build/snappy.inc
@@ -6,10 +6,12 @@
 
 # snappy sources
 
+SNAPPY.CXX :=
 SNAPPY.CXX += src/snappy/snappy-c.cc
 SNAPPY.CXX += src/snappy/snappy-sinksource.cc
 SNAPPY.CXX += src/snappy/snappy.cc
 
+SNAPPY.H :=
 SNAPPY.H += src/snappy/snappy-c.h
 SNAPPY.H += src/snappy/snappy-internal.h
 SNAPPY.H += src/snappy/snappy-sinksource.h
@@ -17,7 +19,7 @@
 SNAPPY.H += src/snappy/snappy-stubs-public.h
 SNAPPY.H += src/snappy/snappy.h
 
-SNAPPY.H.OTHER := 
+SNAPPY.H.OTHER :=
 
 #
 
diff --git a/build/waffle.inc b/build/waffle.inc
index 2fe4041..62bc1d3 100644
--- a/build/waffle.inc
+++ b/build/waffle.inc
@@ -53,8 +53,8 @@
 WAFFLE.C.LINUX += src/waffle/src/linux/linux_platform.c
 WAFFLE.C.LINUX += src/waffle/src/linux/linux_dl.c
 
-# 
+#
 
 WAFFLE.H :=
 
-WAFFLE.H.OTHER := 
+WAFFLE.H.OTHER :=
diff --git a/build/win32/vs2010/Regal/Regal.vcxproj b/build/win32/vs2010/Regal/Regal.vcxproj
index d3aba4a..d2e5ba9 100755
--- a/build/win32/vs2010/Regal/Regal.vcxproj
+++ b/build/win32/vs2010/Regal/Regal.vcxproj
@@ -256,6 +256,7 @@
     <ClCompile Include="..\..\..\..\src\regal\RegalDispatchEmu.cpp" />
     <ClCompile Include="..\..\..\..\src\regal\RegalDispatchError.cpp" />
     <ClInclude Include="..\..\..\..\src\regal\RegalDispatchError.h" />
+    <ClCompile Include="..\..\..\..\src\regal\RegalDispatchGLX.cpp" />
     <ClCompile Include="..\..\..\..\src\regal\RegalDispatchGlobal.cpp" />
     <ClCompile Include="..\..\..\..\src\regal\RegalDispatchLoader.cpp" />
     <ClCompile Include="..\..\..\..\src\regal\RegalDispatchLog.cpp" />
@@ -307,8 +308,6 @@
     <ClInclude Include="..\..\..\..\src\regal\RegalPixelConversions.inl" />
     <ClCompile Include="..\..\..\..\src\regal\RegalPlugin.cpp" />
     <ClInclude Include="..\..\..\..\src\regal\RegalPpa.h" />
-    <ClInclude Include="..\..\..\..\src\regal\RegalPpc.h" />
-    <ClCompile Include="..\..\..\..\src\regal\RegalPpca.cpp" />
     <ClInclude Include="..\..\..\..\src\regal\RegalPpca.h" />
     <ClInclude Include="..\..\..\..\src\regal\RegalPrecompile.h" />
     <ClInclude Include="..\..\..\..\src\regal\RegalPrivate.h" />
@@ -333,6 +332,7 @@
     <ClCompile Include="..\..\..\..\src\regal\RegalUtil.cpp" />
     <ClInclude Include="..\..\..\..\src\regal\RegalUtil.h" />
     <ClInclude Include="..\..\..\..\src\regal\RegalVao.h" />
+    <ClCompile Include="..\..\..\..\src\regal\RegalX11.cpp" />
     <ClCompile Include="..\..\..\..\src\regal\RegalXfer.cpp" />
     <ClInclude Include="..\..\..\..\src\regal\RegalXfer.h" />
     <ClInclude Include="..\..\..\..\src\regal\linear.h" />
diff --git a/build/win32/vs2010/Regal/Regallib.vcxproj b/build/win32/vs2010/Regal/Regallib.vcxproj
index a60eeab..f31277d 100644
--- a/build/win32/vs2010/Regal/Regallib.vcxproj
+++ b/build/win32/vs2010/Regal/Regallib.vcxproj
@@ -256,6 +256,7 @@
     <ClCompile Include="..\..\..\..\src\regal\RegalDispatchEmu.cpp" />
     <ClCompile Include="..\..\..\..\src\regal\RegalDispatchError.cpp" />
     <ClInclude Include="..\..\..\..\src\regal\RegalDispatchError.h" />
+    <ClCompile Include="..\..\..\..\src\regal\RegalDispatchGLX.cpp" />
     <ClCompile Include="..\..\..\..\src\regal\RegalDispatchGlobal.cpp" />
     <ClCompile Include="..\..\..\..\src\regal\RegalDispatchLoader.cpp" />
     <ClCompile Include="..\..\..\..\src\regal\RegalDispatchLog.cpp" />
@@ -307,8 +308,6 @@
     <ClInclude Include="..\..\..\..\src\regal\RegalPixelConversions.inl" />
     <ClCompile Include="..\..\..\..\src\regal\RegalPlugin.cpp" />
     <ClInclude Include="..\..\..\..\src\regal\RegalPpa.h" />
-    <ClInclude Include="..\..\..\..\src\regal\RegalPpc.h" />
-    <ClCompile Include="..\..\..\..\src\regal\RegalPpca.cpp" />
     <ClInclude Include="..\..\..\..\src\regal\RegalPpca.h" />
     <ClInclude Include="..\..\..\..\src\regal\RegalPrecompile.h" />
     <ClInclude Include="..\..\..\..\src\regal\RegalPrivate.h" />
@@ -333,6 +332,7 @@
     <ClCompile Include="..\..\..\..\src\regal\RegalUtil.cpp" />
     <ClInclude Include="..\..\..\..\src\regal\RegalUtil.h" />
     <ClInclude Include="..\..\..\..\src\regal\RegalVao.h" />
+    <ClCompile Include="..\..\..\..\src\regal\RegalX11.cpp" />
     <ClCompile Include="..\..\..\..\src\regal\RegalXfer.cpp" />
     <ClInclude Include="..\..\..\..\src\regal\RegalXfer.h" />
     <ClInclude Include="..\..\..\..\src\regal\linear.h" />
diff --git a/build/win32/vs2010/Regal/Regalm.vcxproj b/build/win32/vs2010/Regal/Regalm.vcxproj
index dc88c17..8699688 100644
--- a/build/win32/vs2010/Regal/Regalm.vcxproj
+++ b/build/win32/vs2010/Regal/Regalm.vcxproj
@@ -256,6 +256,7 @@
     <ClCompile Include="..\..\..\..\src\regal\RegalDispatchEmu.cpp" />
     <ClCompile Include="..\..\..\..\src\regal\RegalDispatchError.cpp" />
     <ClInclude Include="..\..\..\..\src\regal\RegalDispatchError.h" />
+    <ClCompile Include="..\..\..\..\src\regal\RegalDispatchGLX.cpp" />
     <ClCompile Include="..\..\..\..\src\regal\RegalDispatchGlobal.cpp" />
     <ClCompile Include="..\..\..\..\src\regal\RegalDispatchLoader.cpp" />
     <ClCompile Include="..\..\..\..\src\regal\RegalDispatchLog.cpp" />
@@ -307,8 +308,6 @@
     <ClInclude Include="..\..\..\..\src\regal\RegalPixelConversions.inl" />
     <ClCompile Include="..\..\..\..\src\regal\RegalPlugin.cpp" />
     <ClInclude Include="..\..\..\..\src\regal\RegalPpa.h" />
-    <ClInclude Include="..\..\..\..\src\regal\RegalPpc.h" />
-    <ClCompile Include="..\..\..\..\src\regal\RegalPpca.cpp" />
     <ClInclude Include="..\..\..\..\src\regal\RegalPpca.h" />
     <ClInclude Include="..\..\..\..\src\regal\RegalPrecompile.h" />
     <ClInclude Include="..\..\..\..\src\regal\RegalPrivate.h" />
@@ -333,6 +332,7 @@
     <ClCompile Include="..\..\..\..\src\regal\RegalUtil.cpp" />
     <ClInclude Include="..\..\..\..\src\regal\RegalUtil.h" />
     <ClInclude Include="..\..\..\..\src\regal\RegalVao.h" />
+    <ClCompile Include="..\..\..\..\src\regal\RegalX11.cpp" />
     <ClCompile Include="..\..\..\..\src\regal\RegalXfer.cpp" />
     <ClInclude Include="..\..\..\..\src\regal\RegalXfer.h" />
     <ClInclude Include="..\..\..\..\src\regal\linear.h" />
diff --git a/build/win32/vs2010/Regal/Regalmlib.vcxproj b/build/win32/vs2010/Regal/Regalmlib.vcxproj
index 27a3288..ebed260 100644
--- a/build/win32/vs2010/Regal/Regalmlib.vcxproj
+++ b/build/win32/vs2010/Regal/Regalmlib.vcxproj
@@ -256,6 +256,7 @@
     <ClCompile Include="..\..\..\..\src\regal\RegalDispatchEmu.cpp" />
     <ClCompile Include="..\..\..\..\src\regal\RegalDispatchError.cpp" />
     <ClInclude Include="..\..\..\..\src\regal\RegalDispatchError.h" />
+    <ClCompile Include="..\..\..\..\src\regal\RegalDispatchGLX.cpp" />
     <ClCompile Include="..\..\..\..\src\regal\RegalDispatchGlobal.cpp" />
     <ClCompile Include="..\..\..\..\src\regal\RegalDispatchLoader.cpp" />
     <ClCompile Include="..\..\..\..\src\regal\RegalDispatchLog.cpp" />
@@ -307,8 +308,6 @@
     <ClInclude Include="..\..\..\..\src\regal\RegalPixelConversions.inl" />
     <ClCompile Include="..\..\..\..\src\regal\RegalPlugin.cpp" />
     <ClInclude Include="..\..\..\..\src\regal\RegalPpa.h" />
-    <ClInclude Include="..\..\..\..\src\regal\RegalPpc.h" />
-    <ClCompile Include="..\..\..\..\src\regal\RegalPpca.cpp" />
     <ClInclude Include="..\..\..\..\src\regal\RegalPpca.h" />
     <ClInclude Include="..\..\..\..\src\regal\RegalPrecompile.h" />
     <ClInclude Include="..\..\..\..\src\regal\RegalPrivate.h" />
@@ -333,6 +332,7 @@
     <ClCompile Include="..\..\..\..\src\regal\RegalUtil.cpp" />
     <ClInclude Include="..\..\..\..\src\regal\RegalUtil.h" />
     <ClInclude Include="..\..\..\..\src\regal\RegalVao.h" />
+    <ClCompile Include="..\..\..\..\src\regal\RegalX11.cpp" />
     <ClCompile Include="..\..\..\..\src\regal\RegalXfer.cpp" />
     <ClInclude Include="..\..\..\..\src\regal\RegalXfer.h" />
     <ClInclude Include="..\..\..\..\src\regal\linear.h" />
diff --git a/build/win32/vs2010/Regal/Regaltest.vcxproj b/build/win32/vs2010/Regal/Regaltest.vcxproj
index 13154ac..ba2a973 100644
--- a/build/win32/vs2010/Regal/Regaltest.vcxproj
+++ b/build/win32/vs2010/Regal/Regaltest.vcxproj
@@ -78,7 +78,7 @@
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>../../../../src/googletest/include;../../../../src/googlemock/include;../../../../src/googlemock;../../../../src/boost;../../../../src/regal;../../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../../../src/googletest/include;../../../../src/googlemock/include;../../../../src/googlemock;../../../../src/boost;../../../../src/regal;../../../../src/lookup3;../../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>GTEST_HAS_RTTI=0;REGAL_SYS_WGL_DECLARE_WGL;_ITERATOR_DEBUG_LEVEL=0;_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@@ -118,7 +118,7 @@
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>../../../../src/googletest/include;../../../../src/googlemock/include;../../../../src/googlemock;../../../../src/boost;../../../../src/regal;../../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../../../src/googletest/include;../../../../src/googlemock/include;../../../../src/googlemock;../../../../src/boost;../../../../src/regal;../../../../src/lookup3;../../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>GTEST_HAS_RTTI=0;REGAL_SYS_WGL_DECLARE_WGL;_ITERATOR_DEBUG_LEVEL=0;_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@@ -157,7 +157,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../../../../src/googletest/include;../../../../src/googlemock/include;../../../../src/googlemock;../../../../src/boost;../../../../src/regal;../../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../../../src/googletest/include;../../../../src/googlemock/include;../../../../src/googlemock;../../../../src/boost;../../../../src/regal;../../../../src/lookup3;../../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>GTEST_HAS_RTTI=0;REGAL_SYS_WGL_DECLARE_WGL;_ITERATOR_DEBUG_LEVEL=0;_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
@@ -197,7 +197,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../../../../src/googletest/include;../../../../src/googlemock/include;../../../../src/googlemock;../../../../src/boost;../../../../src/regal;../../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../../../src/googletest/include;../../../../src/googlemock/include;../../../../src/googlemock;../../../../src/boost;../../../../src/regal;../../../../src/lookup3;../../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>GTEST_HAS_RTTI=0;REGAL_SYS_WGL_DECLARE_WGL;_ITERATOR_DEBUG_LEVEL=0;_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
diff --git a/build/zlib.inc b/build/zlib.inc
index 4ad05b7..0069dfa 100644
--- a/build/zlib.inc
+++ b/build/zlib.inc
@@ -5,6 +5,7 @@
 
 # Sources
 
+ZLIB.C :=
 ZLIB.C += src/zlib/src/adler32.c
 ZLIB.C += src/zlib/src/crc32.c
 ZLIB.C += src/zlib/src/compress.c
diff --git a/examples/dreamtorus/glx/main.cpp b/examples/dreamtorus/glx/main.cpp
index 0b80b04..4573a2d 100644
--- a/examples/dreamtorus/glx/main.cpp
+++ b/examples/dreamtorus/glx/main.cpp
@@ -27,11 +27,6 @@
 
 */
 
-#include <X11/Xdefs.h>
-#include <X11/Xutil.h>
-
-typedef XID GLXDrawable;
-
 #include <GL/Regal.h>
 #include "render.h"
 
@@ -43,94 +38,94 @@
 
 int main (int argc, char ** argv)
 {
-    Display *dpy = XOpenDisplay(0);
+  Display *dpy = XOpenDisplay(0);
 
-    PFNGLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribsARB = NULL;
+  PFNGLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribsARB = NULL;
 
-    const char *extensions = glXQueryExtensionsString(dpy, DefaultScreen(dpy));
-    printf("%s\n",extensions);
+  const char *extensions = glXQueryExtensionsString(dpy, DefaultScreen(dpy));
+  printf("%s\n",extensions);
 
-    static int visual_attribs[] =
-    {
-      GLX_RENDER_TYPE, GLX_RGBA_BIT,
-      GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT,
-      GLX_DOUBLEBUFFER, true,
-      GLX_RED_SIZE, 1,
-      GLX_GREEN_SIZE, 1,
-      GLX_BLUE_SIZE, 1,
-      None
-    };
+  static int visual_attribs[] =
+  {
+    GLX_RENDER_TYPE, GLX_RGBA_BIT,
+    GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT,
+    GLX_DOUBLEBUFFER, true,
+    GLX_RED_SIZE, 1,
+    GLX_GREEN_SIZE, 1,
+    GLX_BLUE_SIZE, 1,
+    None
+  };
 
-    printf("Getting framebuffer config.\n");
-    int fbcount;
-    GLXFBConfig *fbc = glXChooseFBConfig(dpy, DefaultScreen(dpy), visual_attribs, &fbcount);
-    if (!fbc)
-    {
-      printf("Failed to retrieve a framebuffer config.\n");
-      return 1;
-    }
+  printf("Getting framebuffer config.\n");
+  int fbcount;
+  GLXFBConfig *fbc = glXChooseFBConfig(dpy, DefaultScreen(dpy), visual_attribs, &fbcount);
+  if (!fbc)
+  {
+    printf("Failed to retrieve a framebuffer config.\n");
+    return 1;
+  }
 
-    printf("Getting XVisualInfo\n");
-    XVisualInfo *vi = glXGetVisualFromFBConfig(dpy, fbc[0]);
+  printf("Getting XVisualInfo\n");
+  XVisualInfo *vi = glXGetVisualFromFBConfig(dpy, fbc[0]);
 
-    XSetWindowAttributes swa;
-    printf("Creating colormap\n");
-    swa.colormap = XCreateColormap(dpy, RootWindow(dpy, vi->screen), vi->visual, AllocNone);
-    swa.border_pixel = 0;
-    swa.event_mask = StructureNotifyMask;
+  XSetWindowAttributes swa;
+  printf("Creating colormap\n");
+  swa.colormap = XCreateColormap(dpy, RootWindow(dpy, vi->screen), vi->visual, AllocNone);
+  swa.border_pixel = 0;
+  swa.event_mask = StructureNotifyMask;
 
-    printf("Creating window\n");
-    int width = 500;
-    int height = 500;
-    Window win = XCreateWindow(dpy, RootWindow(dpy, vi->screen), 0, 0, width, height, 0, vi->depth, InputOutput, vi->visual, CWBorderPixel|CWColormap|CWEventMask, &swa);
-    if (!win)
-    {
-      printf("Failed to create window\n");
-      return 1;
-    }
+  printf("Creating window\n");
+  int width = 500;
+  int height = 500;
+  Window win = XCreateWindow(dpy, RootWindow(dpy, vi->screen), 0, 0, width, height, 0, vi->depth, InputOutput, vi->visual, CWBorderPixel|CWColormap|CWEventMask, &swa);
+  if (!win)
+  {
+    printf("Failed to create window\n");
+    return 1;
+  }
 
-    printf("Mapping window\n");
-    XMapWindow(dpy, win);
+  printf("Mapping window\n");
+  XMapWindow(dpy, win);
 
-    // Create an oldstyle context first, to get the correct function pointer for glXCreateContextAttribsARB
-    GLXContext ctx_old = glXCreateContext(dpy, vi, 0, GL_TRUE);
-    glXCreateContextAttribsARB = (PFNGLXCREATECONTEXTATTRIBSARBPROC) glXGetProcAddress((const GLubyte*)"glXCreateContextAttribsARB");
-    printf("glxCreateContextAttribsARB %p\n",glXCreateContextAttribsARB);
-    glXMakeCurrent(dpy, 0, 0);
-    glXDestroyContext(dpy, ctx_old);
+  // Create an oldstyle context first, to get the correct function pointer for glXCreateContextAttribsARB
+  GLXContext ctx_old = glXCreateContext(dpy, vi, 0, GL_TRUE);
+  glXCreateContextAttribsARB = (PFNGLXCREATECONTEXTATTRIBSARBPROC) glXGetProcAddress((const GLubyte*)"glXCreateContextAttribsARB");
+  printf("glxCreateContextAttribsARB %p\n",glXCreateContextAttribsARB);
+  glXMakeCurrent(dpy, 0, 0);
+  glXDestroyContext(dpy, ctx_old);
 
-    if (glXCreateContextAttribsARB == NULL)
-    {
-      printf("glXCreateContextAttribsARB entry point not found. Aborting.\n");
-      return false;
-    }
+  if (glXCreateContextAttribsARB == NULL)
+  {
+    printf("glXCreateContextAttribsARB entry point not found. Aborting.\n");
+    return false;
+  }
 
-    static int context_attribs[] =
-    {
-      GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
-      GLX_CONTEXT_MINOR_VERSION_ARB, 0,
-      None
-    };
+  static int context_attribs[] =
+  {
+    GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
+    GLX_CONTEXT_MINOR_VERSION_ARB, 0,
+    None
+  };
 
-    printf("Creating context\n");
-    GLXContext ctx = glXCreateContextAttribsARB(dpy, fbc[0], NULL, true, context_attribs);
-    if (!ctx)
-    {
-      printf("Failed to create GL3 context.\n");
-      return 1;
-    }
+  printf("Creating context\n");
+  GLXContext ctx = glXCreateContextAttribsARB(dpy, fbc[0], NULL, true, context_attribs);
+  if (!ctx)
+  {
+    printf("Failed to create GL3 context.\n");
+    return 1;
+  }
 
-    printf("Making context current.\n");
-    glXMakeCurrent(dpy, win, ctx);
+  printf("Making context current.\n");
+  glXMakeCurrent(dpy, win, ctx);
 
-    dreamTorusReshape( width, height );
-    for(int i = 0; i < 1000000; i++ ) {
-       dreamTorusDisplay( true );
-       glXSwapBuffers( dpy, win );
-       usleep( 16000 );
-    }
+  dreamTorusReshape( width, height );
+  for(int i = 0; i < 1000000; i++ ) {
+     dreamTorusDisplay( true );
+     glXSwapBuffers( dpy, win );
+     usleep( 16000 );
+  }
 
-    ctx = glXGetCurrentContext();
-    glXMakeCurrent(dpy, 0, 0);
-    glXDestroyContext(dpy, ctx);
+  ctx = glXGetCurrentContext();
+  glXMakeCurrent(dpy, 0, 0);
+  glXDestroyContext(dpy, ctx);
 }
diff --git a/include/GL/Regal.h b/include/GL/Regal.h
index 1f9ab36..46cb554 100644
--- a/include/GL/Regal.h
+++ b/include/GL/Regal.h
@@ -64,6 +64,9 @@
 #  ifndef REGAL_SYS_OSX
 #   define REGAL_SYS_OSX 1
 #  endif
+#  ifndef REGAL_SYS_GLX
+#   define REGAL_SYS_GLX 1
+#  endif
 # endif
 #elif defined(__native_client__)
 # ifndef REGAL_SYS_PPAPI
@@ -76,6 +79,9 @@
 # ifndef REGAL_SYS_EGL
 #  define REGAL_SYS_EGL 1
 # endif
+# ifndef REGAL_SYS_GLX
+#  define REGAL_SYS_GLX 1
+# endif
 #elif defined(EMSCRIPTEN)
 # ifndef REGAL_SYS_EMSCRIPTEN
 #  define REGAL_SYS_EMSCRIPTEN 1
@@ -87,13 +93,12 @@
 #  define REGAL_SYS_ES2 1
 # endif
 # ifndef REGAL_SYS_EMSCRIPTEN_STATIC
-#  define REGAL_SYS_EMSCRIPTEN_STATIC 0
+#  define REGAL_SYS_EMSCRIPTEN_STATIC 1
 # endif
 # if REGAL_SYS_EMSCRIPTEN_STATIC
-#  define REGAL_DRIVER 1
-#  define REGAL_NAMESPACE 1
-#  define REGAL_STATIC_ES2 1
-#  define REGAL_STATIC_EGL 1
+#  ifndef REGAL_NAMESPACE
+#   define REGAL_NAMESPACE 1
+#  endif
 # endif
 #elif !defined(REGAL_SYS_PPAPI) || !REGAL_SYS_PPAPI
 # ifndef REGAL_SYS_X11
@@ -144,6 +149,10 @@
 #define REGAL_SYS_EMSCRIPTEN 0
 #endif
 
+#ifndef REGAL_SYS_EMSCRIPTEN_STATIC
+#define REGAL_SYS_EMSCRIPTEN_STATIC 0
+#endif
+
 #ifndef REGAL_SYS_ES1
 #define REGAL_SYS_ES1 0
 #endif
@@ -213,22 +222,14 @@
 #define __gl_ATI_h_
 #define _OPENGL_H
 
-#if REGAL_SYS_GLX
+#if (REGAL_SYS_GLX || REGAL_SYS_EGL) && REGAL_SYS_X11
+#include <X11/Xlib.h>
 #include <X11/Xdefs.h>
 #include <X11/Xutil.h>
-typedef XID GLXDrawable;
-#endif
-
-#if REGAL_SYS_EGL && REGAL_SYS_X11
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
 #endif
 
 #include <stddef.h>
+
 #if defined(_WIN32)
   typedef __int64 int64_t;
   typedef unsigned __int64 uint64_t;
@@ -325,23 +326,23 @@
 #endif // REGAL_SYS_WGL
 
 #if REGAL_SYS_GLX
-typedef XID GLXVideoCaptureDeviceNV;
 typedef unsigned long XID;
-typedef XID Pixmap;
-typedef XID Font;
 typedef struct _XDisplay Display;
-typedef XID GLXDrawble;
-typedef XID GLXPixmap;
+typedef XID Font;
 typedef struct __GLXcontextRec * GLXContext;
-typedef unsigned int GLXVideoDeviceNV;
-typedef XID GLXWindow;
-typedef XID GLXPbuffer;
-typedef XID GLXFBConfigID;
-typedef struct __GLXFBConfigRec * GLXFBConfig;
 typedef XID GLXContextID;
+typedef XID GLXDrawable;
+typedef struct __GLXFBConfigRec * GLXFBConfig;
+typedef XID GLXFBConfigID;
 typedef XID GLXFBConfigIDSGIX;
 typedef struct __GLXFBConfigRec * GLXFBConfigSGIX;
+typedef XID GLXPbuffer;
 typedef XID GLXPbufferSGIX;
+typedef XID GLXPixmap;
+typedef XID GLXVideoCaptureDeviceNV;
+typedef unsigned int GLXVideoDeviceNV;
+typedef XID GLXWindow;
+typedef XID Pixmap;
 #endif // REGAL_SYS_GLX
 
 #if REGAL_SYS_OSX
@@ -407,6 +408,138 @@
 typedef uint64_t EGLuint64NV;
 #endif // REGAL_SYS_EGL
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* For GLX emulation on non-X11 systems: REGAL_SYS_GLX=1, REGAL_SYS_X11=0 */
+
+#if REGAL_SYS_GLX && !REGAL_SYS_X11
+
+/* X.h */
+
+#define None                 0L
+#define ParentRelative       1L
+#define CopyFromParent       0L
+#define PointerWindow        0L
+#define InputFocus           1L
+#define PointerRoot          1L
+#define AnyPropertyType      0L
+#define AnyKey               0L
+#define AnyButton            0L
+#define AllTemporary         0L
+#define CurrentTime          0L
+#define NoSymbol             0L
+
+#define AllocNone            0
+#define AllocAll             1
+
+#define InputOutput          1
+#define InputOnly            2
+
+#define CWBackPixmap            (1L<<0)
+#define CWBackPixel             (1L<<1)
+#define CWBorderPixmap          (1L<<2)
+#define CWBorderPixel           (1L<<3)
+#define CWBitGravity            (1L<<4)
+#define CWWinGravity            (1L<<5)
+#define CWBackingStore          (1L<<6)
+#define CWBackingPlanes         (1L<<7)
+#define CWBackingPixel          (1L<<8)
+#define CWOverrideRedirect      (1L<<9)
+#define CWSaveUnder             (1L<<10)
+#define CWEventMask             (1L<<11)
+#define CWDontPropagate         (1L<<12)
+#define CWColormap              (1L<<13)
+#define CWCursor                (1L<<14)
+
+#define NoEventMask                     0L
+#define KeyPressMask                    (1L<<0)
+#define KeyReleaseMask                  (1L<<1)
+#define ButtonPressMask                 (1L<<2)
+#define ButtonReleaseMask               (1L<<3)
+#define EnterWindowMask                 (1L<<4)
+#define LeaveWindowMask                 (1L<<5)
+#define PointerMotionMask               (1L<<6)
+#define PointerMotionHintMask           (1L<<7)
+#define Button1MotionMask               (1L<<8)
+#define Button2MotionMask               (1L<<9)
+#define Button3MotionMask               (1L<<10)
+#define Button4MotionMask               (1L<<11)
+#define Button5MotionMask               (1L<<12)
+#define ButtonMotionMask                (1L<<13)
+#define KeymapStateMask                 (1L<<14)
+#define ExposureMask                    (1L<<15)
+#define VisibilityChangeMask            (1L<<16)
+#define StructureNotifyMask             (1L<<17)
+#define ResizeRedirectMask              (1L<<18)
+#define SubstructureNotifyMask          (1L<<19)
+#define SubstructureRedirectMask        (1L<<20)
+#define FocusChangeMask                 (1L<<21)
+#define PropertyChangeMask              (1L<<22)
+#define ColormapChangeMask              (1L<<23)
+#define OwnerGrabButtonMask             (1L<<24)
+
+typedef XID              Window;
+typedef XID              Atom;
+typedef XID              Status;
+typedef XID              Drawable;
+typedef int              Bool;
+typedef XID              Colormap;
+typedef XID              Cursor;
+typedef void *           Screen;
+typedef unsigned long    VisualID;
+
+/* Xlib.h */
+
+typedef struct {
+  VisualID visualid;
+} Visual;
+
+typedef struct {
+    Pixmap background_pixmap;
+    unsigned long background_pixel;
+    Pixmap border_pixmap;
+    unsigned long border_pixel;
+    int bit_gravity;
+    int win_gravity;
+    int backing_store;
+    unsigned long backing_planes;
+    unsigned long backing_pixel;
+    Bool save_under;
+    long event_mask;
+    long do_not_propagate_mask;
+    Bool override_redirect;
+    Colormap colormap;
+    Cursor cursor;
+} XSetWindowAttributes;
+
+/* Xutil.h */
+
+typedef struct
+{
+   Visual       *visual;
+   int           screen;
+   int           depth;
+   unsigned long red_mask;
+   unsigned long green_mask;
+   unsigned long blue_mask;
+   int           colormap_size;
+   int           bits_per_rgb;
+} XVisualInfo;
+
+REGAL_DECL Display *XOpenDisplay(char *display_name);
+REGAL_DECL int      XCloseDisplay(Display *display);
+REGAL_DECL int      DefaultScreen(Display *display);
+REGAL_DECL Window   RootWindow(Display *display, int screen_number);
+REGAL_DECL int      XMapWindow(Display *display, Window w);
+REGAL_DECL Window   XCreateWindow(Display *display, Window parent, int x, int y, unsigned int width, unsigned int height, unsigned int border_width, int depth, unsigned int clss, Visual *visual, unsigned long valuemask, XSetWindowAttributes *attributes);
+REGAL_DECL Colormap XCreateColormap(Display *display, Window w, Visual *visual, int alloc);
+REGAL_DECL Pixmap   XCreatePixmap(Display *display, Drawable d, unsigned int width, unsigned int height, unsigned int depth);
+REGAL_DECL int      XFreePixmap(Display *display, Pixmap pixmap);
+
+#endif
+
 /* TODO: make this automatic? */
 
 typedef void (REGAL_CALL *GLDEBUGPROCAMD)(GLuint id, GLenum category, GLenum severity, GLsizei length, const GLchar *message, GLvoid *userParam);
@@ -21306,6 +21439,103 @@
 #endif
 
 /**
+ ** GL_NV_blend_equation_advanced
+ **/
+
+#if (defined(GL_NV_BLEND_EQUATION_ADVANCED) || defined(REGAL_NO_ENUM) || defined(REGAL_NO_GL_NV_BLEND_EQUATION_ADVANCED)) && !defined(REGAL_NO_ENUM_GL_NV_BLEND_EQUATION_ADVANCED)
+#define REGAL_NO_ENUM_GL_NV_BLEND_EQUATION_ADVANCED
+#endif
+
+#if (defined(GL_NV_BLEND_EQUATION_ADVANCED) || defined(REGAL_NO_TYPEDEF) || defined(REGAL_NO_GL_NV_BLEND_EQUATION_ADVANCED)) && !defined(REGAL_NO_TYPEDEF_GL_NV_BLEND_EQUATION_ADVANCED)
+#define REGAL_NO_TYPEDEF_GL_NV_BLEND_EQUATION_ADVANCED
+#endif
+
+#if (defined(GL_NV_BLEND_EQUATION_ADVANCED) || !defined(REGAL_NAMESPACE) || defined(REGAL_NO_GL_NV_BLEND_EQUATION_ADVANCED)) && !defined(REGAL_NO_NAMESPACE_GL_NV_BLEND_EQUATION_ADVANCED)
+#define REGAL_NO_NAMESPACE_GL_NV_BLEND_EQUATION_ADVANCED
+#endif
+
+#if (defined(GL_NV_BLEND_EQUATION_ADVANCED) || !defined(REGAL_PLUGIN_MODE) || defined(REGAL_NO_GL_NV_BLEND_EQUATION_ADVANCED)) && !defined(REGAL_NO_PLUGIN_GL_NV_BLEND_EQUATION_ADVANCED)
+#define REGAL_NO_PLUGIN_GL_NV_BLEND_EQUATION_ADVANCED
+#endif
+
+#if (defined(GL_NV_BLEND_EQUATION_ADVANCED) || defined(REGAL_NO_DECLARATION) || defined(REGAL_NO_GL_NV_BLEND_EQUATION_ADVANCED)) && !defined(REGAL_NO_DECLARATION_GL_NV_BLEND_EQUATION_ADVANCED)
+#define REGAL_NO_DECLARATION_GL_NV_BLEND_EQUATION_ADVANCED
+#endif
+
+#ifndef GL_NV_blend_equation_advanced
+#define GL_NV_blend_equation_advanced 1
+#endif
+
+#ifndef REGAL_NO_ENUM_GL_NV_BLEND_EQUATION_ADVANCED
+#define GL_BLEND_PREMULTIPLIED_SRC_NV 0x9280     /* 37504 */
+#define GL_BLEND_OVERLAP_NV           0x9281     /* 37505 */
+#define GL_UNCORRELATED_NV            0x9282     /* 37506 */
+#define GL_DISJOINT_NV                0x9283     /* 37507 */
+#define GL_CONJOINT_NV                0x9284     /* 37508 */
+#define GL_BLEND_ADVANCED_COHERENT_NV 0x9285     /* 37509 */
+#define GL_SRC_NV                     0x9286     /* 37510 */
+#define GL_DST_NV                     0x9287     /* 37511 */
+#define GL_SRC_OVER_NV                0x9288     /* 37512 */
+#define GL_DST_OVER_NV                0x9289     /* 37513 */
+#define GL_SRC_IN_NV                  0x928a     /* 37514 */
+#define GL_DST_IN_NV                  0x928b     /* 37515 */
+#define GL_SRC_OUT_NV                 0x928c     /* 37516 */
+#define GL_DST_OUT_NV                 0x928d     /* 37517 */
+#define GL_SRC_ATOP_NV                0x928e     /* 37518 */
+#define GL_DST_ATOP_NV                0x928f     /* 37519 */
+#define GL_PLUS_NV                    0x9291     /* 37521 */
+#define GL_PLUS_DARKER_NV             0x9292     /* 37522 */
+#define GL_MULTIPLY_NV                0x9294     /* 37524 */
+#define GL_SCREEN_NV                  0x9295     /* 37525 */
+#define GL_OVERLAY_NV                 0x9296     /* 37526 */
+#define GL_DARKEN_NV                  0x9297     /* 37527 */
+#define GL_LIGHTEN_NV                 0x9298     /* 37528 */
+#define GL_COLORDODGE_NV              0x9299     /* 37529 */
+#define GL_COLORBURN_NV               0x929a     /* 37530 */
+#define GL_HARDLIGHT_NV               0x929b     /* 37531 */
+#define GL_SOFTLIGHT_NV               0x929c     /* 37532 */
+#define GL_DIFFERENCE_NV              0x929e     /* 37534 */
+#define GL_MINUS_NV                   0x929f     /* 37535 */
+#define GL_EXCLUSION_NV               0x92a0     /* 37536 */
+#define GL_CONTRAST_NV                0x92a1     /* 37537 */
+#define GL_INVERT_RGB_NV              0x92a3     /* 37539 */
+#define GL_LINEARDODGE_NV             0x92a4     /* 37540 */
+#define GL_LINEARBURN_NV              0x92a5     /* 37541 */
+#define GL_VIVIDLIGHT_NV              0x92a6     /* 37542 */
+#define GL_LINEARLIGHT_NV             0x92a7     /* 37543 */
+#define GL_PINLIGHT_NV                0x92a8     /* 37544 */
+#define GL_HARDMIX_NV                 0x92a9     /* 37545 */
+#define GL_HSL_HUE_NV                 0x92ad     /* 37549 */
+#define GL_HSL_SATURATION_NV          0x92ae     /* 37550 */
+#define GL_HSL_COLOR_NV               0x92af     /* 37551 */
+#define GL_HSL_LUMINOSITY_NV          0x92b0     /* 37552 */
+#define GL_PLUS_CLAMPED_NV            0x92b1     /* 37553 */
+#define GL_PLUS_CLAMPED_ALPHA_NV      0x92b2     /* 37554 */
+#define GL_MINUS_CLAMPED_NV           0x92b3     /* 37555 */
+#define GL_INVERT_OVG_NV              0x92b4     /* 37556 */
+#endif
+
+#ifndef REGAL_NO_TYPEDEF_GL_NV_BLEND_EQUATION_ADVANCED
+typedef void (REGAL_CALL *PFNGLBLENDBARRIERNVPROC)(void);
+typedef void (REGAL_CALL *PFNGLBLENDPARAMETERINVPROC)(GLenum pname, GLint value);
+#endif
+
+#ifndef REGAL_NO_NAMESPACE_GL_NV_BLEND_EQUATION_ADVANCED
+#define glBlendBarrierNV                    rglBlendBarrierNV
+#define glBlendParameteriNV                 rglBlendParameteriNV
+#endif
+
+#ifndef REGAL_NO_DECLARATION_GL_NV_BLEND_EQUATION_ADVANCED
+REGAL_DECL void REGAL_CALL glBlendBarrierNV(void);
+REGAL_DECL void REGAL_CALL glBlendParameteriNV(GLenum pname, GLint value);
+#endif
+
+#ifndef REGAL_NO_PLUGIN_GL_NV_BLEND_EQUATION_ADVANCED
+REGAL_DECL void REGAL_CALL plugin_glBlendBarrierNV(void);
+REGAL_DECL void REGAL_CALL plugin_glBlendParameteriNV(GLenum pname, GLint value);
+#endif
+
+/**
  ** GL_NV_compute_program5
  **/
 
diff --git a/include/GL/RegalGLEW.h b/include/GL/RegalGLEW.h
index 51a29ef..1f4ab51 100644
--- a/include/GL/RegalGLEW.h
+++ b/include/GL/RegalGLEW.h
@@ -2731,6 +2731,15 @@
 
 #endif /* GL_AMD_seamless_cubemap_per_texture */
 
+/* -------------------- GL_AMD_shader_atomic_counter_ops ------------------- */
+
+#ifndef GL_AMD_shader_atomic_counter_ops
+#define GL_AMD_shader_atomic_counter_ops 1
+
+#define GLEW_AMD_shader_atomic_counter_ops GLEW_GET_VAR(__GLEW_AMD_shader_atomic_counter_ops)
+
+#endif /* GL_AMD_shader_atomic_counter_ops */
+
 /* ---------------------- GL_AMD_shader_stencil_export --------------------- */
 
 #ifndef GL_AMD_shader_stencil_export
@@ -17499,6 +17508,7 @@
 GLEW_VAR_EXPORT GLboolean __GLEW_AMD_query_buffer_object;
 GLEW_VAR_EXPORT GLboolean __GLEW_AMD_sample_positions;
 GLEW_VAR_EXPORT GLboolean __GLEW_AMD_seamless_cubemap_per_texture;
+GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_atomic_counter_ops;
 GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_stencil_export;
 GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_trinary_minmax;
 GLEW_VAR_EXPORT GLboolean __GLEW_AMD_sparse_texture;
diff --git a/scripts/DispatchDebug.py b/scripts/DispatchDebug.py
index 593a2d2..cc54137 100644
--- a/scripts/DispatchDebug.py
+++ b/scripts/DispatchDebug.py
@@ -6,7 +6,7 @@
         'prefix' : [ '_context->dbg->MatrixMode( _context, ${arg0plus} );', ],
     },
     'ClientActiveTexture' : {
-        'entries' : [ 'gl(Client|)(ActiveTexture)' ],
+        'entries' : [ 'gl(Client|)(ActiveTexture)(ARB|)' ],
         'prefix' : [ '_context->dbg->${m1}${m2}( _context, ${arg0plus} );', ],
     },
 }
diff --git a/scripts/Emu.py b/scripts/Emu.py
index e1d840b..44c8a44 100644
--- a/scripts/Emu.py
+++ b/scripts/Emu.py
@@ -53,7 +53,14 @@
     return
 
   entry[section] = []
-  for i in formula[section]:
+
+  # Turn a string into a list, if necessary
+
+  tmp = formula[section]
+  if isinstance(tmp,str) or isinstance(tmp,unicode):
+    tmp = [ tmp ]
+
+  for i in tmp:
     j = Template(i)
     entry[section].append(j.substitute(subs))
 
diff --git a/scripts/EmuBaseVertex.py b/scripts/EmuBaseVertex.py
index 5b2dcec..14ec1c4 100644
--- a/scripts/EmuBaseVertex.py
+++ b/scripts/EmuBaseVertex.py
@@ -30,7 +30,7 @@
     'prefix'  : [ '_context->bv->glMultiTexCoordPointerEXT( ${arg0plus} );', ],
   },
   'ClientActiveTexture' : {
-    'entries' : [ 'glClientActiveTexture' ],
+    'entries' : [ 'glClientActiveTexture(ARB|)' ],
     'prefix'  : [ '_context->bv->glClientActiveTexture( ${arg0plus} );', ],
   },
   'PrimitiveRestartIndex' : {
diff --git a/scripts/EmuCache.py b/scripts/EmuCache.py
index 90dfd40..faa6590 100644
--- a/scripts/EmuCache.py
+++ b/scripts/EmuCache.py
@@ -11,7 +11,7 @@
     'glShaderSource' : {
         'entries' : [ 'glShaderSource' ],
         'pre' : [
-          'if (REGAL_CACHE && REGAL_CACHE_SHADER)\n',
+          'if (REGAL_CACHE && REGAL_CACHE_SHADER)',
           '{',
           '  Cache::shaderSource(_next->call(&_next->glShaderSource), shader, count, string, length);',
           '  return;',
@@ -28,7 +28,7 @@
     'glBindTexture' : {
         'entries' : [ 'glBindTexture' ],
         'pre' : [
-          'if (REGAL_CACHE && REGAL_CACHE_TEXTURE)\n',
+          'if (REGAL_CACHE && REGAL_CACHE_TEXTURE)',
           '{',
           '  Cache::bindTexture(_next->call(&_next->glBindTexture),_next->call(&_next->glGetTexLevelParameteriv),_next->call(&_next->glGetTexImage), target, texture);',
           '  return;',
diff --git a/scripts/EmuDsa.py b/scripts/EmuDsa.py
index cd8f771..c65853c 100644
--- a/scripts/EmuDsa.py
+++ b/scripts/EmuDsa.py
@@ -79,7 +79,7 @@
     },
 
     'ClientActiveTexture' : {
-        'entries' : [ 'glClientActiveTexture' ],
+        'entries' : [ 'glClientActiveTexture(ARB|)' ],
         'impl' : [
             'if (!_context->dsa->ShadowClientActiveTexture( ${arg0} )) {',
             '  _dispatch.call(&_dispatch.glClientActiveTexture)( ${arg0} );',
@@ -118,7 +118,7 @@
         ],
     },
     'ActiveTexture' : {
-        'entries' : [ 'glActiveTexture' ],
+        'entries' : [ 'glActiveTexture(ARB|)' ],
         'impl' : [
             'if( false == _context->dsa->ShadowActiveTexture( ${arg0} ) ) {',
             '    _dispatch.call(&_dispatch.glActiveTexture)( ${arg0} );',
diff --git a/scripts/EmuEnable.py b/scripts/EmuEnable.py
index 5a832e8..3325dd4 100644
--- a/scripts/EmuEnable.py
+++ b/scripts/EmuEnable.py
@@ -5,213 +5,221 @@
 formulae = {
     'Enable' : {
         'entries' : [ 'glEnable' ],
-        'impl' : [ '''
-  switch(${arg0})
-  {
-    case GL_ERROR_REGAL:
-      #if REGAL_ERROR
-      _context->dispatcher.enable(_context->dispatcher.error);
-      #endif
-      return;
+        'impl' : '''
+switch(${arg0})
+{
+  case GL_ERROR_REGAL:
+    #if REGAL_ERROR
+    _context->dispatcher.enable(_context->dispatcher.error);
+    #endif
+    return;
 
-    case GL_DEBUG_REGAL:
-      #if REGAL_DEBUG
-      _context->dispatcher.enable(_context->dispatcher.debug);
-      if (!_context->dbg)
-      {
-        _context->dbg = new DebugInfo();
-        _context->dbg->Init(_context);
-      }
-      #endif
-      return;
+  case GL_DEBUG_REGAL:
+    #if REGAL_DEBUG
+    _context->dispatcher.enable(_context->dispatcher.debug);
+    if (!_context->dbg)
+    {
+      _context->dbg = new DebugInfo();
+      _context->dbg->Init(_context);
+    }
+    #endif
+    return;
 
-    case GL_LOG_REGAL:
-      #if REGAL_LOG
-      _context->dispatcher.enable(_context->dispatcher.logging);
-      #endif
-      return;
+  case GL_LOG_REGAL:
+    #if REGAL_LOG
+    _context->dispatcher.enable(_context->dispatcher.logging);
+    #endif
+    return;
 
-    case GL_EMULATION_REGAL:
-      #if REGAL_EMULATION
-      _context->dispatcher.enable(_context->dispatcher.emulation);
-      #endif
-      return;
+  case GL_EMULATION_REGAL:
+    #if REGAL_EMULATION
+    _context->dispatcher.enable(_context->dispatcher.emulation);
+    #endif
+    return;
 
-    case GL_DRIVER_REGAL:
-      #if REGAL_DRIVER
-      _context->dispatcher.enable(_context->dispatcher.driver);
-      #endif
-      return;
+  case GL_DRIVER_REGAL:
+    #if REGAL_DRIVER
+    _context->dispatcher.enable(_context->dispatcher.driver);
+    #endif
+    return;
 
-    case GL_MISSING_REGAL:
-      _context->dispatcher.enable(_context->dispatcher.missing);
-      return;
+  case GL_MISSING_REGAL:
+    #if REGAL_MISSING
+    _context->dispatcher.enable(_context->dispatcher.missing);
+    #endif
+    return;
 
-    case GL_TRACE_REGAL:
-      #if REGAL_TRACE
-      _context->dispatcher.enable(_context->dispatcher.trace);
-      #endif
-      return;
+  case GL_TRACE_REGAL:
+    #if REGAL_TRACE
+    _context->dispatcher.enable(_context->dispatcher.trace);
+    #endif
+    return;
 
-    case GL_CACHE_REGAL:
-      #if REGAL_CACHE
-      _context->dispatcher.enable(_context->dispatcher.cache);
-      #endif
-      return;
+  case GL_CACHE_REGAL:
+    #if REGAL_CACHE
+    _context->dispatcher.enable(_context->dispatcher.cache);
+    #endif
+    return;
 
-    case GL_CODE_REGAL:
-      #if REGAL_CODE
-      _context->dispatcher.enable(_context->dispatcher.code);
-      #endif
-      return;
+  case GL_CODE_REGAL:
+    #if REGAL_CODE
+    _context->dispatcher.enable(_context->dispatcher.code);
+    #endif
+    return;
 
-    case GL_STATISTICS_REGAL:
-      #if REGAL_STATISTICS
-      _context->dispatcher.enable(_context->dispatcher.statistics);
-      #endif
-      return;
+  case GL_STATISTICS_REGAL:
+    #if REGAL_STATISTICS
+    _context->dispatcher.enable(_context->dispatcher.statistics);
+    #endif
+    return;
 
-    default: break;
-  }''' ],
+  default: break;
+}''',
     },
     'Disable' : {
         'entries' : [ 'glDisable' ],
-        'impl' : [ '''
-  switch(${arg0})
-  {
-    case GL_ERROR_REGAL:
-      #if REGAL_ERROR
-      _context->dispatcher.disable(_context->dispatcher.error);
-      #endif
-      return;
+        'impl' : '''
+switch(${arg0})
+{
+  case GL_ERROR_REGAL:
+    #if REGAL_ERROR
+    _context->dispatcher.disable(_context->dispatcher.error);
+    #endif
+    return;
 
-    case GL_DEBUG_REGAL:
-      #if REGAL_DEBUG
-      _context->dispatcher.disable(_context->dispatcher.debug);
-      #endif
-      return;
+  case GL_DEBUG_REGAL:
+    #if REGAL_DEBUG
+    _context->dispatcher.disable(_context->dispatcher.debug);
+    #endif
+    return;
 
-    case GL_LOG_REGAL:
-      #if REGAL_LOG
-      _context->dispatcher.disable(_context->dispatcher.logging);
-      #endif
-      return;
+  case GL_LOG_REGAL:
+    #if REGAL_LOG
+    _context->dispatcher.disable(_context->dispatcher.logging);
+    #endif
+    return;
 
-    case GL_EMULATION_REGAL:
-      #if REGAL_EMULATION
-      _context->dispatcher.disable(_context->dispatcher.emulation);
-      #endif
-      return;
+  case GL_EMULATION_REGAL:
+    #if REGAL_EMULATION
+    _context->dispatcher.disable(_context->dispatcher.emulation);
+    #endif
+    return;
 
-    case GL_DRIVER_REGAL:
-      #if REGAL_DRIVER
-      _context->dispatcher.disable(_context->dispatcher.driver);
-      #endif
-      return;
+  case GL_DRIVER_REGAL:
+    #if REGAL_DRIVER
+    _context->dispatcher.disable(_context->dispatcher.driver);
+    #endif
+    return;
 
-    case GL_MISSING_REGAL:
-      _context->dispatcher.disable(_context->dispatcher.missing);
-      return;
+  case GL_MISSING_REGAL:
+    #if REGAL_MISSING
+    _context->dispatcher.disable(_context->dispatcher.missing);
+    #endif
+    return;
 
-    case GL_TRACE_REGAL:
-      #if REGAL_TRACE
-      _context->dispatcher.disable(_context->dispatcher.trace);
-      #endif
-      return;
+  case GL_TRACE_REGAL:
+    #if REGAL_TRACE
+    _context->dispatcher.disable(_context->dispatcher.trace);
+    #endif
+    return;
 
-    case GL_CACHE_REGAL:
-      #if REGAL_CACHE
-      _context->dispatcher.disable(_context->dispatcher.cache);
-      #endif
-      return;
+  case GL_CACHE_REGAL:
+    #if REGAL_CACHE
+    _context->dispatcher.disable(_context->dispatcher.cache);
+    #endif
+    return;
 
-    case GL_CODE_REGAL:
-      #if REGAL_CODE
-      _context->dispatcher.disable(_context->dispatcher.code);
-      #endif
-      return;
+  case GL_CODE_REGAL:
+    #if REGAL_CODE
+    _context->dispatcher.disable(_context->dispatcher.code);
+    #endif
+    return;
 
-    case GL_STATISTICS_REGAL:
-      #if REGAL_STATISTICS
-      _context->dispatcher.disable(_context->dispatcher.statistics);
-      #endif
-      return;
+  case GL_STATISTICS_REGAL:
+    #if REGAL_STATISTICS
+    _context->dispatcher.disable(_context->dispatcher.statistics);
+    #endif
+    return;
 
-    default: break;
-  }''' ],
+  default: break;
+}''',
     },
     'IsEnabled' : {
         'entries' : [ 'glIsEnabled' ],
-        'impl' : [ '''
-  switch(${arg0})
-  {
-    case GL_ERROR_REGAL:
-      #if REGAL_ERROR
-      return _context->dispatcher.isEnabled(_context->dispatcher.error) ? GL_TRUE : GL_FALSE;
-      #else
-      return GL_FALSE;
-      #endif
+        'impl' : '''
+switch(${arg0})
+{
+  case GL_ERROR_REGAL:
+    #if REGAL_ERROR
+    return _context->dispatcher.isEnabled(_context->dispatcher.error) ? GL_TRUE : GL_FALSE;
+    #else
+    return GL_FALSE;
+    #endif
 
-    case GL_DEBUG_REGAL:
-      #if REGAL_DEBUG
-      return _context->dispatcher.isEnabled(_context->dispatcher.debug) ? GL_TRUE : GL_FALSE;
-      #else
-      return GL_FALSE;
-      #endif
+  case GL_DEBUG_REGAL:
+    #if REGAL_DEBUG
+    return _context->dispatcher.isEnabled(_context->dispatcher.debug) ? GL_TRUE : GL_FALSE;
+    #else
+    return GL_FALSE;
+    #endif
 
-    case GL_LOG_REGAL:
-      #if REGAL_LOG
-      return _context->dispatcher.isEnabled(_context->dispatcher.logging) ? GL_TRUE : GL_FALSE;
-      #else
-      return GL_FALSE;
-      #endif
+  case GL_LOG_REGAL:
+    #if REGAL_LOG
+    return _context->dispatcher.isEnabled(_context->dispatcher.logging) ? GL_TRUE : GL_FALSE;
+    #else
+    return GL_FALSE;
+    #endif
 
-    case GL_EMULATION_REGAL:
-      #if REGAL_EMULATION
-      return _context->dispatcher.isEnabled(_context->dispatcher.emulation) ? GL_TRUE : GL_FALSE;
-      #else
-      return GL_FALSE;
-      #endif
+  case GL_EMULATION_REGAL:
+    #if REGAL_EMULATION
+    return _context->dispatcher.isEnabled(_context->dispatcher.emulation) ? GL_TRUE : GL_FALSE;
+    #else
+    return GL_FALSE;
+    #endif
 
-    case GL_DRIVER_REGAL:
-      #if REGAL_DRIVER
-      return _context->dispatcher.isEnabled(_context->dispatcher.driver) ? GL_TRUE : GL_FALSE;
-      #else
-      return GL_FALSE;
-      #endif
+  case GL_DRIVER_REGAL:
+    #if REGAL_DRIVER
+    return _context->dispatcher.isEnabled(_context->dispatcher.driver) ? GL_TRUE : GL_FALSE;
+    #else
+    return GL_FALSE;
+    #endif
 
-    case GL_MISSING_REGAL:
-      return _context->dispatcher.isEnabled(_context->dispatcher.missing) ? GL_TRUE : GL_FALSE;
+  case GL_MISSING_REGAL:
+    #if REGAL_MISSING
+    return _context->dispatcher.isEnabled(_context->dispatcher.missing) ? GL_TRUE : GL_FALSE;
+    #else
+    return GL_FALSE;
+    #endif
 
-    case GL_TRACE_REGAL:
-      #if REGAL_TRACE
-      return _context->dispatcher.isEnabled(_context->dispatcher.trace) ? GL_TRUE : GL_FALSE;
-      #else
-      return GL_FALSE;
-      #endif
+  case GL_TRACE_REGAL:
+    #if REGAL_TRACE
+    return _context->dispatcher.isEnabled(_context->dispatcher.trace) ? GL_TRUE : GL_FALSE;
+    #else
+    return GL_FALSE;
+    #endif
 
-    case GL_CACHE_REGAL:
-      #if REGAL_CACHE
-      return _context->dispatcher.isEnabled(_context->dispatcher.cache) ? GL_TRUE : GL_FALSE;
-      #else
-      return GL_FALSE;
-      #endif
+  case GL_CACHE_REGAL:
+    #if REGAL_CACHE
+    return _context->dispatcher.isEnabled(_context->dispatcher.cache) ? GL_TRUE : GL_FALSE;
+    #else
+    return GL_FALSE;
+    #endif
 
-    case GL_CODE_REGAL:
-      #if REGAL_CODE
-      return _context->dispatcher.isEnabled(_context->dispatcher.code) ? GL_TRUE : GL_FALSE;
-      #else
-      return GL_FALSE;
-      #endif
+  case GL_CODE_REGAL:
+    #if REGAL_CODE
+    return _context->dispatcher.isEnabled(_context->dispatcher.code) ? GL_TRUE : GL_FALSE;
+    #else
+    return GL_FALSE;
+    #endif
 
-    case GL_STATISTICS_REGAL:
-      #if REGAL_STATISTICS
-      return _context->dispatcher.isEnabled(_context->dispatcher.statistics) ? GL_TRUE : GL_FALSE;
-      #else
-      return GL_FALSE;
-      #endif
+  case GL_STATISTICS_REGAL:
+    #if REGAL_STATISTICS
+    return _context->dispatcher.isEnabled(_context->dispatcher.statistics) ? GL_TRUE : GL_FALSE;
+    #else
+    return GL_FALSE;
+    #endif
 
-    default: break;
-  }''' ],
+  default: break;
+}''',
     },
 }
diff --git a/scripts/EmuFrame.py b/scripts/EmuFrame.py
index 73893b4..4de340e 100644
--- a/scripts/EmuFrame.py
+++ b/scripts/EmuFrame.py
@@ -38,7 +38,9 @@
                    'RegalContext *_context = REGAL_GET_CONTEXT();',
                    'if (_context)',
                    '{',
+                   '    #if REGAL_SYS_X11',
                    '    _context->x11Display  = dpy;',
+                   '    #endif',
                    '    _context->x11Drawable = drawable;',
                    '}',
                    '// Notify Regal::Frame about the swap buffers event.',
@@ -55,7 +57,9 @@
                    'RegalContext *_context = REGAL_GET_CONTEXT();',
                    'if (_context)',
                    '{',
+                   '    #if REGAL_SYS_X11',
                    '    _context->x11Display  = dpy;',
+                   '    #endif',
                    '    _context->x11Drawable = drawable;',
                    '}'
                  ]
diff --git a/scripts/EmuGLX.py b/scripts/EmuGLX.py
new file mode 100644
index 0000000..5416987
--- /dev/null
+++ b/scripts/EmuGLX.py
@@ -0,0 +1,36 @@
+#!/usr/bin/python -B
+
+# RegalDispatchGLX - GLX emulation
+
+formulaeGlobal = {
+
+  # glXQueryExtensionsString
+
+  'glXQueryExtensionsString' : {
+    'entries' : [ 'glXQueryExtensionsString' ],
+    'impl' : '''
+const char *extensions = "";
+return extensions;
+'''
+  },
+
+  # glXChooseFBConfig
+
+  'glXChooseFBConfig' : {
+    'entries' : [ 'glXChooseFBConfig' ],
+    'impl' : '''
+static GLXFBConfig configs[1];
+return configs;
+'''
+  },
+
+  # glXGetVisualFromFBConfig
+
+  'glXGetVisualFromFBConfig' : {
+    'entries' : [ 'glXGetVisualFromFBConfig' ],
+    'impl' : '''
+static XVisualInfo vi;
+return &vi;
+'''
+  },
+}
diff --git a/scripts/EmuPixelTransfer.py b/scripts/EmuPixelTransfer.py
index 059fe40..8a3d19d 100644
--- a/scripts/EmuPixelTransfer.py
+++ b/scripts/EmuPixelTransfer.py
@@ -6,7 +6,7 @@
         'prefix' : [ '_context->xfer->PixelStore( _context, ${arg0plus} );', ],
     },
    'ActiveTexture' : {
-        'entries' : [ 'glActiveTexture' ],
+        'entries' : [ 'glActiveTexture(ARB|)' ],
         'prefix' : [ '_context->xfer->ShadowActiveTexture( ${arg0} );', ],
     },
     'TexImage2D' : {
diff --git a/scripts/EmuPpc.py b/scripts/EmuPpc.py
index 64474a9..b0e817b 100644
--- a/scripts/EmuPpc.py
+++ b/scripts/EmuPpc.py
@@ -30,7 +30,7 @@
         'prefix' : [ 'rCtx->ppc->${m1}VertexAttribArray( rCtx, ${arg0} );' ],
     },
     'ClientActiveTexture' : {
-        'entries' : [ 'glClientActiveTexture' ],
+        'entries' : [ 'glClientActiveTexture(ARB|)' ],
         'prefix' : [ 'rCtx->ppc->ClientActiveTexture( rCtx, ${arg0} );' ],
     },
     'Pointer4' : {
diff --git a/scripts/EmuPpca.py b/scripts/EmuPpca.py
index 2b8e5db..e58adbf 100644
--- a/scripts/EmuPpca.py
+++ b/scripts/EmuPpca.py
@@ -6,26 +6,24 @@
 
   'PushClientAttrib' : {
     'entries'  : [ 'glPushClientAttrib' ],
-    'impl'     : [ '_context->ppca->glPushClientAttrib( _context, ${arg0} );', ],
+    'impl'     : [ '_context->ppca->glPushClientAttrib( *_context, ${arg0} );', ],
   },
 
   'PopClientAttrib' : {
     'entries' : [ 'glPopClientAttrib' ],
-    'impl'    : [ '_context->ppca->glPopClientAttrib( _context );', ],
+    'impl'    : [ '_context->ppca->glPopClientAttrib( *_context );', ],
   },
 
   'PushClientAttribDefaultEXT' : {
     'entries'  : [ 'gl(Push|)ClientAttribDefaultEXT' ],
-    'impl'     : [ '_context->ppca->gl${m1}ClientAttribDefaultEXT( _context, ${arg0} );', ],
+    'impl'     : [ '_context->ppca->gl${m1}ClientAttribDefaultEXT( *_context, ${arg0} );', ],
   },
 
   'Get'       : {
     'entries' : [ 'glGet(Integer|Float|Double|Boolean)v(EXT|)' ],
     'impl'    : [
-      'if ( ! _context->ppca->glGetv( _context, ${arg0plus} ) ) {',
-      '  if (!_context->info->core && !_context->info->es1 && !_context->info->es2) {',
-      '    _context->dispatcher.emulation.glGet${m1}v${m2}( ${arg0plus} );',
-      '  }',
+      'if ( ! _context->ppca->glGetv( *_context, ${arg0plus} ) ) {',
+      '  _context->dispatcher.emulation.glGet${m1}v${m2}( ${arg0plus} );',
       '}',
     ],
   },
@@ -56,7 +54,7 @@
     'prefix'  : [ '_context->ppca->glMultiTexCoordPointerEXT( ${arg0plus} );', ],
   },
   'ClientActiveTexture' : {
-    'entries' : [ 'glClientActiveTexture' ],
+    'entries' : [ 'glClientActiveTexture(ARB|)' ],
     'prefix'  : [ '_context->ppca->glClientActiveTexture( ${arg0plus} );', ],
   },
   'PrimitiveRestartIndex' : {
diff --git a/scripts/EmuSo.py b/scripts/EmuSo.py
index 5296424..d0f8e85 100644
--- a/scripts/EmuSo.py
+++ b/scripts/EmuSo.py
@@ -39,7 +39,7 @@
         ]
     },
     'ActiveTexture' : {
-        'entries' : [ 'glActiveTexture' ],
+        'entries' : [ 'glActiveTexture(ARB|)' ],
         'impl' : [
             'RegalAssert(_context);',
             'if ( !_context->so->ActiveTexture( *_context, ${arg0plus} ) ) {',
diff --git a/scripts/EmuVao.py b/scripts/EmuVao.py
index 0fb5d80..cd79cb8 100644
--- a/scripts/EmuVao.py
+++ b/scripts/EmuVao.py
@@ -87,7 +87,7 @@
         'impl' : [ '_context->vao->${m1}Pointer( _context, ${arg0}, ${arg1}, ${arg2} );' ],
     },
     'ClientActiveTexture' : {
-        'entries' : [ 'glClientActiveTexture' ],
+        'entries' : [ 'glClientActiveTexture(ARB|)' ],
         'prefix' : [ '_context->vao->ClientActiveTexture( _context, ${arg0} );' ],
     },
 }
diff --git a/scripts/Export.py b/scripts/Export.py
index 9307b23..aceac0b 100755
--- a/scripts/Export.py
+++ b/scripts/Export.py
@@ -42,6 +42,7 @@
 from RegalDispatchError      import *
 from RegalDispatchEmu        import *
 from RegalDispatchGMock      import *
+from RegalDispatchGLX        import *
 from RegalDispatchLog        import *
 from RegalDispatchLoader     import *
 from RegalDispatchMissing    import *
@@ -200,6 +201,7 @@
 def generate(apis, args):
 
   traverse(apis, args)
+  generateDispatchGLX(apis, args)
   generateTraceSource( apis, args )
   generatePublicHeader(apis, args)
   generatePluginSource(apis,args)
diff --git a/scripts/api/Api.py b/scripts/api/Api.py
index fceb53d..0bf8bee 100644
--- a/scripts/api/Api.py
+++ b/scripts/api/Api.py
@@ -4,6 +4,7 @@
 
   def __init__(self):
 
+    self.name       = ''
     self.functions  = []
     self.typedefs   = []
     self.enums      = []
diff --git a/scripts/api/ApiCodeGen.py b/scripts/api/ApiCodeGen.py
index bfdbc21..bfc1d59 100644
--- a/scripts/api/ApiCodeGen.py
+++ b/scripts/api/ApiCodeGen.py
@@ -396,7 +396,7 @@
   if isinstance(exp,dict):
     tmp = []
     first = True
-    for i in sorted([i for i in exp if len(i)]):      
+    for i in sorted([i for i in exp if len(i)]):
       if first:
         tmp.append('#if %s'%(i))
       else:
@@ -408,7 +408,7 @@
         tmp.append('#else')
       tmp.append(exp[''])
     if not first:
-      tmp.append('#endif')      
+      tmp.append('#endif')
     return tmp
 
   tmp = ''
@@ -470,11 +470,15 @@
   return tmp
 
 def indent(code,ind = '  '):
-  c = code
+  t1 = code
   if not isinstance(code,list):
-    c = code.split('\n')
+    t1 = code.split('\n')
 
-  c = [ ('%s%s'%(ind,i)).rstrip() for i in c ]
+  t2 = []
+  for i in t1:
+    t2.extend(i.split('\n'))
+
+  c = [ ('%s%s'%(ind,i)).rstrip() for i in t2 ]
 
   if isinstance(code,list):
     return c
@@ -630,14 +634,15 @@
 #
 # CodeGen for:
 #
-#   [ 'a', 'b', 'c' ] ->
-#   'a\nb\nc\n'
+#   [ 'a', 'b', 'c' ] -> 'a\nb\nc\n'
+#   'abc'             -> 'abc'
 
 def listToString(code):
+  if isinstance(code,str) or isinstance(code,unicode):
+    return code
   if not len(code):
     return ''
-  else:
-    return '\n'.join(code) + '\n'
+  return '\n'.join(code) + '\n'
 
 #
 # CodeGen for simplifying expression in << sequence
diff --git a/scripts/api/gl.py b/scripts/api/gl.py
index 30ce0ea..72f2008 100644
--- a/scripts/api/gl.py
+++ b/scripts/api/gl.py
@@ -8957,6 +8957,102 @@
 
 defines.add(GL_BGR_NV)
 
+# GL_NV_blend_equation_advanced
+
+GL_BLEND_ADVANCED_COHERENT_NV = Enumerant('GL_BLEND_ADVANCED_COHERENT_NV', 0x9285, 'GL_NV_blend_equation_advanced')
+GL_BLEND_OVERLAP_NV = Enumerant('GL_BLEND_OVERLAP_NV', 0x9281, 'GL_NV_blend_equation_advanced')
+GL_BLEND_PREMULTIPLIED_SRC_NV = Enumerant('GL_BLEND_PREMULTIPLIED_SRC_NV', 0x9280, 'GL_NV_blend_equation_advanced')
+GL_COLORBURN_NV = Enumerant('GL_COLORBURN_NV', 0x929a, 'GL_NV_blend_equation_advanced')
+GL_COLORDODGE_NV = Enumerant('GL_COLORDODGE_NV', 0x9299, 'GL_NV_blend_equation_advanced')
+GL_CONJOINT_NV = Enumerant('GL_CONJOINT_NV', 0x9284, 'GL_NV_blend_equation_advanced')
+GL_CONTRAST_NV = Enumerant('GL_CONTRAST_NV', 0x92a1, 'GL_NV_blend_equation_advanced')
+GL_DARKEN_NV = Enumerant('GL_DARKEN_NV', 0x9297, 'GL_NV_blend_equation_advanced')
+GL_DIFFERENCE_NV = Enumerant('GL_DIFFERENCE_NV', 0x929e, 'GL_NV_blend_equation_advanced')
+GL_DISJOINT_NV = Enumerant('GL_DISJOINT_NV', 0x9283, 'GL_NV_blend_equation_advanced')
+GL_DST_ATOP_NV = Enumerant('GL_DST_ATOP_NV', 0x928f, 'GL_NV_blend_equation_advanced')
+GL_DST_IN_NV = Enumerant('GL_DST_IN_NV', 0x928b, 'GL_NV_blend_equation_advanced')
+GL_DST_NV = Enumerant('GL_DST_NV', 0x9287, 'GL_NV_blend_equation_advanced')
+GL_DST_OUT_NV = Enumerant('GL_DST_OUT_NV', 0x928d, 'GL_NV_blend_equation_advanced')
+GL_DST_OVER_NV = Enumerant('GL_DST_OVER_NV', 0x9289, 'GL_NV_blend_equation_advanced')
+GL_EXCLUSION_NV = Enumerant('GL_EXCLUSION_NV', 0x92a0, 'GL_NV_blend_equation_advanced')
+GL_HARDLIGHT_NV = Enumerant('GL_HARDLIGHT_NV', 0x929b, 'GL_NV_blend_equation_advanced')
+GL_HARDMIX_NV = Enumerant('GL_HARDMIX_NV', 0x92a9, 'GL_NV_blend_equation_advanced')
+GL_HSL_COLOR_NV = Enumerant('GL_HSL_COLOR_NV', 0x92af, 'GL_NV_blend_equation_advanced')
+GL_HSL_HUE_NV = Enumerant('GL_HSL_HUE_NV', 0x92ad, 'GL_NV_blend_equation_advanced')
+GL_HSL_LUMINOSITY_NV = Enumerant('GL_HSL_LUMINOSITY_NV', 0x92b0, 'GL_NV_blend_equation_advanced')
+GL_HSL_SATURATION_NV = Enumerant('GL_HSL_SATURATION_NV', 0x92ae, 'GL_NV_blend_equation_advanced')
+GL_INVERT_OVG_NV = Enumerant('GL_INVERT_OVG_NV', 0x92b4, 'GL_NV_blend_equation_advanced')
+GL_INVERT_RGB_NV = Enumerant('GL_INVERT_RGB_NV', 0x92a3, 'GL_NV_blend_equation_advanced')
+GL_LIGHTEN_NV = Enumerant('GL_LIGHTEN_NV', 0x9298, 'GL_NV_blend_equation_advanced')
+GL_LINEARBURN_NV = Enumerant('GL_LINEARBURN_NV', 0x92a5, 'GL_NV_blend_equation_advanced')
+GL_LINEARDODGE_NV = Enumerant('GL_LINEARDODGE_NV', 0x92a4, 'GL_NV_blend_equation_advanced')
+GL_LINEARLIGHT_NV = Enumerant('GL_LINEARLIGHT_NV', 0x92a7, 'GL_NV_blend_equation_advanced')
+GL_MINUS_CLAMPED_NV = Enumerant('GL_MINUS_CLAMPED_NV', 0x92b3, 'GL_NV_blend_equation_advanced')
+GL_MINUS_NV = Enumerant('GL_MINUS_NV', 0x929f, 'GL_NV_blend_equation_advanced')
+GL_MULTIPLY_NV = Enumerant('GL_MULTIPLY_NV', 0x9294, 'GL_NV_blend_equation_advanced')
+GL_OVERLAY_NV = Enumerant('GL_OVERLAY_NV', 0x9296, 'GL_NV_blend_equation_advanced')
+GL_PINLIGHT_NV = Enumerant('GL_PINLIGHT_NV', 0x92a8, 'GL_NV_blend_equation_advanced')
+GL_PLUS_CLAMPED_ALPHA_NV = Enumerant('GL_PLUS_CLAMPED_ALPHA_NV', 0x92b2, 'GL_NV_blend_equation_advanced')
+GL_PLUS_CLAMPED_NV = Enumerant('GL_PLUS_CLAMPED_NV', 0x92b1, 'GL_NV_blend_equation_advanced')
+GL_PLUS_DARKER_NV = Enumerant('GL_PLUS_DARKER_NV', 0x9292, 'GL_NV_blend_equation_advanced')
+GL_PLUS_NV = Enumerant('GL_PLUS_NV', 0x9291, 'GL_NV_blend_equation_advanced')
+GL_SCREEN_NV = Enumerant('GL_SCREEN_NV', 0x9295, 'GL_NV_blend_equation_advanced')
+GL_SOFTLIGHT_NV = Enumerant('GL_SOFTLIGHT_NV', 0x929c, 'GL_NV_blend_equation_advanced')
+GL_SRC_ATOP_NV = Enumerant('GL_SRC_ATOP_NV', 0x928e, 'GL_NV_blend_equation_advanced')
+GL_SRC_IN_NV = Enumerant('GL_SRC_IN_NV', 0x928a, 'GL_NV_blend_equation_advanced')
+GL_SRC_NV = Enumerant('GL_SRC_NV', 0x9286, 'GL_NV_blend_equation_advanced')
+GL_SRC_OUT_NV = Enumerant('GL_SRC_OUT_NV', 0x928c, 'GL_NV_blend_equation_advanced')
+GL_SRC_OVER_NV = Enumerant('GL_SRC_OVER_NV', 0x9288, 'GL_NV_blend_equation_advanced')
+GL_UNCORRELATED_NV = Enumerant('GL_UNCORRELATED_NV', 0x9282, 'GL_NV_blend_equation_advanced')
+GL_VIVIDLIGHT_NV = Enumerant('GL_VIVIDLIGHT_NV', 0x92a6, 'GL_NV_blend_equation_advanced')
+
+defines.add(GL_BLEND_ADVANCED_COHERENT_NV)
+defines.add(GL_BLEND_OVERLAP_NV)
+defines.add(GL_BLEND_PREMULTIPLIED_SRC_NV)
+defines.add(GL_COLORBURN_NV)
+defines.add(GL_COLORDODGE_NV)
+defines.add(GL_CONJOINT_NV)
+defines.add(GL_CONTRAST_NV)
+defines.add(GL_DARKEN_NV)
+defines.add(GL_DIFFERENCE_NV)
+defines.add(GL_DISJOINT_NV)
+defines.add(GL_DST_ATOP_NV)
+defines.add(GL_DST_IN_NV)
+defines.add(GL_DST_NV)
+defines.add(GL_DST_OUT_NV)
+defines.add(GL_DST_OVER_NV)
+defines.add(GL_EXCLUSION_NV)
+defines.add(GL_HARDLIGHT_NV)
+defines.add(GL_HARDMIX_NV)
+defines.add(GL_HSL_COLOR_NV)
+defines.add(GL_HSL_HUE_NV)
+defines.add(GL_HSL_LUMINOSITY_NV)
+defines.add(GL_HSL_SATURATION_NV)
+defines.add(GL_INVERT_OVG_NV)
+defines.add(GL_INVERT_RGB_NV)
+defines.add(GL_LIGHTEN_NV)
+defines.add(GL_LINEARBURN_NV)
+defines.add(GL_LINEARDODGE_NV)
+defines.add(GL_LINEARLIGHT_NV)
+defines.add(GL_MINUS_CLAMPED_NV)
+defines.add(GL_MINUS_NV)
+defines.add(GL_MULTIPLY_NV)
+defines.add(GL_OVERLAY_NV)
+defines.add(GL_PINLIGHT_NV)
+defines.add(GL_PLUS_CLAMPED_ALPHA_NV)
+defines.add(GL_PLUS_CLAMPED_NV)
+defines.add(GL_PLUS_DARKER_NV)
+defines.add(GL_PLUS_NV)
+defines.add(GL_SCREEN_NV)
+defines.add(GL_SOFTLIGHT_NV)
+defines.add(GL_SRC_ATOP_NV)
+defines.add(GL_SRC_IN_NV)
+defines.add(GL_SRC_NV)
+defines.add(GL_SRC_OUT_NV)
+defines.add(GL_SRC_OVER_NV)
+defines.add(GL_UNCORRELATED_NV)
+defines.add(GL_VIVIDLIGHT_NV)
+
 # GL_NV_compute_program5
 
 GL_COMPUTE_PROGRAM_NV = Enumerant('GL_COMPUTE_PROGRAM_NV', 0x90fb, 'GL_NV_compute_program5')
@@ -35405,6 +35501,26 @@
 glUniformHandleui64vNV.play = True
 gl.add(glUniformHandleui64vNV)
 
+# GL_NV_blend_equation_advanced
+
+glBlendBarrierNV = Function('glBlendBarrierNV')
+glBlendBarrierNV.ret = Return('void')
+glBlendBarrierNV.version = ''
+glBlendBarrierNV.category = 'GL_NV_blend_equation_advanced'
+glBlendBarrierNV.trace = True
+glBlendBarrierNV.play = True
+gl.add(glBlendBarrierNV)
+
+glBlendParameteriNV = Function('glBlendParameteriNV')
+glBlendParameteriNV.ret = Return('void')
+glBlendParameteriNV.add( Input( 'pname','GLenum' ))
+glBlendParameteriNV.add( Input( 'value','GLint' ))
+glBlendParameteriNV.version = ''
+glBlendParameteriNV.category = 'GL_NV_blend_equation_advanced'
+glBlendParameteriNV.trace = True
+glBlendParameteriNV.play = True
+gl.add(glBlendParameteriNV)
+
 # GL_NV_conditional_render
 
 glBeginConditionalRenderNV = Function('glBeginConditionalRenderNV')
@@ -44578,6 +44694,16 @@
 GL_NV_bindless_texture.functions = ['glIsImageHandleResidentNV','glIsTextureHandleResidentNV','glGetImageHandleNV','glGetTextureHandleNV','glGetTextureSamplerHandleNV','glMakeImageHandleNonResidentNV','glMakeImageHandleResidentNV','glMakeTextureHandleNonResidentNV','glMakeTextureHandleResidentNV','glProgramUniformHandleui64NV','glProgramUniformHandleui64vNV','glUniformHandleui64NV','glUniformHandleui64vNV']
 gl.add(GL_NV_bindless_texture)
 
+GL_NV_blend_equation_advanced = Extension('GL_NV_blend_equation_advanced')
+GL_NV_blend_equation_advanced.url = 'http://www.opengl.org/registry/specs/gl/NV/blend_equation_advanced.txt'
+GL_NV_blend_equation_advanced.enumerants = ['GL_BLEND_ADVANCED_COHERENT_NV','GL_BLEND_OVERLAP_NV','GL_BLEND_PREMULTIPLIED_SRC_NV','GL_COLORBURN_NV','GL_COLORDODGE_NV','GL_CONJOINT_NV','GL_CONTRAST_NV','GL_DARKEN_NV','GL_DIFFERENCE_NV','GL_DISJOINT_NV','GL_DST_ATOP_NV','GL_DST_IN_NV','GL_DST_NV','GL_DST_OUT_NV','GL_DST_OVER_NV','GL_EXCLUSION_NV','GL_HARDLIGHT_NV','GL_HARDMIX_NV','GL_HSL_COLOR_NV','GL_HSL_HUE_NV','GL_HSL_LUMINOSITY_NV','GL_HSL_SATURATION_NV','GL_INVERT_OVG_NV','GL_INVERT_RGB_NV','GL_LIGHTEN_NV','GL_LINEARBURN_NV','GL_LINEARDODGE_NV','GL_LINEARLIGHT_NV','GL_MINUS_CLAMPED_NV','GL_MINUS_NV','GL_MULTIPLY_NV','GL_OVERLAY_NV','GL_PINLIGHT_NV','GL_PLUS_CLAMPED_ALPHA_NV','GL_PLUS_CLAMPED_NV','GL_PLUS_DARKER_NV','GL_PLUS_NV','GL_SCREEN_NV','GL_SOFTLIGHT_NV','GL_SRC_ATOP_NV','GL_SRC_IN_NV','GL_SRC_NV','GL_SRC_OUT_NV','GL_SRC_OVER_NV','GL_UNCORRELATED_NV','GL_VIVIDLIGHT_NV']
+GL_NV_blend_equation_advanced.functions = ['glBlendBarrierNV','glBlendParameteriNV']
+gl.add(GL_NV_blend_equation_advanced)
+
+GL_NV_blend_equation_advanced_coherent = Extension('GL_NV_blend_equation_advanced_coherent')
+GL_NV_blend_equation_advanced_coherent.url = 'http://www.opengl.org/registry/specs/gl/NV/blend_equation_advanced.txt'
+gl.add(GL_NV_blend_equation_advanced_coherent)
+
 GL_NV_blend_square = Extension('GL_NV_blend_square')
 GL_NV_blend_square.url = 'http://www.opengl.org/registry/specs/NV/blend_square.txt'
 GL_NV_blend_square.category = 'GL_NV_blend_square'
diff --git a/scripts/api/glx.py b/scripts/api/glx.py
index 6ffaf38..18af78b 100644
--- a/scripts/api/glx.py
+++ b/scripts/api/glx.py
@@ -8,57 +8,34 @@
 
 glx = Api()
 
-GLXVideoCaptureDeviceNV = Typedef('GLXVideoCaptureDeviceNV','XID')
-GLXVideoCaptureDeviceNV.category = 'GLX_NV_video_capture'
-GLXVideoCaptureDeviceNV.default = '0'
-
 XID = Typedef('XID','unsigned long')
 XID.default = '0'
 
-Pixmap = Typedef('Pixmap','XID')
-Pixmap.default = '0'
-
-Font = Typedef('Font','XID')
-Font.default = '0'
-
 Display = Typedef('Display','struct _XDisplay')
 Display.default = '0'
 
-GLXDrawble = Typedef('GLXDrawble','XID')
-GLXDrawble.category = 'GLX_VERSION_1_0'
-GLXDrawble.default = '0'
-
-GLXPixmap = Typedef('GLXPixmap','XID')
-GLXPixmap.category = 'GLX_VERSION_1_0'
-GLXPixmap.default = '0'
+Font = Typedef('Font','XID')
+Font.default = '0'
 
 GLXContext = Typedef('GLXContext','struct __GLXcontextRec *')
 GLXContext.category = 'GLX_VERSION_1_0'
 GLXContext.default = '0'
 
-GLXVideoDeviceNV = Typedef('GLXVideoDeviceNV','unsigned int')
-GLXVideoDeviceNV.category = 'GLX_VERSION_1_0'
-GLXVideoDeviceNV.default = '0'
+GLXContextID = Typedef('GLXContextID','XID')
+GLXContextID.category = 'GLX_EXT_import_context'
+GLXContextID.default = '0'
 
-GLXWindow = Typedef('GLXWindow','XID')
-GLXWindow.category = 'GLX_VERSION_1_3'
-GLXWindow.default = '0'
-
-GLXPbuffer = Typedef('GLXPbuffer','XID')
-GLXPbuffer.category = 'GLX_VERSION_1_3'
-GLXPbuffer.default = '0'
-
-GLXFBConfigID = Typedef('GLXFBConfigID','XID')
-GLXFBConfigID.category = 'GLX_VERSION_1_3'
-GLXFBConfigID.default = '0'
+GLXDrawable = Typedef('GLXDrawable','XID')
+GLXDrawable.category = 'GLX_VERSION_1_0'
+GLXDrawable.default = '0'
 
 GLXFBConfig = Typedef('GLXFBConfig','struct __GLXFBConfigRec *')
 GLXFBConfig.category = 'GLX_VERSION_1_3'
 GLXFBConfig.default = '0'
 
-GLXContextID = Typedef('GLXContextID','XID')
-GLXContextID.category = 'GLX_EXT_import_context'
-GLXContextID.default = '0'
+GLXFBConfigID = Typedef('GLXFBConfigID','XID')
+GLXFBConfigID.category = 'GLX_VERSION_1_3'
+GLXFBConfigID.default = '0'
 
 GLXFBConfigIDSGIX = Typedef('GLXFBConfigIDSGIX','XID')
 GLXFBConfigIDSGIX.category = 'GLX_SGIX_fbconfig'
@@ -68,26 +45,49 @@
 GLXFBConfigSGIX.category = 'GLX_SGIX_fbconfig'
 GLXFBConfigSGIX.default = '0'
 
+GLXPbuffer = Typedef('GLXPbuffer','XID')
+GLXPbuffer.category = 'GLX_VERSION_1_3'
+GLXPbuffer.default = '0'
+
 GLXPbufferSGIX = Typedef('GLXPbufferSGIX','XID')
 GLXPbufferSGIX.default = '0'
 
-glx.add(GLXVideoCaptureDeviceNV)
+GLXPixmap = Typedef('GLXPixmap','XID')
+GLXPixmap.category = 'GLX_VERSION_1_0'
+GLXPixmap.default = '0'
+
+GLXVideoCaptureDeviceNV = Typedef('GLXVideoCaptureDeviceNV','XID')
+GLXVideoCaptureDeviceNV.category = 'GLX_NV_video_capture'
+GLXVideoCaptureDeviceNV.default = '0'
+
+GLXVideoDeviceNV = Typedef('GLXVideoDeviceNV','unsigned int')
+GLXVideoDeviceNV.category = 'GLX_VERSION_1_0'
+GLXVideoDeviceNV.default = '0'
+
+GLXWindow = Typedef('GLXWindow','XID')
+GLXWindow.category = 'GLX_VERSION_1_3'
+GLXWindow.default = '0'
+
+Pixmap = Typedef('Pixmap','XID')
+Pixmap.default = '0'
+
 glx.add(XID)
-glx.add(Pixmap)
-glx.add(Font)
 glx.add(Display)
-glx.add(GLXDrawble)
-glx.add(GLXPixmap)
+glx.add(Font)
 glx.add(GLXContext)
-glx.add(GLXVideoDeviceNV)
-glx.add(GLXWindow)
-glx.add(GLXPbuffer)
-glx.add(GLXFBConfigID)
-glx.add(GLXFBConfig)
 glx.add(GLXContextID)
+glx.add(GLXDrawable)
+glx.add(GLXFBConfig)
+glx.add(GLXFBConfigID)
 glx.add(GLXFBConfigIDSGIX)
 glx.add(GLXFBConfigSGIX)
+glx.add(GLXPbuffer)
 glx.add(GLXPbufferSGIX)
+glx.add(GLXPixmap)
+glx.add(GLXVideoCaptureDeviceNV)
+glx.add(GLXVideoDeviceNV)
+glx.add(GLXWindow)
+glx.add(Pixmap)
 
 
 defines = Enum('defines')
diff --git a/scripts/regal/Regal.py b/scripts/regal/Regal.py
index deabc54..5fe064d 100755
--- a/scripts/regal/Regal.py
+++ b/scripts/regal/Regal.py
@@ -79,22 +79,14 @@
 #define __gl_ATI_h_
 #define _OPENGL_H
 
-#if REGAL_SYS_GLX
+#if (REGAL_SYS_GLX || REGAL_SYS_EGL) && REGAL_SYS_X11
+#include <X11/Xlib.h>
 #include <X11/Xdefs.h>
 #include <X11/Xutil.h>
-typedef XID GLXDrawable;
-#endif
-
-#if REGAL_SYS_EGL && REGAL_SYS_X11
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
 #endif
 
 #include <stddef.h>
+
 #if defined(_WIN32)
   typedef __int64 int64_t;
   typedef unsigned __int64 uint64_t;
@@ -110,6 +102,138 @@
 
 ${API_TYPEDEF}
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* For GLX emulation on non-X11 systems: REGAL_SYS_GLX=1, REGAL_SYS_X11=0 */
+
+#if REGAL_SYS_GLX && !REGAL_SYS_X11
+
+/* X.h */
+
+#define None                 0L
+#define ParentRelative       1L
+#define CopyFromParent       0L
+#define PointerWindow        0L
+#define InputFocus           1L
+#define PointerRoot          1L
+#define AnyPropertyType      0L
+#define AnyKey               0L
+#define AnyButton            0L
+#define AllTemporary         0L
+#define CurrentTime          0L
+#define NoSymbol             0L
+
+#define AllocNone            0 
+#define AllocAll             1
+
+#define InputOutput          1
+#define InputOnly            2
+
+#define CWBackPixmap            (1L<<0)
+#define CWBackPixel             (1L<<1)
+#define CWBorderPixmap          (1L<<2)
+#define CWBorderPixel           (1L<<3)
+#define CWBitGravity            (1L<<4)
+#define CWWinGravity            (1L<<5)
+#define CWBackingStore          (1L<<6)
+#define CWBackingPlanes         (1L<<7)
+#define CWBackingPixel          (1L<<8)
+#define CWOverrideRedirect      (1L<<9)
+#define CWSaveUnder             (1L<<10)
+#define CWEventMask             (1L<<11)
+#define CWDontPropagate         (1L<<12)
+#define CWColormap              (1L<<13)
+#define CWCursor                (1L<<14)
+
+#define NoEventMask                     0L
+#define KeyPressMask                    (1L<<0)  
+#define KeyReleaseMask                  (1L<<1)  
+#define ButtonPressMask                 (1L<<2)  
+#define ButtonReleaseMask               (1L<<3)  
+#define EnterWindowMask                 (1L<<4)  
+#define LeaveWindowMask                 (1L<<5)  
+#define PointerMotionMask               (1L<<6)  
+#define PointerMotionHintMask           (1L<<7)  
+#define Button1MotionMask               (1L<<8)  
+#define Button2MotionMask               (1L<<9)  
+#define Button3MotionMask               (1L<<10) 
+#define Button4MotionMask               (1L<<11) 
+#define Button5MotionMask               (1L<<12) 
+#define ButtonMotionMask                (1L<<13) 
+#define KeymapStateMask                 (1L<<14)
+#define ExposureMask                    (1L<<15) 
+#define VisibilityChangeMask            (1L<<16) 
+#define StructureNotifyMask             (1L<<17) 
+#define ResizeRedirectMask              (1L<<18) 
+#define SubstructureNotifyMask          (1L<<19) 
+#define SubstructureRedirectMask        (1L<<20) 
+#define FocusChangeMask                 (1L<<21) 
+#define PropertyChangeMask              (1L<<22) 
+#define ColormapChangeMask              (1L<<23) 
+#define OwnerGrabButtonMask             (1L<<24)
+
+typedef XID              Window;
+typedef XID              Atom;
+typedef XID              Status;
+typedef XID              Drawable;
+typedef int              Bool;
+typedef XID              Colormap;
+typedef XID              Cursor;
+typedef void *           Screen;
+typedef unsigned long    VisualID;
+
+/* Xlib.h */
+
+typedef struct {
+  VisualID visualid;
+} Visual;
+
+typedef struct {
+    Pixmap background_pixmap;
+    unsigned long background_pixel;
+    Pixmap border_pixmap;
+    unsigned long border_pixel;
+    int bit_gravity; 
+    int win_gravity; 
+    int backing_store; 
+    unsigned long backing_planes;
+    unsigned long backing_pixel;
+    Bool save_under;
+    long event_mask; 
+    long do_not_propagate_mask;
+    Bool override_redirect;
+    Colormap colormap; 
+    Cursor cursor;
+} XSetWindowAttributes;
+
+/* Xutil.h */
+
+typedef struct
+{
+   Visual       *visual;
+   int           screen;
+   int           depth;
+   unsigned long red_mask;
+   unsigned long green_mask;
+   unsigned long blue_mask;
+   int           colormap_size;
+   int           bits_per_rgb;
+} XVisualInfo;
+
+REGAL_DECL Display *XOpenDisplay(char *display_name);
+REGAL_DECL int      XCloseDisplay(Display *display);
+REGAL_DECL int      DefaultScreen(Display *display);
+REGAL_DECL Window   RootWindow(Display *display, int screen_number);
+REGAL_DECL int      XMapWindow(Display *display, Window w);
+REGAL_DECL Window   XCreateWindow(Display *display, Window parent, int x, int y, unsigned int width, unsigned int height, unsigned int border_width, int depth, unsigned int clss, Visual *visual, unsigned long valuemask, XSetWindowAttributes *attributes);
+REGAL_DECL Colormap XCreateColormap(Display *display, Window w, Visual *visual, int alloc);
+REGAL_DECL Pixmap   XCreatePixmap(Display *display, Drawable d, unsigned int width, unsigned int height, unsigned int depth);
+REGAL_DECL int      XFreePixmap(Display *display, Pixmap pixmap);
+
+#endif
+
 /* TODO: make this automatic? */
 
 typedef void (REGAL_CALL *GLDEBUGPROCAMD)(GLuint id, GLenum category, GLenum severity, GLsizei length, const GLchar *message, GLvoid *userParam);
diff --git a/scripts/regal/RegalDispatchGLX.py b/scripts/regal/RegalDispatchGLX.py
new file mode 100755
index 0000000..3405f4a
--- /dev/null
+++ b/scripts/regal/RegalDispatchGLX.py
@@ -0,0 +1,143 @@
+#!/usr/bin/python -B
+
+from string import Template, upper, replace
+
+from ApiCodeGen   import *
+from ApiUtil      import outputCode
+from ApiUtil      import typeIsVoid
+from ApiRegal     import logFunction
+
+from RegalContextInfo import cond
+
+from RegalDispatchShared import apiDispatchFuncInitCode
+from RegalDispatchShared import apiDispatchGlobalFuncInitCode
+
+from Emu       import *
+from EmuGLX    import formulaeGlobal as formulae
+
+# CodeGen for dispatch table init.
+
+dispatchGLXTemplate = Template('''${AUTOGENERATED}
+${LICENSE}
+
+#include "pch.h" /* For MS precompiled header support */
+
+#include "RegalUtil.h"
+
+#if REGAL_SYS_GLX && !REGAL_SYS_X11
+
+REGAL_GLOBAL_BEGIN
+
+#include "RegalLog.h"
+#include "RegalPush.h"
+#include "RegalToken.h"
+#include "RegalHelper.h"
+#include "RegalContext.h"
+#include "RegalDispatch.h"
+#include "RegalDispatcherGL.h"
+#include "RegalDispatcherGlobal.h"
+
+using namespace ::REGAL_NAMESPACE_INTERNAL::Logging;
+using namespace ::REGAL_NAMESPACE_INTERNAL::Token;
+
+REGAL_GLOBAL_END
+
+REGAL_NAMESPACE_BEGIN
+
+${API_FUNC_DEFINE}
+
+void InitDispatchTableGLX(DispatchTableGL &tbl)
+{
+${API_GL_DISPATCH_INIT}
+}
+
+${API_GLOBAL_DISPATCH_INIT}
+
+REGAL_NAMESPACE_END
+
+#endif
+''')
+
+def filterGLX(func):
+  return func.name.startswith('glX')
+
+def generateDispatchGLX(apis, args):
+
+  # CodeGen for API functions.
+
+  code = ''
+  categoryPrev = None
+
+  for api in apis:
+
+    if api.name != 'glx':
+      continue
+
+    code += '\n'
+
+    for function in api.functions:
+
+      if getattr(function,'regalOnly',False)==True:
+        continue
+
+      name   = function.name
+      params = paramsDefaultCode(function.parameters, True)
+      callParams = paramsNameCode(function.parameters)
+      rType  = typeCode(function.ret.type)
+      category  = getattr(function, 'category', None)
+      version   = getattr(function, 'version', None)
+
+      if category:
+        category = category.replace('_DEPRECATED', '')
+      elif version:
+        category = version.replace('.', '_')
+        category = 'GL_VERSION_' + category
+
+      # Close prev category block.
+      if categoryPrev and not (category == categoryPrev):
+        code += '\n'
+
+      # Begin new category block.
+      if category and not (category == categoryPrev):
+        code += '// %s\n\n' % category
+
+      categoryPrev = category
+
+      code += 'static %sREGAL_CALL %s%s(%s) \n{\n' % (rType, 'GLX_', name, params)
+
+      if not function.needsContext:
+        code += '    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();\n'
+
+      code += '    RegalAssert(_next);\n'
+
+      match = emuFindEntry(function,formulae,None)
+      if match and 'impl' in match:
+#       print match
+        code += listToString(indent(match['impl'],'    '))
+
+      code += '    '
+      if not typeIsVoid(rType):
+        code += '%s ret = '%(rType)
+      code += '_next->call(&_next->%s)(%s);\n' % ( name, callParams )
+
+      if not typeIsVoid(rType):
+        code += '    return ret;\n'
+      code += '}\n\n'
+
+    code += '\n'
+
+  # Close pending if block.
+  if categoryPrev:
+    code += '\n'
+
+  # Output
+
+  substitute = {}
+  substitute['LICENSE']         = args.license
+  substitute['AUTOGENERATED']   = args.generated
+  substitute['COPYRIGHT']       = args.copyright
+  substitute['API_FUNC_DEFINE'] = code
+  substitute['API_GL_DISPATCH_INIT']     = apiDispatchFuncInitCode( apis, args, 'GLX', [], filterGLX )
+  substitute['API_GLOBAL_DISPATCH_INIT'] = apiDispatchGlobalFuncInitCode( apis, args, 'GLX', [], filterGLX )
+
+  outputCode( '%s/RegalDispatchGLX.cpp' % args.srcdir, dispatchGLXTemplate.substitute(substitute))
diff --git a/scripts/regal/RegalDispatchLoader.py b/scripts/regal/RegalDispatchLoader.py
index a652d74..ea6fb49 100755
--- a/scripts/regal/RegalDispatchLoader.py
+++ b/scripts/regal/RegalDispatchLoader.py
@@ -125,7 +125,7 @@
   substitute['API_DISPATCH_FUNC_DEFINE'] = funcDefine
   substitute['API_DISPATCH_FUNC_INIT'] = funcInit
   substitute['API_DISPATCH_GLOBAL_FUNC_INIT'] = globalFuncInit
-  substitute['IFDEF'] = '#if REGAL_DRIVER\n\n'
+  substitute['IFDEF'] = '#if REGAL_DRIVER && REGAL_LOADER\n\n'
   substitute['ENDIF'] = '#endif\n'
 
   outputCode( '%s/RegalDispatchLoader.cpp' % args.srcdir, dispatchSourceTemplate.substitute(substitute))
diff --git a/scripts/regal/RegalDispatchMissing.py b/scripts/regal/RegalDispatchMissing.py
index 424d1a8..06f1804 100755
--- a/scripts/regal/RegalDispatchMissing.py
+++ b/scripts/regal/RegalDispatchMissing.py
@@ -95,8 +95,8 @@
   substitute['API_DISPATCH_FUNC_DEFINE'] = apiMissingFuncDefineCode( apis, args )
   substitute['API_DISPATCH_FUNC_INIT']   = apiDispatchFuncInitCode( apis, args, 'missing' )
   substitute['API_DISPATCH_GLOBAL_FUNC_INIT']   = apiDispatchGlobalFuncInitCode( apis, args, 'missing' )
-  substitute['IFDEF'] = ''
-  substitute['ENDIF'] = ''
+  substitute['IFDEF'] = '#if REGAL_MISSING\n\n'
+  substitute['ENDIF'] = '#endif\n'
 
   outputCode( '%s/RegalDispatchMissing.cpp' % args.srcdir, dispatchSourceTemplate.substitute(substitute))
 
diff --git a/scripts/regal/RegalDispatchShared.py b/scripts/regal/RegalDispatchShared.py
index 59cbb62..61f24c6 100644
--- a/scripts/regal/RegalDispatchShared.py
+++ b/scripts/regal/RegalDispatchShared.py
@@ -5,7 +5,7 @@
 from ApiCodeGen import paramsDefaultCode
 from ApiCodeGen import paramsNameCode, typeCode
 
-from RegalContextInfo import cond
+from RegalContextInfo import cond as condDefault
 
 ############################################################################
 
@@ -52,7 +52,11 @@
 
 ${ENDIF}''')
 
-def apiDispatchFuncInitCode(apis, args, dispatchName, exclude=[], filter = lambda x : True):
+def apiDispatchFuncInitCode(apis, args, dispatchName, exclude=[], filter = lambda x : True, cond = None):
+
+  if not cond:
+    cond = condDefault
+
   categoryPrev = None
   code = ''
 
@@ -111,7 +115,11 @@
 
   return code
 
-def apiDispatchGlobalFuncInitCode(apis, args, dispatchName, exclude=[], filter = lambda x : True):
+def apiDispatchGlobalFuncInitCode(apis, args, dispatchName, exclude=[], filter = lambda x : True, cond = None):
+
+  if not cond:
+    cond = condDefault
+
   categoryPrev = None
   code = '''
 void InitDispatchTableGlobal%s%s(DispatchTableGlobal &tbl)
diff --git a/scripts/regal/RegalDispatchTrace.py b/scripts/regal/RegalDispatchTrace.py
index 493b438..2bdd491 100755
--- a/scripts/regal/RegalDispatchTrace.py
+++ b/scripts/regal/RegalDispatchTrace.py
@@ -1,6 +1,7 @@
 #!/usr/bin/python -B
 
 from string import Template, upper, replace
+from copy   import deepcopy
 
 from ApiUtil import outputCode
 from ApiUtil import typeIsVoid
@@ -15,7 +16,10 @@
 
 ##############################################################################################
 
-# CodeGen for API error checking function definition.
+traceCond = deepcopy(cond)
+traceCond['glx'] = 'REGAL_SYS_GLX && REGAL_SYS_X11'
+
+# CodeGen for apitrace integration
 
 def apiTraceFuncDefineCode(apis, args):
   categoryPrev = None
@@ -27,8 +31,8 @@
   for api in apis:
 
     code += '\n'
-    if api.name in cond:
-      code += '#if %s\n' % cond[api.name]
+    if api.name in traceCond:
+      code += '#if %s\n' % traceCond[api.name]
 
     for function in api.functions:
       if getattr(function,'regalOnly',False)==True:
@@ -61,8 +65,8 @@
 
       code += '  %s %s(%s);\n' % (rType, name, params)
 
-    if api.name in cond:
-      code += '#endif // %s\n' % cond[api.name]
+    if api.name in traceCond:
+      code += '#endif // %s\n' % traceCond[api.name]
     code += '\n'
 
   # Close pending if block.
@@ -74,8 +78,8 @@
   for api in apis:
 
     code += '\n'
-    if api.name in cond:
-      code += '#if %s\n' % cond[api.name]
+    if api.name in traceCond:
+      code += '#if %s\n' % traceCond[api.name]
 
     for function in api.functions:
       if getattr(function,'regalOnly',False)==True:
@@ -125,8 +129,8 @@
         code += '  return ret;\n'
       code += '}\n\n'
 
-    if api.name in cond:
-      code += '#endif // %s\n' % cond[api.name]
+    if api.name in traceCond:
+      code += '#endif // %s\n' % traceCond[api.name]
     code += '\n'
 
   # Close pending if block.
@@ -138,8 +142,8 @@
 def generateTraceSource(apis, args):
 
   funcDefine     = apiTraceFuncDefineCode( apis, args )
-  funcInit       = apiDispatchFuncInitCode( apis, args, 'trace', exclude )
-  globalFuncInit = apiDispatchGlobalFuncInitCode( apis, args, 'trace', exclude )
+  funcInit       = apiDispatchFuncInitCode( apis, args, 'trace', exclude, lambda x : True, traceCond )
+  globalFuncInit = apiDispatchGlobalFuncInitCode( apis, args, 'trace', exclude, lambda x : True, traceCond )
 
   substitute = {}
   substitute['LICENSE']         = args.license
diff --git a/scripts/regal/RegalDispatchTraceExclude.py b/scripts/regal/RegalDispatchTraceExclude.py
index ca03faa..5ec8578 100644
--- a/scripts/regal/RegalDispatchTraceExclude.py
+++ b/scripts/regal/RegalDispatchTraceExclude.py
@@ -114,4 +114,7 @@
   'GL_ARB_indirect_parameters',
   'GL_ARB_sparse_texture',  
   'GL_INTEL_map_texture',
+
+  'GL_NV_blend_equation_advanced',
+  'GL_NV_blend_equation_advanced_coherent',
 ]
diff --git a/scripts/regal/RegalSystem.py b/scripts/regal/RegalSystem.py
index 2bc7a4b..096b375 100755
--- a/scripts/regal/RegalSystem.py
+++ b/scripts/regal/RegalSystem.py
@@ -27,6 +27,9 @@
 #  ifndef REGAL_SYS_OSX
 #   define REGAL_SYS_OSX 1
 #  endif
+#  ifndef REGAL_SYS_GLX
+#   define REGAL_SYS_GLX 1
+#  endif
 # endif
 #elif defined(__native_client__)
 # ifndef REGAL_SYS_PPAPI
@@ -39,6 +42,9 @@
 # ifndef REGAL_SYS_EGL
 #  define REGAL_SYS_EGL 1
 # endif
+# ifndef REGAL_SYS_GLX
+#  define REGAL_SYS_GLX 1
+# endif
 #elif defined(EMSCRIPTEN)
 # ifndef REGAL_SYS_EMSCRIPTEN
 #  define REGAL_SYS_EMSCRIPTEN 1
@@ -50,13 +56,12 @@
 #  define REGAL_SYS_ES2 1
 # endif
 # ifndef REGAL_SYS_EMSCRIPTEN_STATIC
-#  define REGAL_SYS_EMSCRIPTEN_STATIC 0
+#  define REGAL_SYS_EMSCRIPTEN_STATIC 1
 # endif
 # if REGAL_SYS_EMSCRIPTEN_STATIC
-#  define REGAL_DRIVER 1
-#  define REGAL_NAMESPACE 1
-#  define REGAL_STATIC_ES2 1
-#  define REGAL_STATIC_EGL 1
+#  ifndef REGAL_NAMESPACE
+#   define REGAL_NAMESPACE 1
+#  endif
 # endif
 #elif !defined(REGAL_SYS_PPAPI) || !REGAL_SYS_PPAPI
 # ifndef REGAL_SYS_X11
@@ -107,6 +112,10 @@
 #define REGAL_SYS_EMSCRIPTEN 0
 #endif
 
+#ifndef REGAL_SYS_EMSCRIPTEN_STATIC
+#define REGAL_SYS_EMSCRIPTEN_STATIC 0
+#endif
+
 #ifndef REGAL_SYS_ES1
 #define REGAL_SYS_ES1 0
 #endif
diff --git a/src/apitrace/specs/glparams.py b/src/apitrace/specs/glparams.py
index 8acc7c9..2a6c38d 100644
--- a/src/apitrace/specs/glparams.py
+++ b/src/apitrace/specs/glparams.py
@@ -343,7 +343,7 @@
     ("glGetTexLevelParameter",	I,	1,	"GL_TEXTURE_WIDTH"),	# 0x1000
     ("glGetTexLevelParameter",	I,	1,	"GL_TEXTURE_HEIGHT"),	# 0x1001
     ("glGetTexLevelParameter",	E,	1,	"GL_TEXTURE_INTERNAL_FORMAT"),	# 0x1003
-    ("glGetTexParameter",	F,	4,	"GL_TEXTURE_BORDER_COLOR"),	# 0x1004
+    ("glGetTexParameter,glGetSamplerParameter",	F,	4,	"GL_TEXTURE_BORDER_COLOR"),	# 0x1004
     ("glGetTexLevelParameter",	I,	1,	"GL_TEXTURE_BORDER"),	# 0x1005
     ("",	X,	1,	"GL_DONT_CARE"),	# 0x1100
     ("",	X,	1,	"GL_FASTEST"),	# 0x1101
@@ -475,10 +475,10 @@
     ("",	X,	1,	"GL_LINEAR_MIPMAP_NEAREST"),	# 0x2701
     ("",	X,	1,	"GL_NEAREST_MIPMAP_LINEAR"),	# 0x2702
     ("",	X,	1,	"GL_LINEAR_MIPMAP_LINEAR"),	# 0x2703
-    ("glGetTexParameter",	E,	1,	"GL_TEXTURE_MAG_FILTER"),	# 0x2800
-    ("glGetTexParameter",	E,	1,	"GL_TEXTURE_MIN_FILTER"),	# 0x2801
-    ("glGetTexParameter",	E,	1,	"GL_TEXTURE_WRAP_S"),	# 0x2802
-    ("glGetTexParameter",	E,	1,	"GL_TEXTURE_WRAP_T"),	# 0x2803
+    ("glGetTexParameter,glGetSamplerParameter",	E,	1,	"GL_TEXTURE_MAG_FILTER"),	# 0x2800
+    ("glGetTexParameter,glGetSamplerParameter",	E,	1,	"GL_TEXTURE_MIN_FILTER"),	# 0x2801
+    ("glGetTexParameter,glGetSamplerParameter",	E,	1,	"GL_TEXTURE_WRAP_S"),	# 0x2802
+    ("glGetTexParameter,glGetSamplerParameter",	E,	1,	"GL_TEXTURE_WRAP_T"),	# 0x2803
     ("",	X,	1,	"GL_CLAMP"),	# 0x2900
     ("",	X,	1,	"GL_REPEAT"),	# 0x2901
     ("glGet",	F,	1,	"GL_POLYGON_OFFSET_UNITS"),	# 0x2A00
@@ -629,7 +629,7 @@
     ("glGet",	B,	1,	"GL_TEXTURE_3D"),	# 0x806F
     ("",	X,	1,	"GL_PROXY_TEXTURE_3D"),	# 0x8070
     ("glGetTexLevelParameter",	I,	1,	"GL_TEXTURE_DEPTH"),	# 0x8071
-    ("glGetTexParameter",	E,	1,	"GL_TEXTURE_WRAP_R"),	# 0x8072
+    ("glGetTexParameter,glGetSamplerParameter",	E,	1,	"GL_TEXTURE_WRAP_R"),	# 0x8072
     ("glGet",	I,	1,	"GL_MAX_3D_TEXTURE_SIZE"),	# 0x8073
     ("glGet",	B,	1,	"GL_VERTEX_ARRAY"),	# 0x8074
     ("glGet",	B,	1,	"GL_NORMAL_ARRAY"),	# 0x8075
@@ -788,8 +788,8 @@
     ("",	X,	1,	"GL_TEXTURE_WRAP_Q_SGIS"),	# 0x8137
     ("glGet",	I,	1,	"GL_MAX_4D_TEXTURE_SIZE_SGIS"),	# 0x8138
     ("glGet",	I,	1,	"GL_PIXEL_TEX_GEN_SGIX"),	# 0x8139
-    ("glGetTexParameter",	F,	1,	"GL_TEXTURE_MIN_LOD"),	# 0x813A
-    ("glGetTexParameter",	F,	1,	"GL_TEXTURE_MAX_LOD"),	# 0x813B
+    ("glGetTexParameter,glGetSamplerParameter",	F,	1,	"GL_TEXTURE_MIN_LOD"),	# 0x813A
+    ("glGetTexParameter,glGetSamplerParameter",	F,	1,	"GL_TEXTURE_MAX_LOD"),	# 0x813B
     ("glGetTexParameter",	F,	1,	"GL_TEXTURE_BASE_LEVEL"),	# 0x813C
     ("glGetTexParameter",	F,	1,	"GL_TEXTURE_MAX_LEVEL"),	# 0x813D
     ("glGet",	I,	1,	"GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX"),	# 0x813E
@@ -1955,8 +1955,8 @@
     ("glGet",	P,	1,	"GL_MATRIX_INDEX_ARRAY_POINTER_ARB"),	# 0x8849
     ("glGetTexLevelParameter",	I,	1,	"GL_TEXTURE_DEPTH_SIZE"),	# 0x884A
     ("glGetTexParameter",	E,	1,	"GL_DEPTH_TEXTURE_MODE"),	# 0x884B
-    ("glGetTexParameter",	E,	1,	"GL_TEXTURE_COMPARE_MODE"),	# 0x884C
-    ("glGetTexParameter",	E,	1,	"GL_TEXTURE_COMPARE_FUNC"),	# 0x884D
+    ("glGetTexParameter,glGetSamplerParameter",	E,	1,	"GL_TEXTURE_COMPARE_MODE"),	# 0x884C
+    ("glGetTexParameter,glGetSamplerParameter",	E,	1,	"GL_TEXTURE_COMPARE_FUNC"),	# 0x884D
     ("",	X,	1,	"GL_COMPARE_REF_TO_TEXTURE"),	# 0x884E
     ("glGet",	B,	1,	"GL_TEXTURE_CUBE_MAP_SEAMLESS"),	# 0x884F
     ("",	X,	1,	"GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV"),	# 0x8850
@@ -2142,7 +2142,7 @@
     ("",	X,	1,	"GL_GEOMETRY_VERTICES_OUT"),	# 0x8916
     ("",	X,	1,	"GL_GEOMETRY_INPUT_TYPE"),	# 0x8917
     ("",	X,	1,	"GL_GEOMETRY_OUTPUT_TYPE"),	# 0x8918
-    ("glGet",	I,	1,	"GL_SAMPLER_BINDING"),	# 0x8919
+    ("_glGet",	I,	1,	"GL_SAMPLER_BINDING"),	# 0x8919
     ("glGet",	B,	1,	"GL_CLAMP_VERTEX_COLOR"),	# 0x891A
     ("glGet",	B,	1,	"GL_CLAMP_FRAGMENT_COLOR"),	# 0x891B
     ("glGet",	B,	1,	"GL_CLAMP_READ_COLOR"),	# 0x891C
diff --git a/src/apitrace/wrappers/regaltrace.cpp b/src/apitrace/wrappers/regaltrace.cpp
index 74167a5..b517640 100644
--- a/src/apitrace/wrappers/regaltrace.cpp
+++ b/src/apitrace/wrappers/regaltrace.cpp
@@ -14,6 +14,16 @@
 
 #include <RegalSystem.h>
 
+// Workaround for GLX emulation no supported for apitrace, yet
+
+#if REGAL_SYS_OSX || REGAL_SYS_ANDROID
+# if REGAL_SYS_GLX
+# undef REGAL_SYS_GLX
+# define REGAL_SYS_GLX 0
+# endif
+#endif
+
+
 #ifdef _WIN32
 #  include <malloc.h> // alloca
 #  ifndef alloca
diff --git a/src/apitrace/wrappers/regaltrace.py b/src/apitrace/wrappers/regaltrace.py
index 7f6c9f0..a1f18b0 100644
--- a/src/apitrace/wrappers/regaltrace.py
+++ b/src/apitrace/wrappers/regaltrace.py
@@ -149,6 +149,16 @@
 #include "glsize.hpp"
 
 #include <RegalSystem.h>
+
+// Workaround for GLX emulation no supported for apitrace, yet
+
+#if REGAL_SYS_OSX || REGAL_SYS_ANDROID
+# if REGAL_SYS_GLX
+# undef REGAL_SYS_GLX
+# define REGAL_SYS_GLX 0
+# endif
+#endif
+
 '''
 
     cglmodule = Module('cgl')
diff --git a/src/glew/include/GL/glew.h b/src/glew/include/GL/glew.h
index 51a29ef..1f4ab51 100644
--- a/src/glew/include/GL/glew.h
+++ b/src/glew/include/GL/glew.h
@@ -2731,6 +2731,15 @@
 
 #endif /* GL_AMD_seamless_cubemap_per_texture */
 
+/* -------------------- GL_AMD_shader_atomic_counter_ops ------------------- */
+
+#ifndef GL_AMD_shader_atomic_counter_ops
+#define GL_AMD_shader_atomic_counter_ops 1
+
+#define GLEW_AMD_shader_atomic_counter_ops GLEW_GET_VAR(__GLEW_AMD_shader_atomic_counter_ops)
+
+#endif /* GL_AMD_shader_atomic_counter_ops */
+
 /* ---------------------- GL_AMD_shader_stencil_export --------------------- */
 
 #ifndef GL_AMD_shader_stencil_export
@@ -17499,6 +17508,7 @@
 GLEW_VAR_EXPORT GLboolean __GLEW_AMD_query_buffer_object;
 GLEW_VAR_EXPORT GLboolean __GLEW_AMD_sample_positions;
 GLEW_VAR_EXPORT GLboolean __GLEW_AMD_seamless_cubemap_per_texture;
+GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_atomic_counter_ops;
 GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_stencil_export;
 GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_trinary_minmax;
 GLEW_VAR_EXPORT GLboolean __GLEW_AMD_sparse_texture;
diff --git a/src/glew/src/glew.c b/src/glew/src/glew.c
index d075b52..aacf867 100644
--- a/src/glew/src/glew.c
+++ b/src/glew/src/glew.c
@@ -2739,6 +2739,7 @@
 GLboolean __GLEW_AMD_query_buffer_object = GL_FALSE;
 GLboolean __GLEW_AMD_sample_positions = GL_FALSE;
 GLboolean __GLEW_AMD_seamless_cubemap_per_texture = GL_FALSE;
+GLboolean __GLEW_AMD_shader_atomic_counter_ops = GL_FALSE;
 GLboolean __GLEW_AMD_shader_stencil_export = GL_FALSE;
 GLboolean __GLEW_AMD_shader_trinary_minmax = GL_FALSE;
 GLboolean __GLEW_AMD_sparse_texture = GL_FALSE;
@@ -3814,6 +3815,10 @@
 
 #endif /* GL_AMD_seamless_cubemap_per_texture */
 
+#ifdef GL_AMD_shader_atomic_counter_ops
+
+#endif /* GL_AMD_shader_atomic_counter_ops */
+
 #ifdef GL_AMD_shader_stencil_export
 
 #endif /* GL_AMD_shader_stencil_export */
@@ -9637,6 +9642,9 @@
 #ifdef GL_AMD_seamless_cubemap_per_texture
   CONST_CAST(GLEW_AMD_seamless_cubemap_per_texture) = _glewSearchExtension("GL_AMD_seamless_cubemap_per_texture", extStart, extEnd);
 #endif /* GL_AMD_seamless_cubemap_per_texture */
+#ifdef GL_AMD_shader_atomic_counter_ops
+  CONST_CAST(GLEW_AMD_shader_atomic_counter_ops) = _glewSearchExtension("GL_AMD_shader_atomic_counter_ops", extStart, extEnd);
+#endif /* GL_AMD_shader_atomic_counter_ops */
 #ifdef GL_AMD_shader_stencil_export
   CONST_CAST(GLEW_AMD_shader_stencil_export) = _glewSearchExtension("GL_AMD_shader_stencil_export", extStart, extEnd);
 #endif /* GL_AMD_shader_stencil_export */
@@ -13736,6 +13744,13 @@
           continue;
         }
 #endif
+#ifdef GL_AMD_shader_atomic_counter_ops
+        if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_counter_ops", 25))
+        {
+          ret = GLEW_AMD_shader_atomic_counter_ops;
+          continue;
+        }
+#endif
 #ifdef GL_AMD_shader_stencil_export
         if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_stencil_export", 21))
         {
diff --git a/src/glew/src/glewinfo.c b/src/glew/src/glewinfo.c
index ad44f72..cfe92c8 100644
--- a/src/glew/src/glewinfo.c
+++ b/src/glew/src/glewinfo.c
@@ -727,6 +727,15 @@
 
 #endif /* GL_AMD_seamless_cubemap_per_texture */
 
+#ifdef GL_AMD_shader_atomic_counter_ops
+
+static void _glewInfo_GL_AMD_shader_atomic_counter_ops (void)
+{
+  glewPrintExt("GL_AMD_shader_atomic_counter_ops", GLEW_AMD_shader_atomic_counter_ops, glewIsSupported("GL_AMD_shader_atomic_counter_ops"), glewGetExtension("GL_AMD_shader_atomic_counter_ops"));
+}
+
+#endif /* GL_AMD_shader_atomic_counter_ops */
+
 #ifdef GL_AMD_shader_stencil_export
 
 static void _glewInfo_GL_AMD_shader_stencil_export (void)
@@ -8591,6 +8600,9 @@
 #ifdef GL_AMD_seamless_cubemap_per_texture
   _glewInfo_GL_AMD_seamless_cubemap_per_texture();
 #endif /* GL_AMD_seamless_cubemap_per_texture */
+#ifdef GL_AMD_shader_atomic_counter_ops
+  _glewInfo_GL_AMD_shader_atomic_counter_ops();
+#endif /* GL_AMD_shader_atomic_counter_ops */
 #ifdef GL_AMD_shader_stencil_export
   _glewInfo_GL_AMD_shader_stencil_export();
 #endif /* GL_AMD_shader_stencil_export */
diff --git a/src/glut/src/glut_event.c b/src/glut/src/glut_event.c
index c450ee9..e2aa74c 100644
--- a/src/glut/src/glut_event.c
+++ b/src/glut/src/glut_event.c
@@ -5,6 +5,13 @@
    and is provided without guarantee or warrantee expressed or
    implied. This program is -not- in the public domain. */
 
+/* Workaround an Ubuntu/Fedora libc.so incompatibility - optional */
+
+#ifdef _FORTIFY_SOURCE
+#undef _FORTIFY_SOURCE
+#define _FORTIFY_SOURCE 0
+#endif
+
 #ifdef __VMS
 #include <GL/vms_x_fix.h>
 #endif
diff --git a/src/regal/Regal.cpp b/src/regal/Regal.cpp
index d7bae81..5a850cf 100644
--- a/src/regal/Regal.cpp
+++ b/src/regal/Regal.cpp
@@ -664,7 +664,9 @@
         return;
 
       case GL_MISSING_REGAL:
+        #if REGAL_MISSING
         _context->dispatcher.disable(_context->dispatcher.missing);
+        #endif
         return;
 
       case GL_TRACE_REGAL:
@@ -793,7 +795,9 @@
         return;
 
       case GL_MISSING_REGAL:
+        #if REGAL_MISSING
         _context->dispatcher.enable(_context->dispatcher.missing);
+        #endif
         return;
 
       case GL_TRACE_REGAL:
@@ -1527,7 +1531,11 @@
         #endif
 
       case GL_MISSING_REGAL:
+        #if REGAL_MISSING
         return _context->dispatcher.isEnabled(_context->dispatcher.missing) ? GL_TRUE : GL_FALSE;
+        #else
+        return GL_FALSE;
+        #endif
 
       case GL_TRACE_REGAL:
         #if REGAL_TRACE
@@ -21207,6 +21215,28 @@
     _next->call(&_next->glUniformHandleui64vNV)(location, count, value);
   }
 
+  /* GL_NV_blend_equation_advanced */
+
+  REGAL_DECL void REGAL_CALL glBlendBarrierNV(void)
+  {
+    RegalContext *_context = REGAL_GET_CONTEXT();
+    App("glBlendBarrierNV","()");
+    if (!_context) return;
+    DispatchTableGL *_next = &_context->dispatcher.front();
+    RegalAssert(_next);
+    _next->call(&_next->glBlendBarrierNV)();
+  }
+
+  REGAL_DECL void REGAL_CALL glBlendParameteriNV(GLenum pname, GLint value)
+  {
+    RegalContext *_context = REGAL_GET_CONTEXT();
+    App("glBlendParameteriNV","(", toString(pname), ", ", value, ")");
+    if (!_context) return;
+    DispatchTableGL *_next = &_context->dispatcher.front();
+    RegalAssert(_next);
+    _next->call(&_next->glBlendParameteriNV)(pname, value);
+  }
+
   /* GL_NV_conditional_render */
 
   REGAL_DECL void REGAL_CALL glBeginConditionalRenderNV(GLuint id, GLenum mode)
@@ -29670,7 +29700,7 @@
     App("glXGetCurrentDrawable","()");
     DispatchTableGlobal *_next = &dispatcherGlobal.front();
     RegalAssert(_next);
-    GLXDrawable ret = (GLXDrawable) 0;
+    GLXDrawable ret = 0;
     ret = _next->call(&_next->glXGetCurrentDrawable)();
     return ret;
   }
@@ -29695,7 +29725,9 @@
     RegalContext *_context = REGAL_GET_CONTEXT();
     if (_context)
     {
+        #if REGAL_SYS_X11
         _context->x11Display  = dpy;
+        #endif
         _context->x11Drawable = drawable;
     }
     ret = _next->call(&_next->glXMakeCurrent)(dpy, drawable, ctx);
@@ -29734,7 +29766,9 @@
     RegalContext *_context = REGAL_GET_CONTEXT();
     if (_context)
     {
+        #if REGAL_SYS_X11
         _context->x11Display  = dpy;
+        #endif
         _context->x11Drawable = drawable;
     }
     // Notify Regal::Frame about the swap buffers event.
@@ -29894,7 +29928,7 @@
     App("glXGetCurrentReadDrawable","()");
     DispatchTableGlobal *_next = &dispatcherGlobal.front();
     RegalAssert(_next);
-    GLXDrawable ret = (GLXDrawable) 0;
+    GLXDrawable ret = 0;
     ret = _next->call(&_next->glXGetCurrentReadDrawable)();
     return ret;
   }
@@ -30772,7 +30806,7 @@
     App("glXGetCurrentReadDrawableSGI","()");
     DispatchTableGlobal *_next = &dispatcherGlobal.front();
     RegalAssert(_next);
-    GLXDrawable ret = (GLXDrawable) 0;
+    GLXDrawable ret = 0;
     ret = _next->call(&_next->glXGetCurrentReadDrawableSGI)();
     return ret;
   }
diff --git a/src/regal/Regal.def b/src/regal/Regal.def
index 69d35b8..ee30307 100644
--- a/src/regal/Regal.def
+++ b/src/regal/Regal.def
@@ -104,6 +104,7 @@
   glBinormal3svEXT
   glBinormalPointerEXT
   glBitmap
+  glBlendBarrierNV
   glBlendColor
   glBlendColorEXT
   glBlendEquation
@@ -129,6 +130,7 @@
   glBlendFuncSeparateiARB
   glBlendFunci
   glBlendFunciARB
+  glBlendParameteriNV
   glBlitFramebuffer
   glBlitFramebufferANGLE
   glBlitFramebufferEXT
diff --git a/src/regal/RegalConfig.cpp b/src/regal/RegalConfig.cpp
index d61d600..3f67cac 100644
--- a/src/regal/RegalConfig.cpp
+++ b/src/regal/RegalConfig.cpp
@@ -70,6 +70,7 @@
   bool enableStatistics    = false;
   bool enableLog           = REGAL_LOG;
   bool enableDriver        = REGAL_DRIVER;
+  bool enableMissing       = REGAL_MISSING;
 
   bool enableEmuHint       = REGAL_EMU_HINT;
   bool enableEmuPpa        = REGAL_EMU_PPA;
@@ -216,6 +217,7 @@
     getEnv( "REGAL_STATISTICS", enableStatistics, REGAL_STATISTICS);
     getEnv( "REGAL_LOG",        enableLog,        REGAL_LOG);
     getEnv( "REGAL_DRIVER",     enableDriver,     REGAL_DRIVER);
+    getEnv( "REGAL_MISSING",    enableMissing,    REGAL_MISSING);
 
     getEnv( "REGAL_EMU_HINT",       enableEmuHint,       REGAL_EMU_HINT);
     getEnv( "REGAL_EMU_PPA",        enableEmuPpa,        REGAL_EMU_PPA);
@@ -354,6 +356,7 @@
     Info("REGAL_EMULATION           ", enableEmulation     ? "enabled" : "disabled");
     Info("REGAL_LOG                 ", enableLog           ? "enabled" : "disabled");
     Info("REGAL_DRIVER              ", enableDriver        ? "enabled" : "disabled");
+    Info("REGAL_MISSING             ", enableMissing       ? "enabled" : "disabled");
 
     Info("REGAL_EMU_HINT            ", enableEmuHint       ? "enabled" : "disabled");
     Info("REGAL_EMU_PPA             ", enableEmuPpa        ? "enabled" : "disabled");
@@ -450,6 +453,7 @@
           jo.member("trace",      enableTrace);
           jo.member("log",        enableLog);
           jo.member("driver",     enableDriver);
+          jo.member("missing",    enableMissing);
         jo.end();
 
         jo.object("force");
diff --git a/src/regal/RegalConfig.h b/src/regal/RegalConfig.h
index 1e37286..44d8532 100644
--- a/src/regal/RegalConfig.h
+++ b/src/regal/RegalConfig.h
@@ -82,6 +82,7 @@
   extern bool enableStatistics;
   extern bool enableLog;
   extern bool enableDriver;
+  extern bool enableMissing;
 
   // Initial emulation layer enable/disable
 
diff --git a/src/regal/RegalContextInfo.cpp b/src/regal/RegalContextInfo.cpp
index 7db7f61..d8cfdf9 100644
--- a/src/regal/RegalContextInfo.cpp
+++ b/src/regal/RegalContextInfo.cpp
@@ -438,6 +438,7 @@
   gl_nv_3dvision_settings(false),
   gl_nv_bgr(false),
   gl_nv_bindless_texture(false),
+  gl_nv_blend_equation_advanced(false),
   gl_nv_blend_square(false),
   gl_nv_compute_program5(false),
   gl_nv_conditional_render(false),
@@ -1396,6 +1397,7 @@
   gl_nv_3dvision_settings = e.find("GL_NV_3dvision_settings")!=e.end();
   gl_nv_bgr = e.find("GL_NV_bgr")!=e.end();
   gl_nv_bindless_texture = e.find("GL_NV_bindless_texture")!=e.end();
+  gl_nv_blend_equation_advanced = e.find("GL_NV_blend_equation_advanced")!=e.end();
   gl_nv_blend_square = e.find("GL_NV_blend_square")!=e.end();
   gl_nv_compute_program5 = e.find("GL_NV_compute_program5")!=e.end();
   gl_nv_conditional_render = e.find("GL_NV_conditional_render")!=e.end();
@@ -2098,6 +2100,7 @@
   if (!strcmp(ext,"GL_NV_3dvision_settings")) return gl_nv_3dvision_settings;
   if (!strcmp(ext,"GL_NV_bgr")) return gl_nv_bgr;
   if (!strcmp(ext,"GL_NV_bindless_texture")) return gl_nv_bindless_texture;
+  if (!strcmp(ext,"GL_NV_blend_equation_advanced")) return gl_nv_blend_equation_advanced;
   if (!strcmp(ext,"GL_NV_blend_square")) return regal_nv_blend_square || gl_nv_blend_square;
   if (!strcmp(ext,"GL_NV_compute_program5")) return gl_nv_compute_program5;
   if (!strcmp(ext,"GL_NV_conditional_render")) return gl_nv_conditional_render;
diff --git a/src/regal/RegalContextInfo.h b/src/regal/RegalContextInfo.h
index 63cfe5e..b5fbf9a 100644
--- a/src/regal/RegalContextInfo.h
+++ b/src/regal/RegalContextInfo.h
@@ -466,6 +466,7 @@
   GLboolean gl_nv_3dvision_settings : 1;
   GLboolean gl_nv_bgr : 1;
   GLboolean gl_nv_bindless_texture : 1;
+  GLboolean gl_nv_blend_equation_advanced : 1;
   GLboolean gl_nv_blend_square : 1;
   GLboolean gl_nv_compute_program5 : 1;
   GLboolean gl_nv_conditional_render : 1;
diff --git a/src/regal/RegalDispatch.h b/src/regal/RegalDispatch.h
index 7bc1da2..3638225 100644
--- a/src/regal/RegalDispatch.h
+++ b/src/regal/RegalDispatch.h
@@ -3383,6 +3383,11 @@
     void (REGAL_CALL *glUniformHandleui64NV)(GLint location, GLuint64 value);
     void (REGAL_CALL *glUniformHandleui64vNV)(GLint location, GLsizei count, const GLuint64 *value);
 
+    // GL_NV_blend_equation_advanced
+
+    void (REGAL_CALL *glBlendBarrierNV)(void);
+    void (REGAL_CALL *glBlendParameteriNV)(GLenum pname, GLint value);
+
     // GL_NV_conditional_render
 
     void (REGAL_CALL *glBeginConditionalRenderNV)(GLuint id, GLenum mode);
diff --git a/src/regal/RegalDispatchCode.cpp b/src/regal/RegalDispatchCode.cpp
index b48bf66..2764aaf 100644
--- a/src/regal/RegalDispatchCode.cpp
+++ b/src/regal/RegalDispatchCode.cpp
@@ -38445,6 +38445,37 @@
       fprintf(_context->codeSource,"%s",_code.str().c_str());
 }
 
+static void REGAL_CALL code_glBlendBarrierNV(void)
+{
+    RegalContext *_context = REGAL_GET_CONTEXT();
+    RegalAssert(_context);
+    DispatchTableGL *_next = _context->dispatcher.code.next();
+    RegalAssert(_next);
+    _next->call(&_next->glBlendBarrierNV)();
+    std::string indent((_context->depthBeginEnd + _context->depthPushAttrib + 1)*2,' ');
+    string_list< ::std::string > _code;
+    _code << indent << "glBlendBarrierNV();\n";
+    if (_context->codeSource)
+      fprintf(_context->codeSource,"%s",_code.str().c_str());
+}
+
+static void REGAL_CALL code_glBlendParameteriNV(GLenum pname, GLint value)
+{
+    RegalContext *_context = REGAL_GET_CONTEXT();
+    RegalAssert(_context);
+    DispatchTableGL *_next = _context->dispatcher.code.next();
+    RegalAssert(_next);
+    _next->call(&_next->glBlendParameteriNV)(pname, value);
+    std::string indent((_context->depthBeginEnd + _context->depthPushAttrib + 1)*2,' ');
+    string_list< ::std::string > _code;
+    _code << indent << "glBlendParameteriNV(";
+                   _code << toString(pname);
+    _code << ", "; _code << value;
+    _code << ");\n";
+    if (_context->codeSource)
+      fprintf(_context->codeSource,"%s",_code.str().c_str());
+}
+
 static void REGAL_CALL code_glBeginConditionalRenderNV(GLuint id, GLenum mode)
 {
     RegalContext *_context = REGAL_GET_CONTEXT();
@@ -52485,6 +52516,8 @@
   tbl.glProgramUniformHandleui64vNV = code_glProgramUniformHandleui64vNV;
   tbl.glUniformHandleui64NV = code_glUniformHandleui64NV;
   tbl.glUniformHandleui64vNV = code_glUniformHandleui64vNV;
+  tbl.glBlendBarrierNV = code_glBlendBarrierNV;
+  tbl.glBlendParameteriNV = code_glBlendParameteriNV;
   tbl.glBeginConditionalRenderNV = code_glBeginConditionalRenderNV;
   tbl.glEndConditionalRenderNV = code_glEndConditionalRenderNV;
   tbl.glCopyImageSubDataNV = code_glCopyImageSubDataNV;
diff --git a/src/regal/RegalDispatchDebug.cpp b/src/regal/RegalDispatchDebug.cpp
index 5d16261..8b76471 100644
--- a/src/regal/RegalDispatchDebug.cpp
+++ b/src/regal/RegalDispatchDebug.cpp
@@ -8093,6 +8093,7 @@
   RegalAssert(_context);
   DispatchTableGL *_next = _context->dispatcher.debug.next();
   RegalAssert(_next);
+  _context->dbg->ActiveTexture( _context, texture );
   _next->call(&_next->glActiveTextureARB)(texture);
 }
 
@@ -8102,6 +8103,7 @@
   RegalAssert(_context);
   DispatchTableGL *_next = _context->dispatcher.debug.next();
   RegalAssert(_next);
+  _context->dbg->ClientActiveTexture( _context, texture );
   _next->call(&_next->glClientActiveTextureARB)(texture);
 }
 
@@ -18934,6 +18936,26 @@
   _next->call(&_next->glUniformHandleui64vNV)(location, count, value);
 }
 
+// GL_NV_blend_equation_advanced
+
+static void REGAL_CALL debug_glBlendBarrierNV(void)
+{
+  RegalContext *_context = REGAL_GET_CONTEXT();
+  RegalAssert(_context);
+  DispatchTableGL *_next = _context->dispatcher.debug.next();
+  RegalAssert(_next);
+  _next->call(&_next->glBlendBarrierNV)();
+}
+
+static void REGAL_CALL debug_glBlendParameteriNV(GLenum pname, GLint value)
+{
+  RegalContext *_context = REGAL_GET_CONTEXT();
+  RegalAssert(_context);
+  DispatchTableGL *_next = _context->dispatcher.debug.next();
+  RegalAssert(_next);
+  _next->call(&_next->glBlendParameteriNV)(pname, value);
+}
+
 // GL_NV_conditional_render
 
 static void REGAL_CALL debug_glBeginConditionalRenderNV(GLuint id, GLenum mode)
@@ -27490,6 +27512,11 @@
   tbl.glUniformHandleui64NV = debug_glUniformHandleui64NV;
   tbl.glUniformHandleui64vNV = debug_glUniformHandleui64vNV;
 
+  // GL_NV_blend_equation_advanced
+
+  tbl.glBlendBarrierNV = debug_glBlendBarrierNV;
+  tbl.glBlendParameteriNV = debug_glBlendParameteriNV;
+
   // GL_NV_conditional_render
 
   tbl.glBeginConditionalRenderNV = debug_glBeginConditionalRenderNV;
diff --git a/src/regal/RegalDispatchEmu.cpp b/src/regal/RegalDispatchEmu.cpp
index 240f5ff..47050d1 100644
--- a/src/regal/RegalDispatchEmu.cpp
+++ b/src/regal/RegalDispatchEmu.cpp
@@ -5174,10 +5174,8 @@
       {
         Push<int> pushLevel(_context->emuLevel);
         _context->emuLevel = 11;
-        if ( ! _context->ppca->glGetv( _context, pname, params ) ) {
-          if (!_context->info->core && !_context->info->es1 && !_context->info->es2) {
-            _context->dispatcher.emulation.glGetBooleanv( pname, params );
-          }
+        if ( ! _context->ppca->glGetv( *_context, pname, params ) ) {
+          _context->dispatcher.emulation.glGetBooleanv( pname, params );
         }
         return;
       }
@@ -5321,10 +5319,8 @@
       {
         Push<int> pushLevel(_context->emuLevel);
         _context->emuLevel = 11;
-        if ( ! _context->ppca->glGetv( _context, pname, params ) ) {
-          if (!_context->info->core && !_context->info->es1 && !_context->info->es2) {
-            _context->dispatcher.emulation.glGetDoublev( pname, params );
-          }
+        if ( ! _context->ppca->glGetv( *_context, pname, params ) ) {
+          _context->dispatcher.emulation.glGetDoublev( pname, params );
         }
         return;
       }
@@ -5491,10 +5487,8 @@
       {
         Push<int> pushLevel(_context->emuLevel);
         _context->emuLevel = 11;
-        if ( ! _context->ppca->glGetv( _context, pname, params ) ) {
-          if (!_context->info->core && !_context->info->es1 && !_context->info->es2) {
-            _context->dispatcher.emulation.glGetFloatv( pname, params );
-          }
+        if ( ! _context->ppca->glGetv( *_context, pname, params ) ) {
+          _context->dispatcher.emulation.glGetFloatv( pname, params );
         }
         return;
       }
@@ -5661,10 +5655,8 @@
       {
         Push<int> pushLevel(_context->emuLevel);
         _context->emuLevel = 11;
-        if ( ! _context->ppca->glGetv( _context, pname, params ) ) {
-          if (!_context->info->core && !_context->info->es1 && !_context->info->es2) {
-            _context->dispatcher.emulation.glGetIntegerv( pname, params );
-          }
+        if ( ! _context->ppca->glGetv( *_context, pname, params ) ) {
+          _context->dispatcher.emulation.glGetIntegerv( pname, params );
         }
         return;
       }
@@ -20226,7 +20218,7 @@
       {
         Push<int> pushLevel(_context->emuLevel);
         _context->emuLevel = 11;
-        _context->ppca->glPopClientAttrib( _context );
+        _context->ppca->glPopClientAttrib( *_context );
         return;
       }
       #endif
@@ -20276,7 +20268,7 @@
       {
         Push<int> pushLevel(_context->emuLevel);
         _context->emuLevel = 11;
-        _context->ppca->glPushClientAttrib( _context, mask );
+        _context->ppca->glPushClientAttrib( *_context, mask );
         return;
       }
       #endif
@@ -36536,6 +36528,14 @@
     case 12 :
     case 11 :
     case 10 :
+      #if REGAL_EMU_XFER
+      if (_context->xfer)
+      {
+        Push<int> pushLevel(_context->emuLevel);
+        _context->emuLevel = 9;
+        _context->xfer->ShadowActiveTexture( texture );
+      }
+      #endif
     case 9 :
     case 8 :
     case 7 :
@@ -36544,7 +36544,13 @@
       if (_context->iff) break;
       #endif
     case 5 :
+      #if REGAL_EMU_SO
+      if (_context->so) break;
+      #endif
     case 4 :
+      #if REGAL_EMU_DSA
+      if (_context->dsa) break;
+      #endif
     case 3 :
     case 2 :
       #if REGAL_EMU_TEXC
@@ -36583,7 +36589,30 @@
       }
       #endif
     case 5 :
+      #if REGAL_EMU_SO
+      if (_context->so)
+      {
+        Push<int> pushLevel(_context->emuLevel);
+        _context->emuLevel = 4;
+        RegalAssert(_context);
+        if ( !_context->so->ActiveTexture( *_context, texture ) ) {
+           _context->dispatcher.emulation.glActiveTexture( texture );
+        }
+        return;
+      }
+      #endif
     case 4 :
+      #if REGAL_EMU_DSA
+      if (_context->dsa)
+      {
+        Push<int> pushLevel(_context->emuLevel);
+        _context->emuLevel = 3;
+        if( false == _context->dsa->ShadowActiveTexture( texture ) ) {
+            _dispatch.call(&_dispatch.glActiveTexture)( texture );
+        }
+        return;
+      }
+      #endif
     case 3 :
     case 2 :
       #if REGAL_EMU_TEXC
@@ -36636,10 +36665,26 @@
     case 14 :
     case 13 :
     case 12 :
+      #if REGAL_EMU_PPCA
+      if (_context->ppca)
+      {
+        Push<int> pushLevel(_context->emuLevel);
+        _context->emuLevel = 11;
+        _context->ppca->glClientActiveTexture( texture );
+      }
+      #endif
     case 11 :
     case 10 :
     case 9 :
     case 8 :
+      #if REGAL_EMU_BASEVERTEX
+      if (_context->bv)
+      {
+        Push<int> pushLevel(_context->emuLevel);
+        _context->emuLevel = 7;
+        _context->bv->glClientActiveTexture( texture );
+      }
+      #endif
     case 7 :
     case 6 :
       #if REGAL_EMU_IFF
@@ -36652,7 +36697,18 @@
       #endif
     case 5 :
     case 4 :
+      #if REGAL_EMU_DSA
+      if (_context->dsa) break;
+      #endif
     case 3 :
+      #if REGAL_EMU_VAO
+      if (_context->vao)
+      {
+        Push<int> pushLevel(_context->emuLevel);
+        _context->emuLevel = 2;
+        _context->vao->ClientActiveTexture( _context, texture );
+      }
+      #endif
     case 2 :
     case 1 :
       #if REGAL_EMU_FILTER
@@ -36677,6 +36733,17 @@
     case 6 :
     case 5 :
     case 4 :
+      #if REGAL_EMU_DSA
+      if (_context->dsa)
+      {
+        Push<int> pushLevel(_context->emuLevel);
+        _context->emuLevel = 3;
+        if (!_context->dsa->ShadowClientActiveTexture( texture )) {
+          _dispatch.call(&_dispatch.glClientActiveTexture)( texture );
+        }
+        return;
+      }
+      #endif
     case 3 :
     case 2 :
     case 1 :
@@ -47136,7 +47203,7 @@
       {
         Push<int> pushLevel(_context->emuLevel);
         _context->emuLevel = 11;
-        _context->ppca->glClientAttribDefaultEXT( _context, mask );
+        _context->ppca->glClientAttribDefaultEXT( *_context, mask );
         return;
       }
       #endif
@@ -60867,7 +60934,7 @@
       {
         Push<int> pushLevel(_context->emuLevel);
         _context->emuLevel = 11;
-        _context->ppca->glPushClientAttribDefaultEXT( _context, mask );
+        _context->ppca->glPushClientAttribDefaultEXT( *_context, mask );
         return;
       }
       #endif
@@ -67914,6 +67981,8 @@
 
 // GL_NV_bindless_texture
 
+// GL_NV_blend_equation_advanced
+
 // GL_NV_conditional_render
 
 // GL_NV_copy_image
diff --git a/src/regal/RegalDispatchError.cpp b/src/regal/RegalDispatchError.cpp
index f8dd7b3..653046a 100644
--- a/src/regal/RegalDispatchError.cpp
+++ b/src/regal/RegalDispatchError.cpp
@@ -51524,6 +51524,58 @@
   }
 }
 
+// GL_NV_blend_equation_advanced
+
+static void REGAL_CALL error_glBlendBarrierNV(void)
+{
+  Internal("error_glBlendBarrierNV","()");
+  RegalContext *_context = REGAL_GET_CONTEXT();
+  RegalAssert(_context);
+  DispatchTableGL *_next = _context->dispatcher.error.next();
+  RegalAssert(_next);
+  GLenum _error = GL_NO_ERROR;
+  if (!_context->err.inBeginEnd)
+    _error = _next->call(&_next->glGetError)();
+  RegalAssert(_error==GL_NO_ERROR);
+  _next->call(&_next->glBlendBarrierNV)();
+  if (!_context->err.inBeginEnd) {
+    _error = _next->call(&_next->glGetError)();
+    if (_error!=GL_NO_ERROR) {
+      Error("glBlendBarrierNV : ",Token::GLerrorToString(_error));
+      #if REGAL_BREAK
+      Break::ErrorCB(_error);
+      #endif
+      if (_context->err.callback)
+        _context->err.callback( _error );
+    }
+  }
+}
+
+static void REGAL_CALL error_glBlendParameteriNV(GLenum pname, GLint value)
+{
+  Internal("error_glBlendParameteriNV","()");
+  RegalContext *_context = REGAL_GET_CONTEXT();
+  RegalAssert(_context);
+  DispatchTableGL *_next = _context->dispatcher.error.next();
+  RegalAssert(_next);
+  GLenum _error = GL_NO_ERROR;
+  if (!_context->err.inBeginEnd)
+    _error = _next->call(&_next->glGetError)();
+  RegalAssert(_error==GL_NO_ERROR);
+  _next->call(&_next->glBlendParameteriNV)(pname, value);
+  if (!_context->err.inBeginEnd) {
+    _error = _next->call(&_next->glGetError)();
+    if (_error!=GL_NO_ERROR) {
+      Error("glBlendParameteriNV : ",Token::GLerrorToString(_error));
+      #if REGAL_BREAK
+      Break::ErrorCB(_error);
+      #endif
+      if (_context->err.callback)
+        _context->err.callback( _error );
+    }
+  }
+}
+
 // GL_NV_conditional_render
 
 static void REGAL_CALL error_glBeginConditionalRenderNV(GLuint id, GLenum mode)
@@ -70192,6 +70244,11 @@
   tbl.glUniformHandleui64NV = error_glUniformHandleui64NV;
   tbl.glUniformHandleui64vNV = error_glUniformHandleui64vNV;
 
+  // GL_NV_blend_equation_advanced
+
+  tbl.glBlendBarrierNV = error_glBlendBarrierNV;
+  tbl.glBlendParameteriNV = error_glBlendParameteriNV;
+
   // GL_NV_conditional_render
 
   tbl.glBeginConditionalRenderNV = error_glBeginConditionalRenderNV;
diff --git a/src/regal/RegalDispatchGLX.cpp b/src/regal/RegalDispatchGLX.cpp
new file mode 100644
index 0000000..4a48387
--- /dev/null
+++ b/src/regal/RegalDispatchGLX.cpp
@@ -0,0 +1,1336 @@
+/* NOTE: Do not edit this file, it is generated by a script:
+   Export.py --api gl 4.4 --api wgl 4.4 --api glx 4.4 --api cgl 1.4 --api egl 1.0 --outdir .
+*/
+
+/*
+  Copyright (c) 2011-2013 NVIDIA Corporation
+  Copyright (c) 2011-2013 Cass Everitt
+  Copyright (c) 2012-2013 Scott Nations
+  Copyright (c) 2012 Mathias Schott
+  Copyright (c) 2012-2013 Nigel Stewart
+  Copyright (c) 2012-2013 Google Inc.
+  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.
+
+  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 HOLDER 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.
+*/
+
+/*
+  Intended formatting conventions:
+  $ astyle --style=allman --indent=spaces=2 --indent-switches
+*/
+
+#include "pch.h" /* For MS precompiled header support */
+
+#include "RegalUtil.h"
+
+#if REGAL_SYS_GLX && !REGAL_SYS_X11
+
+REGAL_GLOBAL_BEGIN
+
+#include "RegalLog.h"
+#include "RegalPush.h"
+#include "RegalToken.h"
+#include "RegalHelper.h"
+#include "RegalContext.h"
+#include "RegalDispatch.h"
+#include "RegalDispatcherGL.h"
+#include "RegalDispatcherGlobal.h"
+
+using namespace ::REGAL_NAMESPACE_INTERNAL::Logging;
+using namespace ::REGAL_NAMESPACE_INTERNAL::Token;
+
+REGAL_GLOBAL_END
+
+REGAL_NAMESPACE_BEGIN
+
+// GLX_VERSION_1_0
+
+static XVisualInfo *REGAL_CALL GLX_glXChooseVisual(Display *dpy, int screen, int *attribList)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    XVisualInfo * ret = _next->call(&_next->glXChooseVisual)(dpy, screen, attribList);
+    return ret;
+}
+
+static void REGAL_CALL GLX_glXCopyContext(Display *dpy, GLXContext src, GLXContext dst, unsigned long mask)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    _next->call(&_next->glXCopyContext)(dpy, src, dst, mask);
+}
+
+static GLXContext REGAL_CALL GLX_glXCreateContext(Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    GLXContext  ret = _next->call(&_next->glXCreateContext)(dpy, vis, shareList, direct);
+    return ret;
+}
+
+static GLXPixmap REGAL_CALL GLX_glXCreateGLXPixmap(Display *dpy, XVisualInfo *vis, Pixmap pixmap)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    GLXPixmap  ret = _next->call(&_next->glXCreateGLXPixmap)(dpy, vis, pixmap);
+    return ret;
+}
+
+static void REGAL_CALL GLX_glXDestroyContext(Display *dpy, GLXContext ctx)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    _next->call(&_next->glXDestroyContext)(dpy, ctx);
+}
+
+static void REGAL_CALL GLX_glXDestroyGLXPixmap(Display *dpy, GLXPixmap pix)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    _next->call(&_next->glXDestroyGLXPixmap)(dpy, pix);
+}
+
+static int REGAL_CALL GLX_glXGetConfig(Display *dpy, XVisualInfo *vis, int attrib, int *value)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    int  ret = _next->call(&_next->glXGetConfig)(dpy, vis, attrib, value);
+    return ret;
+}
+
+static GLXContext REGAL_CALL GLX_glXGetCurrentContext(void)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    GLXContext  ret = _next->call(&_next->glXGetCurrentContext)();
+    return ret;
+}
+
+static GLXDrawable REGAL_CALL GLX_glXGetCurrentDrawable(void)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    GLXDrawable  ret = _next->call(&_next->glXGetCurrentDrawable)();
+    return ret;
+}
+
+static Bool REGAL_CALL GLX_glXIsDirect(Display *dpy, GLXContext ctx)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    Bool  ret = _next->call(&_next->glXIsDirect)(dpy, ctx);
+    return ret;
+}
+
+static Bool REGAL_CALL GLX_glXMakeCurrent(Display *dpy, GLXDrawable drawable, GLXContext ctx)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    Bool  ret = _next->call(&_next->glXMakeCurrent)(dpy, drawable, ctx);
+    return ret;
+}
+
+static Bool REGAL_CALL GLX_glXQueryExtension(Display *dpy, int *errorBase, int *eventBase)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    Bool  ret = _next->call(&_next->glXQueryExtension)(dpy, errorBase, eventBase);
+    return ret;
+}
+
+static Bool REGAL_CALL GLX_glXQueryVersion(Display *dpy, int *major, int *minor)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    Bool  ret = _next->call(&_next->glXQueryVersion)(dpy, major, minor);
+    return ret;
+}
+
+static void REGAL_CALL GLX_glXSwapBuffers(Display *dpy, GLXDrawable drawable)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    _next->call(&_next->glXSwapBuffers)(dpy, drawable);
+}
+
+static void REGAL_CALL GLX_glXUseXFont(Font font, int first, int count, int listBase)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    _next->call(&_next->glXUseXFont)(font, first, count, listBase);
+}
+
+static void REGAL_CALL GLX_glXWaitGL(void)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    _next->call(&_next->glXWaitGL)();
+}
+
+static void REGAL_CALL GLX_glXWaitX(void)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    _next->call(&_next->glXWaitX)();
+}
+
+// GLX_VERSION_1_1
+
+static const char *REGAL_CALL GLX_glXGetClientString(Display *dpy, int name)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    const char * ret = _next->call(&_next->glXGetClientString)(dpy, name);
+    return ret;
+}
+
+static const char *REGAL_CALL GLX_glXQueryExtensionsString(Display *dpy, int screen)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+
+    const char *extensions = "";
+    return extensions;
+
+    const char * ret = _next->call(&_next->glXQueryExtensionsString)(dpy, screen);
+    return ret;
+}
+
+static const char *REGAL_CALL GLX_glXQueryServerString(Display *dpy, int screen, int name)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    const char * ret = _next->call(&_next->glXQueryServerString)(dpy, screen, name);
+    return ret;
+}
+
+// GLX_VERSION_1_2
+
+static Display *REGAL_CALL GLX_glXGetCurrentDisplay(void)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    Display * ret = _next->call(&_next->glXGetCurrentDisplay)();
+    return ret;
+}
+
+// GLX_VERSION_1_3
+
+static GLXFBConfig *REGAL_CALL GLX_glXChooseFBConfig(Display *dpy, int screen, const int *attrib_list, int *nelements)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+
+    static GLXFBConfig configs[1];
+    return configs;
+
+    GLXFBConfig * ret = _next->call(&_next->glXChooseFBConfig)(dpy, screen, attrib_list, nelements);
+    return ret;
+}
+
+static GLXContext REGAL_CALL GLX_glXCreateNewContext(Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    GLXContext  ret = _next->call(&_next->glXCreateNewContext)(dpy, config, render_type, share_list, direct);
+    return ret;
+}
+
+static GLXPbuffer REGAL_CALL GLX_glXCreatePbuffer(Display *dpy, GLXFBConfig config, const int *attrib_list)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    GLXPbuffer  ret = _next->call(&_next->glXCreatePbuffer)(dpy, config, attrib_list);
+    return ret;
+}
+
+static GLXPixmap REGAL_CALL GLX_glXCreatePixmap(Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    GLXPixmap  ret = _next->call(&_next->glXCreatePixmap)(dpy, config, pixmap, attrib_list);
+    return ret;
+}
+
+static GLXWindow REGAL_CALL GLX_glXCreateWindow(Display *dpy, GLXFBConfig config, Window win, const int *attrib_list)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    GLXWindow  ret = _next->call(&_next->glXCreateWindow)(dpy, config, win, attrib_list);
+    return ret;
+}
+
+static void REGAL_CALL GLX_glXDestroyPbuffer(Display *dpy, GLXPbuffer pbuf)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    _next->call(&_next->glXDestroyPbuffer)(dpy, pbuf);
+}
+
+static void REGAL_CALL GLX_glXDestroyPixmap(Display *dpy, GLXPixmap pixmap)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    _next->call(&_next->glXDestroyPixmap)(dpy, pixmap);
+}
+
+static void REGAL_CALL GLX_glXDestroyWindow(Display *dpy, GLXWindow win)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    _next->call(&_next->glXDestroyWindow)(dpy, win);
+}
+
+static GLXDrawable REGAL_CALL GLX_glXGetCurrentReadDrawable(void)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    GLXDrawable  ret = _next->call(&_next->glXGetCurrentReadDrawable)();
+    return ret;
+}
+
+static int REGAL_CALL GLX_glXGetFBConfigAttrib(Display *dpy, GLXFBConfig config, int attribute, int *value)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    int  ret = _next->call(&_next->glXGetFBConfigAttrib)(dpy, config, attribute, value);
+    return ret;
+}
+
+static GLXFBConfig *REGAL_CALL GLX_glXGetFBConfigs(Display *dpy, int screen, int *nelements)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    GLXFBConfig * ret = _next->call(&_next->glXGetFBConfigs)(dpy, screen, nelements);
+    return ret;
+}
+
+static void REGAL_CALL GLX_glXGetSelectedEvent(Display *dpy, GLXDrawable draw, unsigned long *event_mask)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    _next->call(&_next->glXGetSelectedEvent)(dpy, draw, event_mask);
+}
+
+static XVisualInfo *REGAL_CALL GLX_glXGetVisualFromFBConfig(Display *dpy, GLXFBConfig config)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+
+    static XVisualInfo vi;
+    return &vi;
+
+    XVisualInfo * ret = _next->call(&_next->glXGetVisualFromFBConfig)(dpy, config);
+    return ret;
+}
+
+static Bool REGAL_CALL GLX_glXMakeContextCurrent(Display *display, GLXDrawable draw, GLXDrawable read, GLXContext ctx)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    Bool  ret = _next->call(&_next->glXMakeContextCurrent)(display, draw, read, ctx);
+    return ret;
+}
+
+static int REGAL_CALL GLX_glXQueryContext(Display *dpy, GLXContext ctx, int attribute, int *value)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    int  ret = _next->call(&_next->glXQueryContext)(dpy, ctx, attribute, value);
+    return ret;
+}
+
+static void REGAL_CALL GLX_glXQueryDrawable(Display *dpy, GLXDrawable draw, int attribute, unsigned int *value)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    _next->call(&_next->glXQueryDrawable)(dpy, draw, attribute, value);
+}
+
+static void REGAL_CALL GLX_glXSelectEvent(Display *dpy, GLXDrawable draw, unsigned long event_mask)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    _next->call(&_next->glXSelectEvent)(dpy, draw, event_mask);
+}
+
+// GLX_VERSION_1_4
+
+static __GLXextFuncPtr REGAL_CALL GLX_glXGetProcAddress(const GLubyte *procName)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    __GLXextFuncPtr  ret = _next->call(&_next->glXGetProcAddress)(procName);
+    return ret;
+}
+
+// GLX_AMD_gpu_association
+
+static void REGAL_CALL GLX_glXBlitContextFramebufferAMD(GLXContext dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    _next->call(&_next->glXBlitContextFramebufferAMD)(dstCtx, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
+}
+
+static GLXContext REGAL_CALL GLX_glXCreateAssociatedContextAMD(unsigned int id, GLXContext share_list)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    GLXContext  ret = _next->call(&_next->glXCreateAssociatedContextAMD)(id, share_list);
+    return ret;
+}
+
+static GLXContext REGAL_CALL GLX_glXCreateAssociatedContextAttribsAMD(unsigned int id, GLXContext share_context, const int *attribList)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    GLXContext  ret = _next->call(&_next->glXCreateAssociatedContextAttribsAMD)(id, share_context, attribList);
+    return ret;
+}
+
+static Bool REGAL_CALL GLX_glXDeleteAssociatedContextAMD(GLXContext ctx)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    Bool  ret = _next->call(&_next->glXDeleteAssociatedContextAMD)(ctx);
+    return ret;
+}
+
+static unsigned int REGAL_CALL GLX_glXGetContextGPUIDAMD(GLXContext ctx)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    unsigned int  ret = _next->call(&_next->glXGetContextGPUIDAMD)(ctx);
+    return ret;
+}
+
+static GLXContext REGAL_CALL GLX_glXGetCurrentAssociatedContextAMD(void)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    GLXContext  ret = _next->call(&_next->glXGetCurrentAssociatedContextAMD)();
+    return ret;
+}
+
+static unsigned int REGAL_CALL GLX_glXGetGPUIDsAMD(unsigned int maxCount, unsigned int *ids)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    unsigned int  ret = _next->call(&_next->glXGetGPUIDsAMD)(maxCount, ids);
+    return ret;
+}
+
+static int REGAL_CALL GLX_glXGetGPUInfoAMD(unsigned int id, int property, GLenum dataType, unsigned int size, GLvoid *data)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    int  ret = _next->call(&_next->glXGetGPUInfoAMD)(id, property, dataType, size, data);
+    return ret;
+}
+
+static Bool REGAL_CALL GLX_glXMakeAssociatedContextCurrentAMD(GLXContext ctx)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    Bool  ret = _next->call(&_next->glXMakeAssociatedContextCurrentAMD)(ctx);
+    return ret;
+}
+
+// GLX_ARB_create_context
+
+static GLXContext REGAL_CALL GLX_glXCreateContextAttribsARB(Display *dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    GLXContext  ret = _next->call(&_next->glXCreateContextAttribsARB)(dpy, config, share_context, direct, attrib_list);
+    return ret;
+}
+
+// GLX_ARB_get_proc_address
+
+static __GLXextFuncPtr REGAL_CALL GLX_glXGetProcAddressARB(const GLubyte *procName)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    __GLXextFuncPtr  ret = _next->call(&_next->glXGetProcAddressARB)(procName);
+    return ret;
+}
+
+// GLX_ATI_render_texture
+
+static void REGAL_CALL GLX_glXBindTexImageATI(Display *dpy, GLXPbuffer pbuf, int buffer)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    _next->call(&_next->glXBindTexImageATI)(dpy, pbuf, buffer);
+}
+
+static void REGAL_CALL GLX_glXDrawableAttribATI(Display *dpy, GLXDrawable draw, const int *attrib_list)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    _next->call(&_next->glXDrawableAttribATI)(dpy, draw, attrib_list);
+}
+
+static void REGAL_CALL GLX_glXReleaseTexImageATI(Display *dpy, GLXPbuffer pbuf, int buffer)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    _next->call(&_next->glXReleaseTexImageATI)(dpy, pbuf, buffer);
+}
+
+// GLX_EXT_import_context
+
+static void REGAL_CALL GLX_glXFreeContextEXT(Display *dpy, GLXContext context)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    _next->call(&_next->glXFreeContextEXT)(dpy, context);
+}
+
+static GLXContextID REGAL_CALL GLX_glXGetContextIDEXT(const GLXContext context)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    GLXContextID  ret = _next->call(&_next->glXGetContextIDEXT)(context);
+    return ret;
+}
+
+static GLXContext REGAL_CALL GLX_glXImportContextEXT(Display *dpy, GLXContextID contextID)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    GLXContext  ret = _next->call(&_next->glXImportContextEXT)(dpy, contextID);
+    return ret;
+}
+
+static int REGAL_CALL GLX_glXQueryContextInfoEXT(Display *dpy, GLXContext context, int attribute, int *value)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    int  ret = _next->call(&_next->glXQueryContextInfoEXT)(dpy, context, attribute, value);
+    return ret;
+}
+
+// GLX_EXT_swap_control
+
+static void REGAL_CALL GLX_glXSwapIntervalEXT(Display *dpy, GLXDrawable drawable, int interval)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    _next->call(&_next->glXSwapIntervalEXT)(dpy, drawable, interval);
+}
+
+// GLX_EXT_texture_from_pixmap
+
+static void REGAL_CALL GLX_glXBindTexImageEXT(Display *display, GLXDrawable drawable, int buffer, const int *attrib_list)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    _next->call(&_next->glXBindTexImageEXT)(display, drawable, buffer, attrib_list);
+}
+
+static void REGAL_CALL GLX_glXReleaseTexImageEXT(Display *display, GLXDrawable drawable, int buffer)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    _next->call(&_next->glXReleaseTexImageEXT)(display, drawable, buffer);
+}
+
+// GLX_MESA_agp_offset
+
+static unsigned int REGAL_CALL GLX_glXGetAGPOffsetMESA(const void *pointer)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    unsigned int  ret = _next->call(&_next->glXGetAGPOffsetMESA)(pointer);
+    return ret;
+}
+
+// GLX_MESA_copy_sub_buffer
+
+static void REGAL_CALL GLX_glXCopySubBufferMESA(Display *dpy, GLXDrawable drawable, int x, int y, int width, int height)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    _next->call(&_next->glXCopySubBufferMESA)(dpy, drawable, x, y, width, height);
+}
+
+// GLX_MESA_pixmap_colormap
+
+static GLXPixmap REGAL_CALL GLX_glXCreateGLXPixmapMESA(Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    GLXPixmap  ret = _next->call(&_next->glXCreateGLXPixmapMESA)(dpy, visual, pixmap, cmap);
+    return ret;
+}
+
+// GLX_MESA_release_buffers
+
+static Bool REGAL_CALL GLX_glXReleaseBuffersMESA(Display *dpy, GLXDrawable d)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    Bool  ret = _next->call(&_next->glXReleaseBuffersMESA)(dpy, d);
+    return ret;
+}
+
+// GLX_MESA_set_3dfx_mode
+
+static GLboolean REGAL_CALL GLX_glXSet3DfxModeMESA(GLint mode)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    GLboolean  ret = _next->call(&_next->glXSet3DfxModeMESA)(mode);
+    return ret;
+}
+
+// GLX_MESA_swap_control
+
+static int REGAL_CALL GLX_glXGetSwapIntervalMESA(void)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    int  ret = _next->call(&_next->glXGetSwapIntervalMESA)();
+    return ret;
+}
+
+static int REGAL_CALL GLX_glXSwapIntervalMESA(unsigned int interval)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    int  ret = _next->call(&_next->glXSwapIntervalMESA)(interval);
+    return ret;
+}
+
+// GLX_NV_copy_image
+
+static void REGAL_CALL GLX_glXCopyImageSubDataNV(Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    _next->call(&_next->glXCopyImageSubDataNV)(dpy, srcCtx, srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstCtx, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, width, height, depth);
+}
+
+// GLX_NV_present_video
+
+static int REGAL_CALL GLX_glXBindVideoDeviceNV(Display *dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    int  ret = _next->call(&_next->glXBindVideoDeviceNV)(dpy, video_slot, video_device, attrib_list);
+    return ret;
+}
+
+static unsigned int *REGAL_CALL GLX_glXEnumerateVideoDevicesNV(Display *dpy, int screen, int *nelements)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    unsigned int * ret = _next->call(&_next->glXEnumerateVideoDevicesNV)(dpy, screen, nelements);
+    return ret;
+}
+
+// GLX_NV_swap_group
+
+static Bool REGAL_CALL GLX_glXBindSwapBarrierNV(Display *dpy, GLuint group, GLuint barrier)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    Bool  ret = _next->call(&_next->glXBindSwapBarrierNV)(dpy, group, barrier);
+    return ret;
+}
+
+static Bool REGAL_CALL GLX_glXJoinSwapGroupNV(Display *dpy, GLXDrawable drawable, GLuint group)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    Bool  ret = _next->call(&_next->glXJoinSwapGroupNV)(dpy, drawable, group);
+    return ret;
+}
+
+static Bool REGAL_CALL GLX_glXQueryFrameCountNV(Display *dpy, int screen, GLuint *count)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    Bool  ret = _next->call(&_next->glXQueryFrameCountNV)(dpy, screen, count);
+    return ret;
+}
+
+static Bool REGAL_CALL GLX_glXQueryMaxSwapGroupsNV(Display *dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    Bool  ret = _next->call(&_next->glXQueryMaxSwapGroupsNV)(dpy, screen, maxGroups, maxBarriers);
+    return ret;
+}
+
+static Bool REGAL_CALL GLX_glXQuerySwapGroupNV(Display *dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    Bool  ret = _next->call(&_next->glXQuerySwapGroupNV)(dpy, drawable, group, barrier);
+    return ret;
+}
+
+static Bool REGAL_CALL GLX_glXResetFrameCountNV(Display *dpy, int screen)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    Bool  ret = _next->call(&_next->glXResetFrameCountNV)(dpy, screen);
+    return ret;
+}
+
+// GLX_NV_vertex_array_range
+
+static void *REGAL_CALL GLX_glXAllocateMemoryNV(GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    void * ret = _next->call(&_next->glXAllocateMemoryNV)(size, readFrequency, writeFrequency, priority);
+    return ret;
+}
+
+static void REGAL_CALL GLX_glXFreeMemoryNV(void *pointer)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    _next->call(&_next->glXFreeMemoryNV)(pointer);
+}
+
+// GLX_NV_video_capture
+
+static int REGAL_CALL GLX_glXBindVideoCaptureDeviceNV(Display *dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    int  ret = _next->call(&_next->glXBindVideoCaptureDeviceNV)(dpy, video_capture_slot, device);
+    return ret;
+}
+
+static GLXVideoCaptureDeviceNV *REGAL_CALL GLX_glXEnumerateVideoCaptureDevicesNV(Display *dpy, int screen, int *nelements)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    GLXVideoCaptureDeviceNV * ret = _next->call(&_next->glXEnumerateVideoCaptureDevicesNV)(dpy, screen, nelements);
+    return ret;
+}
+
+static void REGAL_CALL GLX_glXLockVideoCaptureDeviceNV(Display *dpy, GLXVideoCaptureDeviceNV device)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    _next->call(&_next->glXLockVideoCaptureDeviceNV)(dpy, device);
+}
+
+static int REGAL_CALL GLX_glXQueryVideoCaptureDeviceNV(Display *dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    int  ret = _next->call(&_next->glXQueryVideoCaptureDeviceNV)(dpy, device, attribute, value);
+    return ret;
+}
+
+static void REGAL_CALL GLX_glXReleaseVideoCaptureDeviceNV(Display *dpy, GLXVideoCaptureDeviceNV device)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    _next->call(&_next->glXReleaseVideoCaptureDeviceNV)(dpy, device);
+}
+
+// GLX_NV_video_output
+
+static int REGAL_CALL GLX_glXBindVideoImageNV(Display *dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    int  ret = _next->call(&_next->glXBindVideoImageNV)(dpy, VideoDevice, pbuf, iVideoBuffer);
+    return ret;
+}
+
+static int REGAL_CALL GLX_glXGetVideoDeviceNV(Display *dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    int  ret = _next->call(&_next->glXGetVideoDeviceNV)(dpy, screen, numVideoDevices, pVideoDevice);
+    return ret;
+}
+
+static int REGAL_CALL GLX_glXGetVideoInfoNV(Display *dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    int  ret = _next->call(&_next->glXGetVideoInfoNV)(dpy, screen, VideoDevice, pulCounterOutputPbuffer, pulCounterOutputVideo);
+    return ret;
+}
+
+static int REGAL_CALL GLX_glXReleaseVideoDeviceNV(Display *dpy, int screen, GLXVideoDeviceNV VideoDevice)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    int  ret = _next->call(&_next->glXReleaseVideoDeviceNV)(dpy, screen, VideoDevice);
+    return ret;
+}
+
+static int REGAL_CALL GLX_glXReleaseVideoImageNV(Display *dpy, GLXPbuffer pbuf)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    int  ret = _next->call(&_next->glXReleaseVideoImageNV)(dpy, pbuf);
+    return ret;
+}
+
+static int REGAL_CALL GLX_glXSendPbufferToVideoNV(Display *dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    int  ret = _next->call(&_next->glXSendPbufferToVideoNV)(dpy, pbuf, iBufferType, pulCounterPbuffer, bBlock);
+    return ret;
+}
+
+// GLX_OML_sync_control
+
+static Bool REGAL_CALL GLX_glXGetMscRateOML(Display *dpy, GLXDrawable drawable, int32_t *numerator, int32_t *denominator)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    Bool  ret = _next->call(&_next->glXGetMscRateOML)(dpy, drawable, numerator, denominator);
+    return ret;
+}
+
+static Bool REGAL_CALL GLX_glXGetSyncValuesOML(Display *dpy, GLXDrawable drawable, int64_t *ust, int64_t *msc, int64_t *sbc)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    Bool  ret = _next->call(&_next->glXGetSyncValuesOML)(dpy, drawable, ust, msc, sbc);
+    return ret;
+}
+
+static int64_t REGAL_CALL GLX_glXSwapBuffersMscOML(Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    int64_t  ret = _next->call(&_next->glXSwapBuffersMscOML)(dpy, drawable, target_msc, divisor, remainder);
+    return ret;
+}
+
+static Bool REGAL_CALL GLX_glXWaitForMscOML(Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    Bool  ret = _next->call(&_next->glXWaitForMscOML)(dpy, drawable, target_msc, divisor, remainder, ust, msc, sbc);
+    return ret;
+}
+
+static Bool REGAL_CALL GLX_glXWaitForSbcOML(Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    Bool  ret = _next->call(&_next->glXWaitForSbcOML)(dpy, drawable, target_sbc, ust, msc, sbc);
+    return ret;
+}
+
+// GLX_SGIX_fbconfig
+
+static GLXFBConfigSGIX *REGAL_CALL GLX_glXChooseFBConfigSGIX(Display *dpy, int screen, const int *attrib_list, int *nelements)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    GLXFBConfigSGIX * ret = _next->call(&_next->glXChooseFBConfigSGIX)(dpy, screen, attrib_list, nelements);
+    return ret;
+}
+
+static GLXContext REGAL_CALL GLX_glXCreateContextWithConfigSGIX(Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    GLXContext  ret = _next->call(&_next->glXCreateContextWithConfigSGIX)(dpy, config, render_type, share_list, direct);
+    return ret;
+}
+
+static GLXPixmap REGAL_CALL GLX_glXCreateGLXPixmapWithConfigSGIX(Display *dpy, GLXFBConfig config, Pixmap pixmap)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    GLXPixmap  ret = _next->call(&_next->glXCreateGLXPixmapWithConfigSGIX)(dpy, config, pixmap);
+    return ret;
+}
+
+static int REGAL_CALL GLX_glXGetFBConfigAttribSGIX(Display *dpy, GLXFBConfigSGIX config, int attribute, int *value)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    int  ret = _next->call(&_next->glXGetFBConfigAttribSGIX)(dpy, config, attribute, value);
+    return ret;
+}
+
+static GLXFBConfigSGIX REGAL_CALL GLX_glXGetFBConfigFromVisualSGIX(Display *dpy, XVisualInfo *vis)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    GLXFBConfigSGIX  ret = _next->call(&_next->glXGetFBConfigFromVisualSGIX)(dpy, vis);
+    return ret;
+}
+
+static XVisualInfo *REGAL_CALL GLX_glXGetVisualFromFBConfigSGIX(Display *dpy, GLXFBConfig config)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    XVisualInfo * ret = _next->call(&_next->glXGetVisualFromFBConfigSGIX)(dpy, config);
+    return ret;
+}
+
+// GLX_SGIX_pbuffer
+
+static GLXPbuffer REGAL_CALL GLX_glXCreateGLXPbufferSGIX(Display *dpy, GLXFBConfig config, unsigned int width, unsigned int height, int *attrib_list)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    GLXPbuffer  ret = _next->call(&_next->glXCreateGLXPbufferSGIX)(dpy, config, width, height, attrib_list);
+    return ret;
+}
+
+static void REGAL_CALL GLX_glXDestroyGLXPbufferSGIX(Display *dpy, GLXPbuffer pbuf)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    _next->call(&_next->glXDestroyGLXPbufferSGIX)(dpy, pbuf);
+}
+
+static void REGAL_CALL GLX_glXGetSelectedEventSGIX(Display *dpy, GLXDrawable drawable, unsigned long *mask)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    _next->call(&_next->glXGetSelectedEventSGIX)(dpy, drawable, mask);
+}
+
+static void REGAL_CALL GLX_glXQueryGLXPbufferSGIX(Display *dpy, GLXPbuffer pbuf, int attribute, unsigned int *value)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    _next->call(&_next->glXQueryGLXPbufferSGIX)(dpy, pbuf, attribute, value);
+}
+
+static void REGAL_CALL GLX_glXSelectEventSGIX(Display *dpy, GLXDrawable drawable, unsigned long mask)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    _next->call(&_next->glXSelectEventSGIX)(dpy, drawable, mask);
+}
+
+// GLX_SGIX_swap_barrier
+
+static void REGAL_CALL GLX_glXBindSwapBarrierSGIX(Display *dpy, GLXDrawable drawable, int barrier)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    _next->call(&_next->glXBindSwapBarrierSGIX)(dpy, drawable, barrier);
+}
+
+static Bool REGAL_CALL GLX_glXQueryMaxSwapBarriersSGIX(Display *dpy, int screen, int *max)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    Bool  ret = _next->call(&_next->glXQueryMaxSwapBarriersSGIX)(dpy, screen, max);
+    return ret;
+}
+
+// GLX_SGIX_swap_group
+
+static void REGAL_CALL GLX_glXJoinSwapGroupSGIX(Display *dpy, GLXDrawable drawable, GLXDrawable member)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    _next->call(&_next->glXJoinSwapGroupSGIX)(dpy, drawable, member);
+}
+
+// GLX_SGIX_video_resize
+
+static int REGAL_CALL GLX_glXBindChannelToWindowSGIX(Display *display, int screen, int channel, Window window)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    int  ret = _next->call(&_next->glXBindChannelToWindowSGIX)(display, screen, channel, window);
+    return ret;
+}
+
+static int REGAL_CALL GLX_glXChannelRectSGIX(Display *display, int screen, int channel, int x, int y, int w, int h)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    int  ret = _next->call(&_next->glXChannelRectSGIX)(display, screen, channel, x, y, w, h);
+    return ret;
+}
+
+static int REGAL_CALL GLX_glXChannelRectSyncSGIX(Display *display, int screen, int channel, GLenum synctype)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    int  ret = _next->call(&_next->glXChannelRectSyncSGIX)(display, screen, channel, synctype);
+    return ret;
+}
+
+static int REGAL_CALL GLX_glXQueryChannelDeltasSGIX(Display *display, int screen, int channel, int *x, int *y, int *w, int *h)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    int  ret = _next->call(&_next->glXQueryChannelDeltasSGIX)(display, screen, channel, x, y, w, h);
+    return ret;
+}
+
+static int REGAL_CALL GLX_glXQueryChannelRectSGIX(Display *display, int screen, int channel, int *dx, int *dy, int *dw, int *dh)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    int  ret = _next->call(&_next->glXQueryChannelRectSGIX)(display, screen, channel, dx, dy, dw, dh);
+    return ret;
+}
+
+// GLX_SGI_cushion
+
+static void REGAL_CALL GLX_glXCushionSGI(Display *dpy, Window window, float cushion)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    _next->call(&_next->glXCushionSGI)(dpy, window, cushion);
+}
+
+// GLX_SGI_make_current_read
+
+static GLXDrawable REGAL_CALL GLX_glXGetCurrentReadDrawableSGI(void)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    GLXDrawable  ret = _next->call(&_next->glXGetCurrentReadDrawableSGI)();
+    return ret;
+}
+
+static Bool REGAL_CALL GLX_glXMakeCurrentReadSGI(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    Bool  ret = _next->call(&_next->glXMakeCurrentReadSGI)(dpy, draw, read, ctx);
+    return ret;
+}
+
+// GLX_SGI_swap_control
+
+static int REGAL_CALL GLX_glXSwapIntervalSGI(int interval)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    int  ret = _next->call(&_next->glXSwapIntervalSGI)(interval);
+    return ret;
+}
+
+// GLX_SGI_video_sync
+
+static int REGAL_CALL GLX_glXGetVideoSyncSGI(unsigned int *count)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    int  ret = _next->call(&_next->glXGetVideoSyncSGI)(count);
+    return ret;
+}
+
+static int REGAL_CALL GLX_glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    int  ret = _next->call(&_next->glXWaitVideoSyncSGI)(divisor, remainder, count);
+    return ret;
+}
+
+// GLX_SUN_get_transparent_index
+
+static Status REGAL_CALL GLX_glXGetTransparentIndexSUN(Display *dpy, Window overlay, Window underlay, unsigned long *pTransparentIndex)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    Status  ret = _next->call(&_next->glXGetTransparentIndexSUN)(dpy, overlay, underlay, pTransparentIndex);
+    return ret;
+}
+
+// GLX_SUN_video_resize
+
+static int REGAL_CALL GLX_glXGetVideoResizeSUN(Display *display, GLXDrawable window, float *factor)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    int  ret = _next->call(&_next->glXGetVideoResizeSUN)(display, window, factor);
+    return ret;
+}
+
+static int REGAL_CALL GLX_glXVideoResizeSUN(Display *display, GLXDrawable window, float factor)
+{
+    DispatchTableGlobal *_next = dispatcherGlobal.glx.next();
+    RegalAssert(_next);
+    int  ret = _next->call(&_next->glXVideoResizeSUN)(display, window, factor);
+    return ret;
+}
+
+void InitDispatchTableGLX(DispatchTableGL &tbl)
+{
+
+}
+
+void InitDispatchTableGlobalGLX(DispatchTableGlobal &tbl)
+{
+
+#if REGAL_SYS_GLX
+  // GLX_VERSION_1_0
+
+  tbl.glXChooseVisual = GLX_glXChooseVisual;
+  tbl.glXCopyContext = GLX_glXCopyContext;
+  tbl.glXCreateContext = GLX_glXCreateContext;
+  tbl.glXCreateGLXPixmap = GLX_glXCreateGLXPixmap;
+  tbl.glXDestroyContext = GLX_glXDestroyContext;
+  tbl.glXDestroyGLXPixmap = GLX_glXDestroyGLXPixmap;
+  tbl.glXGetConfig = GLX_glXGetConfig;
+  tbl.glXGetCurrentContext = GLX_glXGetCurrentContext;
+  tbl.glXGetCurrentDrawable = GLX_glXGetCurrentDrawable;
+  tbl.glXIsDirect = GLX_glXIsDirect;
+  tbl.glXMakeCurrent = GLX_glXMakeCurrent;
+  tbl.glXQueryExtension = GLX_glXQueryExtension;
+  tbl.glXQueryVersion = GLX_glXQueryVersion;
+  tbl.glXSwapBuffers = GLX_glXSwapBuffers;
+  tbl.glXUseXFont = GLX_glXUseXFont;
+  tbl.glXWaitGL = GLX_glXWaitGL;
+  tbl.glXWaitX = GLX_glXWaitX;
+
+  // GLX_VERSION_1_1
+
+  tbl.glXGetClientString = GLX_glXGetClientString;
+  tbl.glXQueryExtensionsString = GLX_glXQueryExtensionsString;
+  tbl.glXQueryServerString = GLX_glXQueryServerString;
+
+  // GLX_VERSION_1_2
+
+  tbl.glXGetCurrentDisplay = GLX_glXGetCurrentDisplay;
+
+  // GLX_VERSION_1_3
+
+  tbl.glXChooseFBConfig = GLX_glXChooseFBConfig;
+  tbl.glXCreateNewContext = GLX_glXCreateNewContext;
+  tbl.glXCreatePbuffer = GLX_glXCreatePbuffer;
+  tbl.glXCreatePixmap = GLX_glXCreatePixmap;
+  tbl.glXCreateWindow = GLX_glXCreateWindow;
+  tbl.glXDestroyPbuffer = GLX_glXDestroyPbuffer;
+  tbl.glXDestroyPixmap = GLX_glXDestroyPixmap;
+  tbl.glXDestroyWindow = GLX_glXDestroyWindow;
+  tbl.glXGetCurrentReadDrawable = GLX_glXGetCurrentReadDrawable;
+  tbl.glXGetFBConfigAttrib = GLX_glXGetFBConfigAttrib;
+  tbl.glXGetFBConfigs = GLX_glXGetFBConfigs;
+  tbl.glXGetSelectedEvent = GLX_glXGetSelectedEvent;
+  tbl.glXGetVisualFromFBConfig = GLX_glXGetVisualFromFBConfig;
+  tbl.glXMakeContextCurrent = GLX_glXMakeContextCurrent;
+  tbl.glXQueryContext = GLX_glXQueryContext;
+  tbl.glXQueryDrawable = GLX_glXQueryDrawable;
+  tbl.glXSelectEvent = GLX_glXSelectEvent;
+
+  // GLX_VERSION_1_4
+
+  tbl.glXGetProcAddress = GLX_glXGetProcAddress;
+
+  // GLX_AMD_gpu_association
+
+  tbl.glXBlitContextFramebufferAMD = GLX_glXBlitContextFramebufferAMD;
+  tbl.glXCreateAssociatedContextAMD = GLX_glXCreateAssociatedContextAMD;
+  tbl.glXCreateAssociatedContextAttribsAMD = GLX_glXCreateAssociatedContextAttribsAMD;
+  tbl.glXDeleteAssociatedContextAMD = GLX_glXDeleteAssociatedContextAMD;
+  tbl.glXGetContextGPUIDAMD = GLX_glXGetContextGPUIDAMD;
+  tbl.glXGetCurrentAssociatedContextAMD = GLX_glXGetCurrentAssociatedContextAMD;
+  tbl.glXGetGPUIDsAMD = GLX_glXGetGPUIDsAMD;
+  tbl.glXGetGPUInfoAMD = GLX_glXGetGPUInfoAMD;
+  tbl.glXMakeAssociatedContextCurrentAMD = GLX_glXMakeAssociatedContextCurrentAMD;
+
+  // GLX_ARB_create_context
+
+  tbl.glXCreateContextAttribsARB = GLX_glXCreateContextAttribsARB;
+
+  // GLX_ARB_get_proc_address
+
+  tbl.glXGetProcAddressARB = GLX_glXGetProcAddressARB;
+
+  // GLX_ATI_render_texture
+
+  tbl.glXBindTexImageATI = GLX_glXBindTexImageATI;
+  tbl.glXDrawableAttribATI = GLX_glXDrawableAttribATI;
+  tbl.glXReleaseTexImageATI = GLX_glXReleaseTexImageATI;
+
+  // GLX_EXT_import_context
+
+  tbl.glXFreeContextEXT = GLX_glXFreeContextEXT;
+  tbl.glXGetContextIDEXT = GLX_glXGetContextIDEXT;
+  tbl.glXImportContextEXT = GLX_glXImportContextEXT;
+  tbl.glXQueryContextInfoEXT = GLX_glXQueryContextInfoEXT;
+
+  // GLX_EXT_swap_control
+
+  tbl.glXSwapIntervalEXT = GLX_glXSwapIntervalEXT;
+
+  // GLX_EXT_texture_from_pixmap
+
+  tbl.glXBindTexImageEXT = GLX_glXBindTexImageEXT;
+  tbl.glXReleaseTexImageEXT = GLX_glXReleaseTexImageEXT;
+
+  // GLX_MESA_agp_offset
+
+  tbl.glXGetAGPOffsetMESA = GLX_glXGetAGPOffsetMESA;
+
+  // GLX_MESA_copy_sub_buffer
+
+  tbl.glXCopySubBufferMESA = GLX_glXCopySubBufferMESA;
+
+  // GLX_MESA_pixmap_colormap
+
+  tbl.glXCreateGLXPixmapMESA = GLX_glXCreateGLXPixmapMESA;
+
+  // GLX_MESA_release_buffers
+
+  tbl.glXReleaseBuffersMESA = GLX_glXReleaseBuffersMESA;
+
+  // GLX_MESA_set_3dfx_mode
+
+  tbl.glXSet3DfxModeMESA = GLX_glXSet3DfxModeMESA;
+
+  // GLX_MESA_swap_control
+
+  tbl.glXGetSwapIntervalMESA = GLX_glXGetSwapIntervalMESA;
+  tbl.glXSwapIntervalMESA = GLX_glXSwapIntervalMESA;
+
+  // GLX_NV_copy_image
+
+  tbl.glXCopyImageSubDataNV = GLX_glXCopyImageSubDataNV;
+
+  // GLX_NV_present_video
+
+  tbl.glXBindVideoDeviceNV = GLX_glXBindVideoDeviceNV;
+  tbl.glXEnumerateVideoDevicesNV = GLX_glXEnumerateVideoDevicesNV;
+
+  // GLX_NV_swap_group
+
+  tbl.glXBindSwapBarrierNV = GLX_glXBindSwapBarrierNV;
+  tbl.glXJoinSwapGroupNV = GLX_glXJoinSwapGroupNV;
+  tbl.glXQueryFrameCountNV = GLX_glXQueryFrameCountNV;
+  tbl.glXQueryMaxSwapGroupsNV = GLX_glXQueryMaxSwapGroupsNV;
+  tbl.glXQuerySwapGroupNV = GLX_glXQuerySwapGroupNV;
+  tbl.glXResetFrameCountNV = GLX_glXResetFrameCountNV;
+
+  // GLX_NV_vertex_array_range
+
+  tbl.glXAllocateMemoryNV = GLX_glXAllocateMemoryNV;
+  tbl.glXFreeMemoryNV = GLX_glXFreeMemoryNV;
+
+  // GLX_NV_video_capture
+
+  tbl.glXBindVideoCaptureDeviceNV = GLX_glXBindVideoCaptureDeviceNV;
+  tbl.glXEnumerateVideoCaptureDevicesNV = GLX_glXEnumerateVideoCaptureDevicesNV;
+  tbl.glXLockVideoCaptureDeviceNV = GLX_glXLockVideoCaptureDeviceNV;
+  tbl.glXQueryVideoCaptureDeviceNV = GLX_glXQueryVideoCaptureDeviceNV;
+  tbl.glXReleaseVideoCaptureDeviceNV = GLX_glXReleaseVideoCaptureDeviceNV;
+
+  // GLX_NV_video_output
+
+  tbl.glXBindVideoImageNV = GLX_glXBindVideoImageNV;
+  tbl.glXGetVideoDeviceNV = GLX_glXGetVideoDeviceNV;
+  tbl.glXGetVideoInfoNV = GLX_glXGetVideoInfoNV;
+  tbl.glXReleaseVideoDeviceNV = GLX_glXReleaseVideoDeviceNV;
+  tbl.glXReleaseVideoImageNV = GLX_glXReleaseVideoImageNV;
+  tbl.glXSendPbufferToVideoNV = GLX_glXSendPbufferToVideoNV;
+
+  // GLX_OML_sync_control
+
+  tbl.glXGetMscRateOML = GLX_glXGetMscRateOML;
+  tbl.glXGetSyncValuesOML = GLX_glXGetSyncValuesOML;
+  tbl.glXSwapBuffersMscOML = GLX_glXSwapBuffersMscOML;
+  tbl.glXWaitForMscOML = GLX_glXWaitForMscOML;
+  tbl.glXWaitForSbcOML = GLX_glXWaitForSbcOML;
+
+  // GLX_SGIX_fbconfig
+
+  tbl.glXChooseFBConfigSGIX = GLX_glXChooseFBConfigSGIX;
+  tbl.glXCreateContextWithConfigSGIX = GLX_glXCreateContextWithConfigSGIX;
+  tbl.glXCreateGLXPixmapWithConfigSGIX = GLX_glXCreateGLXPixmapWithConfigSGIX;
+  tbl.glXGetFBConfigAttribSGIX = GLX_glXGetFBConfigAttribSGIX;
+  tbl.glXGetFBConfigFromVisualSGIX = GLX_glXGetFBConfigFromVisualSGIX;
+  tbl.glXGetVisualFromFBConfigSGIX = GLX_glXGetVisualFromFBConfigSGIX;
+
+  // GLX_SGIX_pbuffer
+
+  tbl.glXCreateGLXPbufferSGIX = GLX_glXCreateGLXPbufferSGIX;
+  tbl.glXDestroyGLXPbufferSGIX = GLX_glXDestroyGLXPbufferSGIX;
+  tbl.glXGetSelectedEventSGIX = GLX_glXGetSelectedEventSGIX;
+  tbl.glXQueryGLXPbufferSGIX = GLX_glXQueryGLXPbufferSGIX;
+  tbl.glXSelectEventSGIX = GLX_glXSelectEventSGIX;
+
+  // GLX_SGIX_swap_barrier
+
+  tbl.glXBindSwapBarrierSGIX = GLX_glXBindSwapBarrierSGIX;
+  tbl.glXQueryMaxSwapBarriersSGIX = GLX_glXQueryMaxSwapBarriersSGIX;
+
+  // GLX_SGIX_swap_group
+
+  tbl.glXJoinSwapGroupSGIX = GLX_glXJoinSwapGroupSGIX;
+
+  // GLX_SGIX_video_resize
+
+  tbl.glXBindChannelToWindowSGIX = GLX_glXBindChannelToWindowSGIX;
+  tbl.glXChannelRectSGIX = GLX_glXChannelRectSGIX;
+  tbl.glXChannelRectSyncSGIX = GLX_glXChannelRectSyncSGIX;
+  tbl.glXQueryChannelDeltasSGIX = GLX_glXQueryChannelDeltasSGIX;
+  tbl.glXQueryChannelRectSGIX = GLX_glXQueryChannelRectSGIX;
+
+  // GLX_SGI_cushion
+
+  tbl.glXCushionSGI = GLX_glXCushionSGI;
+
+  // GLX_SGI_make_current_read
+
+  tbl.glXGetCurrentReadDrawableSGI = GLX_glXGetCurrentReadDrawableSGI;
+  tbl.glXMakeCurrentReadSGI = GLX_glXMakeCurrentReadSGI;
+
+  // GLX_SGI_swap_control
+
+  tbl.glXSwapIntervalSGI = GLX_glXSwapIntervalSGI;
+
+  // GLX_SGI_video_sync
+
+  tbl.glXGetVideoSyncSGI = GLX_glXGetVideoSyncSGI;
+  tbl.glXWaitVideoSyncSGI = GLX_glXWaitVideoSyncSGI;
+
+  // GLX_SUN_get_transparent_index
+
+  tbl.glXGetTransparentIndexSUN = GLX_glXGetTransparentIndexSUN;
+
+  // GLX_SUN_video_resize
+
+  tbl.glXGetVideoResizeSUN = GLX_glXGetVideoResizeSUN;
+  tbl.glXVideoResizeSUN = GLX_glXVideoResizeSUN;
+#endif // REGAL_SYS_GLX
+
+}
+
+REGAL_NAMESPACE_END
+
+#endif
diff --git a/src/regal/RegalDispatchLoader.cpp b/src/regal/RegalDispatchLoader.cpp
index e0e784d..98b2360 100644
--- a/src/regal/RegalDispatchLoader.cpp
+++ b/src/regal/RegalDispatchLoader.cpp
@@ -42,7 +42,7 @@
 
 #include "RegalUtil.h"
 
-#if REGAL_DRIVER
+#if REGAL_DRIVER && REGAL_LOADER
 
 REGAL_GLOBAL_BEGIN
 
@@ -38874,6 +38874,46 @@
   _next->call(&_next->glUniformHandleui64vNV)(location, count, value);
 }
 
+// GL_NV_blend_equation_advanced
+
+static void REGAL_CALL loader_glBlendBarrierNV(void)
+{
+  RegalContext * _context = REGAL_GET_CONTEXT();
+  RegalAssert(_context);
+  DispatchTableGL &_driver = _context->dispatcher.driver;
+  GetProcAddress(_driver.glBlendBarrierNV, "glBlendBarrierNV");
+  RegalAssert(_driver.glBlendBarrierNV!=glBlendBarrierNV);
+  if (_driver.glBlendBarrierNV==glBlendBarrierNV)
+    _driver.glBlendBarrierNV = NULL;
+  if (_driver.glBlendBarrierNV)
+  {
+    _driver.glBlendBarrierNV();
+    return;
+  }
+  DispatchTableGL *_next = _driver.next();
+  RegalAssert(_next);
+  _next->call(&_next->glBlendBarrierNV)();
+}
+
+static void REGAL_CALL loader_glBlendParameteriNV(GLenum pname, GLint value)
+{
+  RegalContext * _context = REGAL_GET_CONTEXT();
+  RegalAssert(_context);
+  DispatchTableGL &_driver = _context->dispatcher.driver;
+  GetProcAddress(_driver.glBlendParameteriNV, "glBlendParameteriNV");
+  RegalAssert(_driver.glBlendParameteriNV!=glBlendParameteriNV);
+  if (_driver.glBlendParameteriNV==glBlendParameteriNV)
+    _driver.glBlendParameteriNV = NULL;
+  if (_driver.glBlendParameteriNV)
+  {
+    _driver.glBlendParameteriNV(pname, value);
+    return;
+  }
+  DispatchTableGL *_next = _driver.next();
+  RegalAssert(_next);
+  _next->call(&_next->glBlendParameteriNV)(pname, value);
+}
+
 // GL_NV_conditional_render
 
 static void REGAL_CALL loader_glBeginConditionalRenderNV(GLuint id, GLenum mode)
@@ -59263,6 +59303,11 @@
   tbl.glUniformHandleui64NV = loader_glUniformHandleui64NV;
   tbl.glUniformHandleui64vNV = loader_glUniformHandleui64vNV;
 
+  // GL_NV_blend_equation_advanced
+
+  tbl.glBlendBarrierNV = loader_glBlendBarrierNV;
+  tbl.glBlendParameteriNV = loader_glBlendParameteriNV;
+
   // GL_NV_conditional_render
 
   tbl.glBeginConditionalRenderNV = loader_glBeginConditionalRenderNV;
diff --git a/src/regal/RegalDispatchLog.cpp b/src/regal/RegalDispatchLog.cpp
index f1f65fc..74c5652 100644
--- a/src/regal/RegalDispatchLog.cpp
+++ b/src/regal/RegalDispatchLog.cpp
@@ -20982,6 +20982,28 @@
     Driver("glUniformHandleui64vNV","(", location, ", ", count, ", ", boost::print::optional(value,Logging::pointers), ")");
 }
 
+// GL_NV_blend_equation_advanced
+
+static void REGAL_CALL log_glBlendBarrierNV(void)
+{
+    RegalContext *_context = REGAL_GET_CONTEXT();
+    RegalAssert(_context);
+    DispatchTableGL *_next = _context->dispatcher.logging.next();
+    RegalAssert(_next);
+    _next->call(&_next->glBlendBarrierNV)();
+    Driver("glBlendBarrierNV","()");
+}
+
+static void REGAL_CALL log_glBlendParameteriNV(GLenum pname, GLint value)
+{
+    RegalContext *_context = REGAL_GET_CONTEXT();
+    RegalAssert(_context);
+    DispatchTableGL *_next = _context->dispatcher.logging.next();
+    RegalAssert(_next);
+    _next->call(&_next->glBlendParameteriNV)(pname, value);
+    Driver("glBlendParameteriNV","(", toString(pname), ", ", value, ")");
+}
+
 // GL_NV_conditional_render
 
 static void REGAL_CALL log_glBeginConditionalRenderNV(GLuint id, GLenum mode)
@@ -33739,6 +33761,11 @@
   tbl.glUniformHandleui64NV = log_glUniformHandleui64NV;
   tbl.glUniformHandleui64vNV = log_glUniformHandleui64vNV;
 
+  // GL_NV_blend_equation_advanced
+
+  tbl.glBlendBarrierNV = log_glBlendBarrierNV;
+  tbl.glBlendParameteriNV = log_glBlendParameteriNV;
+
   // GL_NV_conditional_render
 
   tbl.glBeginConditionalRenderNV = log_glBeginConditionalRenderNV;
diff --git a/src/regal/RegalDispatchMissing.cpp b/src/regal/RegalDispatchMissing.cpp
index f5be0b1..74eb045 100644
--- a/src/regal/RegalDispatchMissing.cpp
+++ b/src/regal/RegalDispatchMissing.cpp
@@ -42,6 +42,8 @@
 
 #include "RegalUtil.h"
 
+#if REGAL_MISSING
+
 REGAL_GLOBAL_BEGIN
 
 #include <string>
@@ -17299,6 +17301,20 @@
   Warning( "glUniformHandleui64vNV not available." );
 }
 
+// GL_NV_blend_equation_advanced
+
+static void REGAL_CALL missing_glBlendBarrierNV(void)
+{
+  Warning( "glBlendBarrierNV not available." );
+}
+
+static void REGAL_CALL missing_glBlendParameteriNV(GLenum pname, GLint value)
+{
+  UNUSED_PARAMETER(pname);
+  UNUSED_PARAMETER(value);
+  Warning( "glBlendParameteriNV not available." );
+}
+
 // GL_NV_conditional_render
 
 static void REGAL_CALL missing_glBeginConditionalRenderNV(GLuint id, GLenum mode)
@@ -24115,7 +24131,7 @@
 static GLXDrawable REGAL_CALL missing_glXGetCurrentDrawable(void)
 {
   Warning( "glXGetCurrentDrawable not available." );
-  return (GLXDrawable) 0;
+  return 0;
 }
 
 static Bool REGAL_CALL missing_glXIsDirect(Display *dpy, GLXContext ctx)
@@ -24290,7 +24306,7 @@
 static GLXDrawable REGAL_CALL missing_glXGetCurrentReadDrawable(void)
 {
   Warning( "glXGetCurrentReadDrawable not available." );
-  return (GLXDrawable) 0;
+  return 0;
 }
 
 static int REGAL_CALL missing_glXGetFBConfigAttrib(Display *dpy, GLXFBConfig config, int attribute, int *value)
@@ -25128,7 +25144,7 @@
 static GLXDrawable REGAL_CALL missing_glXGetCurrentReadDrawableSGI(void)
 {
   Warning( "glXGetCurrentReadDrawableSGI not available." );
-  return (GLXDrawable) 0;
+  return 0;
 }
 
 static Bool REGAL_CALL missing_glXMakeCurrentReadSGI(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx)
@@ -28869,6 +28885,11 @@
   tbl.glUniformHandleui64NV = missing_glUniformHandleui64NV;
   tbl.glUniformHandleui64vNV = missing_glUniformHandleui64vNV;
 
+  // GL_NV_blend_equation_advanced
+
+  tbl.glBlendBarrierNV = missing_glBlendBarrierNV;
+  tbl.glBlendParameteriNV = missing_glBlendParameteriNV;
+
   // GL_NV_conditional_render
 
   tbl.glBeginConditionalRenderNV = missing_glBeginConditionalRenderNV;
@@ -30425,3 +30446,5 @@
 }
 
 REGAL_NAMESPACE_END
+
+#endif
diff --git a/src/regal/RegalDispatchStatistics.cpp b/src/regal/RegalDispatchStatistics.cpp
index 0ed962e..9fc9cda 100644
--- a/src/regal/RegalDispatchStatistics.cpp
+++ b/src/regal/RegalDispatchStatistics.cpp
@@ -31854,6 +31854,40 @@
   _next->call(&_next->glUniformHandleui64vNV)(location, count, value);
 }
 
+// GL_NV_blend_equation_advanced
+
+static void REGAL_CALL statistics_glBlendBarrierNV(void)
+{
+  RegalContext *_context = REGAL_GET_CONTEXT();
+  RegalAssert(_context);
+
+  RegalAssert(_context->statistics);
+  Statistics &statistics = *_context->statistics;
+  statistics.glBlendBarrierNV++;
+
+  statistics.gl_nv_blend_equation_advanced++;
+
+  DispatchTableGL *_next = _context->dispatcher.statistics.next();
+  RegalAssert(_next);
+  _next->call(&_next->glBlendBarrierNV)();
+}
+
+static void REGAL_CALL statistics_glBlendParameteriNV(GLenum pname, GLint value)
+{
+  RegalContext *_context = REGAL_GET_CONTEXT();
+  RegalAssert(_context);
+
+  RegalAssert(_context->statistics);
+  Statistics &statistics = *_context->statistics;
+  statistics.glBlendParameteriNV++;
+
+  statistics.gl_nv_blend_equation_advanced++;
+
+  DispatchTableGL *_next = _context->dispatcher.statistics.next();
+  RegalAssert(_next);
+  _next->call(&_next->glBlendParameteriNV)(pname, value);
+}
+
 // GL_NV_conditional_render
 
 static void REGAL_CALL statistics_glBeginConditionalRenderNV(GLuint id, GLenum mode)
@@ -44630,6 +44664,11 @@
   tbl.glUniformHandleui64NV = statistics_glUniformHandleui64NV;
   tbl.glUniformHandleui64vNV = statistics_glUniformHandleui64vNV;
 
+  // GL_NV_blend_equation_advanced
+
+  tbl.glBlendBarrierNV = statistics_glBlendBarrierNV;
+  tbl.glBlendParameteriNV = statistics_glBlendParameteriNV;
+
   // GL_NV_conditional_render
 
   tbl.glBeginConditionalRenderNV = statistics_glBeginConditionalRenderNV;
diff --git a/src/regal/RegalDispatchTrace.cpp b/src/regal/RegalDispatchTrace.cpp
index 28993f5..d52adb1 100644
--- a/src/regal/RegalDispatchTrace.cpp
+++ b/src/regal/RegalDispatchTrace.cpp
@@ -3580,7 +3580,7 @@
   BOOL  wglUseFontOutlinesW(HDC hDC, DWORD first, DWORD count, DWORD listBase, FLOAT deviation, FLOAT extrusion, int format, LPGLYPHMETRICSFLOAT lpgmf);
 #endif // REGAL_SYS_WGL
 
-#if REGAL_SYS_GLX
+#if REGAL_SYS_GLX && REGAL_SYS_X11
 
 // GLX_VERSION_1_0
 
@@ -3783,7 +3783,7 @@
 
   int  glXGetVideoSyncSGI(unsigned int *count);
   int  glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count);
-#endif // REGAL_SYS_GLX
+#endif // REGAL_SYS_GLX && REGAL_SYS_X11
 
 #if REGAL_SYS_OSX
 
@@ -31107,7 +31107,7 @@
 
 #endif // REGAL_SYS_WGL
 
-#if REGAL_SYS_GLX
+#if REGAL_SYS_GLX && REGAL_SYS_X11
 
 // GLX_VERSION_1_0
 
@@ -32204,7 +32204,7 @@
   return ret;
 }
 
-#endif // REGAL_SYS_GLX
+#endif // REGAL_SYS_GLX && REGAL_SYS_X11
 
 #if REGAL_SYS_OSX
 
@@ -36815,7 +36815,7 @@
   tbl.wglUseFontOutlinesW = trace_wglUseFontOutlinesW;
 #endif // REGAL_SYS_WGL
 
-#if REGAL_SYS_GLX
+#if REGAL_SYS_GLX && REGAL_SYS_X11
 
   // GLX_VERSION_1_0
 
@@ -37018,7 +37018,7 @@
 
   tbl.glXGetVideoSyncSGI = trace_glXGetVideoSyncSGI;
   tbl.glXWaitVideoSyncSGI = trace_glXWaitVideoSyncSGI;
-#endif // REGAL_SYS_GLX
+#endif // REGAL_SYS_GLX && REGAL_SYS_X11
 
 #if REGAL_SYS_OSX
 
diff --git a/src/regal/RegalDispatcherGL.cpp b/src/regal/RegalDispatcherGL.cpp
index d1c059b..b3c554a 100644
--- a/src/regal/RegalDispatcherGL.cpp
+++ b/src/regal/RegalDispatcherGL.cpp
@@ -107,8 +107,10 @@
   push_back(driver,Config::enableDriver);
   #endif
 
+  #if REGAL_MISSING
   InitDispatchTableMissing(missing);
-  push_back(missing,true);
+  push_back(missing,Config::enableMissing);
+  #endif
 
   // Optionally move the error checking dispatch to downstream of emulation.
   // This can be helpful for debugging Regal emulation
diff --git a/src/regal/RegalDispatcherGL.h b/src/regal/RegalDispatcherGL.h
index f4fe9e6..ed5da84 100644
--- a/src/regal/RegalDispatcherGL.h
+++ b/src/regal/RegalDispatcherGL.h
@@ -80,7 +80,9 @@
 
    DispatchTableGL driver;      // Underlying OpenGL/ES implementation
 
+#if REGAL_MISSING
    DispatchTableGL missing;     // Must have this last
+#endif
 
 public:
   DispatcherGL();
@@ -89,7 +91,10 @@
   inline void push_back(DispatchTableGL &table, bool enable)
   {
     // Disabling the missing table would be bad!
+    #if REGAL_MISSING
     RegalAssert(&table!=&missing || enable==true);
+    #endif
+
     Dispatcher::push_back(table,enable);
   }
 
diff --git a/src/regal/RegalDispatcherGlobal.cpp b/src/regal/RegalDispatcherGlobal.cpp
index 8134924..f4738cd 100644
--- a/src/regal/RegalDispatcherGlobal.cpp
+++ b/src/regal/RegalDispatcherGlobal.cpp
@@ -56,6 +56,12 @@
   push_back(logging,Config::enableLog);
   #endif
 
+  #if REGAL_SYS_GLX && !REGAL_SYS_X11
+  memset(&glx,0,sizeof(glx));
+  InitDispatchTableGlobalGLX(glx);
+  push_back(glx,true);
+  #endif
+
   // have to check this early for the global dispatches, otherwise we'd use Config
 
   #if REGAL_TRACE
@@ -79,9 +85,11 @@
   push_back(driver,Config::enableDriver);
   #endif
 
+  #if REGAL_MISSING
   memset(&missing,0,sizeof(missing));
   InitDispatchTableGlobalMissing(missing);
-  push_back(missing,true);
+  push_back(missing,Config::enableMissing);
+  #endif
 }
 
 DispatcherGlobal::~DispatcherGlobal()
diff --git a/src/regal/RegalDispatcherGlobal.h b/src/regal/RegalDispatcherGlobal.h
index 6913d64..271c0ad 100644
--- a/src/regal/RegalDispatcherGlobal.h
+++ b/src/regal/RegalDispatcherGlobal.h
@@ -50,13 +50,19 @@
   DispatchTableGlobal logging;
   #endif
 
+  #if REGAL_SYS_GLX && !REGAL_SYS_X11
+  DispatchTableGlobal glx;
+  #endif
+
   #if REGAL_TRACE
   DispatchTableGlobal trace;
   #endif
 
   DispatchTableGlobal driver;      // Underlying GLX/WGL/EGL implementation
 
+  #if REGAL_MISSING
   DispatchTableGlobal missing;     // Must have this last
+  #endif
 
 public:
   DispatcherGlobal();
@@ -65,7 +71,10 @@
   inline void push_back(DispatchTableGlobal &table, bool enable)
   {
     // Disabling the missing table would be bad!
+    #if REGAL_MISSING
     RegalAssert(&table!=&missing || enable==true);
+    #endif
+
     Dispatcher::push_back(table,enable);
   }
 
@@ -91,6 +100,7 @@
 #endif
 
 extern void InitDispatchTableGlobalLog       (DispatchTableGlobal &tbl);
+extern void InitDispatchTableGlobalGLX       (DispatchTableGlobal &tbl);
 extern void InitDispatchTableGlobalTrace     (DispatchTableGlobal &tbl);
 extern void InitDispatchTableGlobalLoader    (DispatchTableGlobal &tbl);
 extern void InitDispatchTableGlobalMissing   (DispatchTableGlobal &tbl);
diff --git a/src/regal/RegalEmu.h b/src/regal/RegalEmu.h
index f179ce4..6a4fe3c 100644
--- a/src/regal/RegalEmu.h
+++ b/src/regal/RegalEmu.h
@@ -40,8 +40,6 @@
 
 #include "RegalUtil.h"
 
-#if REGAL_EMULATION
-
 REGAL_GLOBAL_BEGIN
 
 #include <GL/Regal.h>
@@ -77,10 +75,10 @@
 #define REGAL_EMU_MAX_CLIENT_ATTRIB_STACK_DEPTH 16
 #endif
 
-REGAL_NAMESPACE_END
+#if REGAL_EMULATION
 
 #endif // REGAL_EMULATION
 
+REGAL_NAMESPACE_END
+
 #endif // ! __REGAL_EMU_H__
-
-
diff --git a/src/regal/RegalEnum.h b/src/regal/RegalEnum.h
index 5b52b88..c0bcc50 100644
--- a/src/regal/RegalEnum.h
+++ b/src/regal/RegalEnum.h
@@ -273,6 +273,7 @@
    RGL_BITMAP = GL_BITMAP,
    RGL_BITMAP_TOKEN = GL_BITMAP_TOKEN,
    RGL_BLEND = GL_BLEND,
+   RGL_BLEND_ADVANCED_COHERENT_NV = GL_BLEND_ADVANCED_COHERENT_NV,
    RGL_BLEND_COLOR = GL_BLEND_COLOR,
    RGL_BLEND_COLOR_EXT = GL_BLEND_COLOR_EXT,
    RGL_BLEND_DST = GL_BLEND_DST,
@@ -291,6 +292,8 @@
    RGL_BLEND_EQUATION_RGB = GL_BLEND_EQUATION_RGB,
    RGL_BLEND_EQUATION_RGB_EXT = GL_BLEND_EQUATION_RGB_EXT,
    RGL_BLEND_EQUATION_RGB_OES = GL_BLEND_EQUATION_RGB_OES,
+   RGL_BLEND_OVERLAP_NV = GL_BLEND_OVERLAP_NV,
+   RGL_BLEND_PREMULTIPLIED_SRC_NV = GL_BLEND_PREMULTIPLIED_SRC_NV,
    RGL_BLEND_SRC = GL_BLEND_SRC,
    RGL_BLEND_SRC_ALPHA = GL_BLEND_SRC_ALPHA,
    RGL_BLEND_SRC_ALPHA_EXT = GL_BLEND_SRC_ALPHA_EXT,
@@ -428,6 +431,8 @@
    RGL_COLOR = GL_COLOR,
    RGL_COLOR3_BIT_PGI = GL_COLOR3_BIT_PGI,
    RGL_COLOR4_BIT_PGI = GL_COLOR4_BIT_PGI,
+   RGL_COLORBURN_NV = GL_COLORBURN_NV,
+   RGL_COLORDODGE_NV = GL_COLORDODGE_NV,
    RGL_COLOR_ALPHA_PAIRING_ATI = GL_COLOR_ALPHA_PAIRING_ATI,
    RGL_COLOR_ARRAY = GL_COLOR_ARRAY,
    RGL_COLOR_ARRAY_ADDRESS_NV = GL_COLOR_ARRAY_ADDRESS_NV,
@@ -730,6 +735,7 @@
    RGL_COMP_BIT_ATI = GL_COMP_BIT_ATI,
    RGL_CONDITION_SATISFIED = GL_CONDITION_SATISFIED,
    RGL_CONDITION_SATISFIED_APPLE = GL_CONDITION_SATISFIED_APPLE,
+   RGL_CONJOINT_NV = GL_CONJOINT_NV,
    RGL_CONSERVE_MEMORY_HINT_PGI = GL_CONSERVE_MEMORY_HINT_PGI,
    RGL_CONSTANT = GL_CONSTANT,
    RGL_CONSTANT_ALPHA = GL_CONSTANT_ALPHA,
@@ -752,6 +758,7 @@
    RGL_CONTEXT_PROFILE_MASK = GL_CONTEXT_PROFILE_MASK,
    RGL_CONTEXT_ROBUST_ACCESS_EXT = GL_CONTEXT_ROBUST_ACCESS_EXT,
    RGL_CONTINUOUS_AMD = GL_CONTINUOUS_AMD,
+   RGL_CONTRAST_NV = GL_CONTRAST_NV,
    RGL_CONVEX_HULL_NV = GL_CONVEX_HULL_NV,
    RGL_CONVOLUTION_1D = GL_CONVOLUTION_1D,
    RGL_CONVOLUTION_1D_EXT = GL_CONVOLUTION_1D_EXT,
@@ -856,6 +863,7 @@
    RGL_CURRENT_VERTEX_WEIGHT_EXT = GL_CURRENT_VERTEX_WEIGHT_EXT,
    RGL_CURRENT_WEIGHT_ARB = GL_CURRENT_WEIGHT_ARB,
    RGL_CW = GL_CW,
+   RGL_DARKEN_NV = GL_DARKEN_NV,
    RGL_DATA_BUFFER_AMD = GL_DATA_BUFFER_AMD,
    RGL_DEBUG_CALLBACK_FUNCTION = GL_DEBUG_CALLBACK_FUNCTION,
    RGL_DEBUG_CALLBACK_FUNCTION_ARB = GL_DEBUG_CALLBACK_FUNCTION_ARB,
@@ -995,10 +1003,12 @@
    RGL_DETAIL_TEXTURE_FUNC_POINTS_SGIS = GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS,
    RGL_DETAIL_TEXTURE_LEVEL_SGIS = GL_DETAIL_TEXTURE_LEVEL_SGIS,
    RGL_DETAIL_TEXTURE_MODE_SGIS = GL_DETAIL_TEXTURE_MODE_SGIS,
+   RGL_DIFFERENCE_NV = GL_DIFFERENCE_NV,
    RGL_DIFFUSE = GL_DIFFUSE,
    RGL_DISCARD_ATI = GL_DISCARD_ATI,
    RGL_DISCARD_NV = GL_DISCARD_NV,
    RGL_DISCRETE_AMD = GL_DISCRETE_AMD,
+   RGL_DISJOINT_NV = GL_DISJOINT_NV,
    RGL_DISPATCH_INDIRECT_BUFFER = GL_DISPATCH_INDIRECT_BUFFER,
    RGL_DISPATCH_INDIRECT_BUFFER_BINDING = GL_DISPATCH_INDIRECT_BUFFER_BINDING,
    RGL_DISPLAY_LIST = GL_DISPLAY_LIST,
@@ -1147,7 +1157,12 @@
    RGL_DSDT_MAG_VIB_NV = GL_DSDT_MAG_VIB_NV,
    RGL_DSDT_NV = GL_DSDT_NV,
    RGL_DST_ALPHA = GL_DST_ALPHA,
+   RGL_DST_ATOP_NV = GL_DST_ATOP_NV,
    RGL_DST_COLOR = GL_DST_COLOR,
+   RGL_DST_IN_NV = GL_DST_IN_NV,
+   RGL_DST_NV = GL_DST_NV,
+   RGL_DST_OUT_NV = GL_DST_OUT_NV,
+   RGL_DST_OVER_NV = GL_DST_OVER_NV,
    RGL_DS_BIAS_NV = GL_DS_BIAS_NV,
    RGL_DS_SCALE_NV = GL_DS_SCALE_NV,
    RGL_DT_BIAS_NV = GL_DT_BIAS_NV,
@@ -1231,6 +1246,7 @@
    RGL_EVAL_VERTEX_ATTRIB7_NV = GL_EVAL_VERTEX_ATTRIB7_NV,
    RGL_EVAL_VERTEX_ATTRIB8_NV = GL_EVAL_VERTEX_ATTRIB8_NV,
    RGL_EVAL_VERTEX_ATTRIB9_NV = GL_EVAL_VERTEX_ATTRIB9_NV,
+   RGL_EXCLUSION_NV = GL_EXCLUSION_NV,
    RGL_EXP = GL_EXP,
    RGL_EXP2 = GL_EXP2,
    RGL_EXPAND_NEGATE_NV = GL_EXPAND_NEGATE_NV,
@@ -1597,6 +1613,8 @@
    RGL_HALF_FLOAT_ARB = GL_HALF_FLOAT_ARB,
    RGL_HALF_FLOAT_NV = GL_HALF_FLOAT_NV,
    RGL_HALF_FLOAT_OES = GL_HALF_FLOAT_OES,
+   RGL_HARDLIGHT_NV = GL_HARDLIGHT_NV,
+   RGL_HARDMIX_NV = GL_HARDMIX_NV,
    RGL_HIGH_FLOAT = GL_HIGH_FLOAT,
    RGL_HIGH_INT = GL_HIGH_INT,
    RGL_HILO16_NV = GL_HILO16_NV,
@@ -1624,6 +1642,10 @@
    RGL_HI_BIAS_NV = GL_HI_BIAS_NV,
    RGL_HI_SCALE_NV = GL_HI_SCALE_NV,
    RGL_HORIZONTAL_LINE_TO_NV = GL_HORIZONTAL_LINE_TO_NV,
+   RGL_HSL_COLOR_NV = GL_HSL_COLOR_NV,
+   RGL_HSL_HUE_NV = GL_HSL_HUE_NV,
+   RGL_HSL_LUMINOSITY_NV = GL_HSL_LUMINOSITY_NV,
+   RGL_HSL_SATURATION_NV = GL_HSL_SATURATION_NV,
    RGL_IDENTITY_NV = GL_IDENTITY_NV,
    RGL_IGNORE_BORDER = GL_IGNORE_BORDER,
    RGL_IMAGE_1D = GL_IMAGE_1D,
@@ -1856,6 +1878,8 @@
    RGL_INVERSE_TRANSPOSE_NV = GL_INVERSE_TRANSPOSE_NV,
    RGL_INVERT = GL_INVERT,
    RGL_INVERTED_SCREEN_W_REND = GL_INVERTED_SCREEN_W_REND,
+   RGL_INVERT_OVG_NV = GL_INVERT_OVG_NV,
+   RGL_INVERT_RGB_NV = GL_INVERT_RGB_NV,
    RGL_ISOLINES = GL_ISOLINES,
    RGL_IS_PER_PATCH = GL_IS_PER_PATCH,
    RGL_IS_ROW_MAJOR = GL_IS_ROW_MAJOR,
@@ -1886,6 +1910,7 @@
    RGL_LIGHT5 = GL_LIGHT5,
    RGL_LIGHT6 = GL_LIGHT6,
    RGL_LIGHT7 = GL_LIGHT7,
+   RGL_LIGHTEN_NV = GL_LIGHTEN_NV,
    RGL_LIGHTING = GL_LIGHTING,
    RGL_LIGHTING_BIT = GL_LIGHTING_BIT,
    RGL_LIGHT_ENV_MODE_EXT = GL_LIGHT_ENV_MODE_EXT,
@@ -1898,6 +1923,9 @@
    RGL_LIGHT_MODEL_TWO_SIDE = GL_LIGHT_MODEL_TWO_SIDE,
    RGL_LINE = GL_LINE,
    RGL_LINEAR = GL_LINEAR,
+   RGL_LINEARBURN_NV = GL_LINEARBURN_NV,
+   RGL_LINEARDODGE_NV = GL_LINEARDODGE_NV,
+   RGL_LINEARLIGHT_NV = GL_LINEARLIGHT_NV,
    RGL_LINEAR_ATTENUATION = GL_LINEAR_ATTENUATION,
    RGL_LINEAR_DETAIL_ALPHA_SGIS = GL_LINEAR_DETAIL_ALPHA_SGIS,
    RGL_LINEAR_DETAIL_COLOR_SGIS = GL_LINEAR_DETAIL_COLOR_SGIS,
@@ -2516,6 +2544,8 @@
    RGL_MINMAX_SINK = GL_MINMAX_SINK,
    RGL_MINMAX_SINK_EXT = GL_MINMAX_SINK_EXT,
    RGL_MINOR_VERSION = GL_MINOR_VERSION,
+   RGL_MINUS_CLAMPED_NV = GL_MINUS_CLAMPED_NV,
+   RGL_MINUS_NV = GL_MINUS_NV,
    RGL_MIN_ALPHA_SGIS = GL_MIN_ALPHA_SGIS,
    RGL_MIN_BLUE_SGIS = GL_MIN_BLUE_SGIS,
    RGL_MIN_EXT = GL_MIN_EXT,
@@ -2601,6 +2631,7 @@
    RGL_MOVE_TO_RESETS_NV = GL_MOVE_TO_RESETS_NV,
    RGL_MOV_ATI = GL_MOV_ATI,
    RGL_MULT = GL_MULT,
+   RGL_MULTIPLY_NV = GL_MULTIPLY_NV,
    RGL_MULTISAMPLE = GL_MULTISAMPLE,
    RGL_MULTISAMPLE_3DFX = GL_MULTISAMPLE_3DFX,
    RGL_MULTISAMPLE_ARB = GL_MULTISAMPLE_ARB,
@@ -2839,6 +2870,7 @@
    RGL_OUTPUT_TEXTURE_COORD9_EXT = GL_OUTPUT_TEXTURE_COORD9_EXT,
    RGL_OUTPUT_VERTEX_EXT = GL_OUTPUT_VERTEX_EXT,
    RGL_OUT_OF_MEMORY = GL_OUT_OF_MEMORY,
+   RGL_OVERLAY_NV = GL_OVERLAY_NV,
    RGL_PACK_ALIGNMENT = GL_PACK_ALIGNMENT,
    RGL_PACK_CMYK_HINT_EXT = GL_PACK_CMYK_HINT_EXT,
    RGL_PACK_COMPRESSED_BLOCK_DEPTH = GL_PACK_COMPRESSED_BLOCK_DEPTH,
@@ -2931,6 +2963,7 @@
    RGL_PER_STAGE_CONSTANTS_NV = GL_PER_STAGE_CONSTANTS_NV,
    RGL_PHONG_HINT_WIN = GL_PHONG_HINT_WIN,
    RGL_PHONG_WIN = GL_PHONG_WIN,
+   RGL_PINLIGHT_NV = GL_PINLIGHT_NV,
    RGL_PIXEL_BUFFER_BARRIER_BIT = GL_PIXEL_BUFFER_BARRIER_BIT,
    RGL_PIXEL_BUFFER_BARRIER_BIT_EXT = GL_PIXEL_BUFFER_BARRIER_BIT_EXT,
    RGL_PIXEL_COUNTER_BITS_NV = GL_PIXEL_COUNTER_BITS_NV,
@@ -2979,6 +3012,10 @@
    RGL_PIXEL_UNPACK_BUFFER_BINDING_NV = GL_PIXEL_UNPACK_BUFFER_BINDING_NV,
    RGL_PIXEL_UNPACK_BUFFER_EXT = GL_PIXEL_UNPACK_BUFFER_EXT,
    RGL_PIXEL_UNPACK_BUFFER_NV = GL_PIXEL_UNPACK_BUFFER_NV,
+   RGL_PLUS_CLAMPED_ALPHA_NV = GL_PLUS_CLAMPED_ALPHA_NV,
+   RGL_PLUS_CLAMPED_NV = GL_PLUS_CLAMPED_NV,
+   RGL_PLUS_DARKER_NV = GL_PLUS_DARKER_NV,
+   RGL_PLUS_NV = GL_PLUS_NV,
    RGL_PN_TRIANGLES_ATI = GL_PN_TRIANGLES_ATI,
    RGL_PN_TRIANGLES_NORMAL_MODE_ATI = GL_PN_TRIANGLES_NORMAL_MODE_ATI,
    RGL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI = GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI,
@@ -3642,6 +3679,7 @@
    RGL_SCISSOR_BOX = GL_SCISSOR_BOX,
    RGL_SCISSOR_TEST = GL_SCISSOR_TEST,
    RGL_SCREEN_COORDINATES_REND = GL_SCREEN_COORDINATES_REND,
+   RGL_SCREEN_NV = GL_SCREEN_NV,
    RGL_SECONDARY_COLOR_ARRAY = GL_SECONDARY_COLOR_ARRAY,
    RGL_SECONDARY_COLOR_ARRAY_ADDRESS_NV = GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV,
    RGL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING = GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING,
@@ -3758,6 +3796,7 @@
    RGL_SMOOTH_POINT_SIZE_GRANULARITY = GL_SMOOTH_POINT_SIZE_GRANULARITY,
    RGL_SMOOTH_POINT_SIZE_RANGE = GL_SMOOTH_POINT_SIZE_RANGE,
    RGL_SMOOTH_QUADRATIC_CURVE_TO_NV = GL_SMOOTH_QUADRATIC_CURVE_TO_NV,
+   RGL_SOFTLIGHT_NV = GL_SOFTLIGHT_NV,
    RGL_SOURCE0_ALPHA = GL_SOURCE0_ALPHA,
    RGL_SOURCE0_ALPHA_ARB = GL_SOURCE0_ALPHA_ARB,
    RGL_SOURCE0_ALPHA_EXT = GL_SOURCE0_ALPHA_EXT,
@@ -3797,7 +3836,12 @@
    RGL_SRC2_RGB = GL_SRC2_RGB,
    RGL_SRC_ALPHA = GL_SRC_ALPHA,
    RGL_SRC_ALPHA_SATURATE = GL_SRC_ALPHA_SATURATE,
+   RGL_SRC_ATOP_NV = GL_SRC_ATOP_NV,
    RGL_SRC_COLOR = GL_SRC_COLOR,
+   RGL_SRC_IN_NV = GL_SRC_IN_NV,
+   RGL_SRC_NV = GL_SRC_NV,
+   RGL_SRC_OUT_NV = GL_SRC_OUT_NV,
+   RGL_SRC_OVER_NV = GL_SRC_OVER_NV,
    RGL_SRGB = GL_SRGB,
    RGL_SRGB8 = GL_SRGB8,
    RGL_SRGB8_ALPHA8 = GL_SRGB8_ALPHA8,
@@ -4407,6 +4451,7 @@
    RGL_TRIANGULAR_NV = GL_TRIANGULAR_NV,
    RGL_TRUE = GL_TRUE,
    RGL_TYPE = GL_TYPE,
+   RGL_UNCORRELATED_NV = GL_UNCORRELATED_NV,
    RGL_UNDEFINED_APPLE = GL_UNDEFINED_APPLE,
    RGL_UNDEFINED_VERTEX = GL_UNDEFINED_VERTEX,
    RGL_UNIFORM = GL_UNIFORM,
@@ -4790,6 +4835,7 @@
    RGL_VIRTUAL_PAGE_SIZE_Y_ARB = GL_VIRTUAL_PAGE_SIZE_Y_ARB,
    RGL_VIRTUAL_PAGE_SIZE_Z_AMD = GL_VIRTUAL_PAGE_SIZE_Z_AMD,
    RGL_VIRTUAL_PAGE_SIZE_Z_ARB = GL_VIRTUAL_PAGE_SIZE_Z_ARB,
+   RGL_VIVIDLIGHT_NV = GL_VIVIDLIGHT_NV,
    RGL_VOLATILE_APPLE = GL_VOLATILE_APPLE,
    RGL_WAIT_FAILED = GL_WAIT_FAILED,
    RGL_WAIT_FAILED_APPLE = GL_WAIT_FAILED_APPLE,
diff --git a/src/regal/RegalLog.cpp b/src/regal/RegalLog.cpp
index e966b86..1ceccd5 100644
--- a/src/regal/RegalLog.cpp
+++ b/src/regal/RegalLog.cpp
@@ -616,7 +616,6 @@
 
 // Direct apitrace logging messages to Regal info log
 
-#if REGAL_TRACE
 namespace os {
 
   void log(const char *format, ...);
@@ -633,6 +632,5 @@
   }
 
 }
-#endif
 
 REGAL_GLOBAL_END
diff --git a/src/regal/RegalLookup.cpp b/src/regal/RegalLookup.cpp
index b41a2c0..4d2dea4 100644
--- a/src/regal/RegalLookup.cpp
+++ b/src/regal/RegalLookup.cpp
@@ -53,7 +53,7 @@
 
 namespace Lookup {
 
-const char * const gl_Name[2674] = {
+const char * const gl_Name[2676] = {
   "glAccum",
   "glActiveProgramEXT",
   "glActiveShaderProgram",
@@ -158,6 +158,7 @@
   "glBinormal3svEXT",
   "glBinormalPointerEXT",
   "glBitmap",
+  "glBlendBarrierNV",
   "glBlendColor",
   "glBlendColorEXT",
   "glBlendEquation",
@@ -183,6 +184,7 @@
   "glBlendFuncSeparateiARB",
   "glBlendFunci",
   "glBlendFunciARB",
+  "glBlendParameteriNV",
   "glBlitFramebuffer",
   "glBlitFramebufferANGLE",
   "glBlitFramebufferEXT",
@@ -2730,7 +2732,7 @@
   NULL
 };
 
-const void *gl_Value[2674] = {
+const void *gl_Value[2676] = {
   (void *)(glAccum),
   (void *)(glActiveProgramEXT),
   (void *)(glActiveShaderProgram),
@@ -2835,6 +2837,7 @@
   (void *)(glBinormal3svEXT),
   (void *)(glBinormalPointerEXT),
   (void *)(glBitmap),
+  (void *)(glBlendBarrierNV),
   (void *)(glBlendColor),
   (void *)(glBlendColorEXT),
   (void *)(glBlendEquation),
@@ -2860,6 +2863,7 @@
   (void *)(glBlendFuncSeparateiARB),
   (void *)(glBlendFunci),
   (void *)(glBlendFunciARB),
+  (void *)(glBlendParameteriNV),
   (void *)(glBlitFramebuffer),
   (void *)(glBlitFramebufferANGLE),
   (void *)(glBlitFramebufferEXT),
@@ -5407,7 +5411,7 @@
   NULL
 };
 
-const size_t gl_Offset[2674] = {
+const size_t gl_Offset[2676] = {
   offsetof(Dispatch::GL,glAccum)/sizeof(void *),
   offsetof(Dispatch::GL,glActiveProgramEXT)/sizeof(void *),
   offsetof(Dispatch::GL,glActiveShaderProgram)/sizeof(void *),
@@ -5512,6 +5516,7 @@
   offsetof(Dispatch::GL,glBinormal3svEXT)/sizeof(void *),
   offsetof(Dispatch::GL,glBinormalPointerEXT)/sizeof(void *),
   offsetof(Dispatch::GL,glBitmap)/sizeof(void *),
+  offsetof(Dispatch::GL,glBlendBarrierNV)/sizeof(void *),
   offsetof(Dispatch::GL,glBlendColor)/sizeof(void *),
   offsetof(Dispatch::GL,glBlendColorEXT)/sizeof(void *),
   offsetof(Dispatch::GL,glBlendEquation)/sizeof(void *),
@@ -5537,6 +5542,7 @@
   offsetof(Dispatch::GL,glBlendFuncSeparateiARB)/sizeof(void *),
   offsetof(Dispatch::GL,glBlendFunci)/sizeof(void *),
   offsetof(Dispatch::GL,glBlendFunciARB)/sizeof(void *),
+  offsetof(Dispatch::GL,glBlendParameteriNV)/sizeof(void *),
   offsetof(Dispatch::GL,glBlitFramebuffer)/sizeof(void *),
   offsetof(Dispatch::GL,glBlitFramebufferANGLE)/sizeof(void *),
   offsetof(Dispatch::GL,glBlitFramebufferEXT)/sizeof(void *),
diff --git a/src/regal/RegalLookup.h b/src/regal/RegalLookup.h
index 119dfd9..9d578b3 100644
--- a/src/regal/RegalLookup.h
+++ b/src/regal/RegalLookup.h
@@ -59,21 +59,21 @@
   return std::strcmp(*(const char **) a, *(const char **) b);
 }
 
-extern const char * const gl_Name[2674];
-extern const void *gl_Value[2674];
-extern const size_t gl_Offset[2674];
+extern const char * const gl_Name[2676];
+extern const void *gl_Value[2676];
+extern const size_t gl_Offset[2676];
 
 template<typename T>
 T
 gl_Lookup(const char *name, T def = NULL)
 {
-  const char **res = (const char **) std::bsearch(&name, gl_Name, 2673, sizeof(const char *), NameCmp);
+  const char **res = (const char **) std::bsearch(&name, gl_Name, 2675, sizeof(const char *), NameCmp);
   return res ? reinterpret_cast<T>(const_cast<void *>(gl_Value[(size_t) (res - gl_Name)])) : def;
 }
 
 inline size_t gl_LookupOffset(const char *name)
 {
-  const char **res = (const char **) std::bsearch(&name, gl_Name, 2673, sizeof(const char *), NameCmp);
+  const char **res = (const char **) std::bsearch(&name, gl_Name, 2675, sizeof(const char *), NameCmp);
   return res ? gl_Offset[(size_t) (res - gl_Name)] : 0;
 }
 
diff --git a/src/regal/RegalPlugin.cpp b/src/regal/RegalPlugin.cpp
index 4eba1b7..0e004ec 100644
--- a/src/regal/RegalPlugin.cpp
+++ b/src/regal/RegalPlugin.cpp
@@ -16772,6 +16772,24 @@
     _next->call(&_next->glUniformHandleui64vNV)(location, count, value);
   }
 
+  /* GL_NV_blend_equation_advanced */
+
+  void REGAL_CALL plugin_glBlendBarrierNV(void)
+  {
+    ::REGAL_NAMESPACE_INTERNAL::Thread::ThreadLocal &_instance = ::REGAL_NAMESPACE_INTERNAL::Thread::ThreadLocal::instance();
+    ::REGAL_NAMESPACE_INTERNAL::DispatchTableGL *_next = _instance.nextDispatchTable;
+    RegalAssert(_next);
+    _next->call(&_next->glBlendBarrierNV)();
+  }
+
+  void REGAL_CALL plugin_glBlendParameteriNV(GLenum pname, GLint value)
+  {
+    ::REGAL_NAMESPACE_INTERNAL::Thread::ThreadLocal &_instance = ::REGAL_NAMESPACE_INTERNAL::Thread::ThreadLocal::instance();
+    ::REGAL_NAMESPACE_INTERNAL::DispatchTableGL *_next = _instance.nextDispatchTable;
+    RegalAssert(_next);
+    _next->call(&_next->glBlendParameteriNV)(pname, value);
+  }
+
   /* GL_NV_conditional_render */
 
   void REGAL_CALL plugin_glBeginConditionalRenderNV(GLuint id, GLenum mode)
@@ -25239,7 +25257,7 @@
 
 namespace Plugin {
 
-  const char * const lookup_gl_Name[2671] = {
+  const char * const lookup_gl_Name[2673] = {
     "glAccum",
     "glActiveProgramEXT",
     "glActiveShaderProgram",
@@ -25344,6 +25362,7 @@
     "glBinormal3svEXT",
     "glBinormalPointerEXT",
     "glBitmap",
+    "glBlendBarrierNV",
     "glBlendColor",
     "glBlendColorEXT",
     "glBlendEquation",
@@ -25369,6 +25388,7 @@
     "glBlendFuncSeparateiARB",
     "glBlendFunci",
     "glBlendFunciARB",
+    "glBlendParameteriNV",
     "glBlitFramebuffer",
     "glBlitFramebufferANGLE",
     "glBlitFramebufferEXT",
@@ -27913,7 +27933,7 @@
     NULL
   };
 
-  const void *lookup_gl_Value[2671] = {
+  const void *lookup_gl_Value[2673] = {
     (void *)(plugin_glAccum),
     (void *)(plugin_glActiveProgramEXT),
     (void *)(plugin_glActiveShaderProgram),
@@ -28018,6 +28038,7 @@
     (void *)(plugin_glBinormal3svEXT),
     (void *)(plugin_glBinormalPointerEXT),
     (void *)(plugin_glBitmap),
+    (void *)(plugin_glBlendBarrierNV),
     (void *)(plugin_glBlendColor),
     (void *)(plugin_glBlendColorEXT),
     (void *)(plugin_glBlendEquation),
@@ -28043,6 +28064,7 @@
     (void *)(plugin_glBlendFuncSeparateiARB),
     (void *)(plugin_glBlendFunci),
     (void *)(plugin_glBlendFunciARB),
+    (void *)(plugin_glBlendParameteriNV),
     (void *)(plugin_glBlitFramebuffer),
     (void *)(plugin_glBlitFramebufferANGLE),
     (void *)(plugin_glBlitFramebufferEXT),
@@ -31403,7 +31425,7 @@
   {
     const char **res;
 
-    res = (const char **) std::bsearch(&name, lookup_gl_Name, 2669, sizeof(const char *), NameCmp);
+    res = (const char **) std::bsearch(&name, lookup_gl_Name, 2671, sizeof(const char *), NameCmp);
     if (res) return const_cast<void *>(lookup_gl_Value[(size_t) (res - lookup_gl_Name)]);
 
 #if REGAL_SYS_WGL
diff --git a/src/regal/RegalPpca.h b/src/regal/RegalPpca.h
index 747f79a..11cf282 100644
--- a/src/regal/RegalPpca.h
+++ b/src/regal/RegalPpca.h
@@ -66,6 +66,11 @@
 
 struct Ppca : public ClientState::VertexArray, ClientState::PixelStore
 {
+  Ppca()
+  : driverAllowsVertexAttributeArraysWithoutBoundBuffer(true)
+  {
+  }
+
   void Init(RegalContext &ctx)
   {
     Reset(ctx);
@@ -84,7 +89,7 @@
     // logs a message if a call is made to glVertexAttribPointer and no
     // GL_ARRAY_BUFFER is bound.
 
-    driverAllowsVertexAttributeArraysWithoutBoundBuffer = ( !ctx.info->es2 || ctx.info->vendor != "Chromium" );
+    driverAllowsVertexAttributeArraysWithoutBoundBuffer = ( !ctx.isES2() || ctx.info->vendor != "Chromium" );
   }
 
   void Cleanup(RegalContext &ctx)
@@ -92,14 +97,14 @@
     UNUSED_PARAMETER(ctx);
   }
 
-  void glPushClientAttrib(RegalContext *ctx, GLbitfield mask)
+  void glPushClientAttrib(RegalContext &ctx, GLbitfield mask)
   {
     // from glspec43.compatibility.20130214.withchanges.pdf Sec. 21.6, p. 622
     //
     // A STACK_OVERFLOW error is generated if PushClientAttrib is called
     // and the client attribute stack depth is equal to the value of
     // MAX_CLIENT_ATTRIB_STACK_DEPTH.
-    // 
+    //
     // TODO: set correct GL error here
 
     if (maskStack.size() >= REGAL_EMU_MAX_CLIENT_ATTRIB_STACK_DEPTH)
@@ -125,24 +130,20 @@
 
     // Pass the rest through, for now
 
-    RegalAssert(ctx);
-
-    if (ctx->info->core || ctx->info->es1 || ctx->info->es2)
+    if (ctx.isCore() || ctx.isES1() || ctx.isES2())
       return;
 
     if (mask)
-      ctx->dispatcher.emulation.glPushClientAttrib(mask);
+      ctx.dispatcher.emulation.glPushClientAttrib(mask);
   }
 
-  void glPopClientAttrib(RegalContext *ctx)
+  void glPopClientAttrib(RegalContext &ctx)
   {
-    RegalAssert(ctx);
-
     // from glspec43.compatibility.20130214.withchanges.pdf Sec. 21.6, p. 622
     //
     // A STACK_UNDERFLOW error is generated if PopClientAttrib is called
     // and the client attribute stack depth is zero.
-    // 
+    //
     // TODO: set correct GL error here
 
     if (!maskStack.size())
@@ -154,7 +155,7 @@
     if (mask&GL_CLIENT_VERTEX_ARRAY_BIT)
     {
       RegalAssert(vertexArrayStack.size());
-      ClientState::VertexArray::transition(ctx->dispatcher.emulation, vertexArrayStack.back(), driverAllowsVertexAttributeArraysWithoutBoundBuffer);
+      ClientState::VertexArray::transition(ctx.dispatcher.emulation, vertexArrayStack.back(), driverAllowsVertexAttributeArraysWithoutBoundBuffer);
       vertexArrayStack.pop_back();
 
       Internal("Regal::Ppca::PopClientAttrib GL_CLIENT_VERTEX_ARRAY_BIT ",ClientState::VertexArray::toString());
@@ -165,7 +166,7 @@
     if (mask&GL_CLIENT_PIXEL_STORE_BIT)
     {
       RegalAssert(pixelStoreStack.size());
-      ClientState::PixelStore::transition(ctx->dispatcher.emulation, pixelStoreStack.back());
+      ClientState::PixelStore::transition(ctx.dispatcher.emulation, pixelStoreStack.back());
       pixelStoreStack.pop_back();
 
       Internal("Regal::Ppca::PopClientAttrib GL_CLIENT_PIXEL_STORE_BIT ",ClientState::PixelStore::toString());
@@ -175,14 +176,14 @@
 
     // Pass the rest through, for now
 
-    if (ctx->info->core || ctx->info->es1 || ctx->info->es2)
+    if (ctx.isCore() || ctx.isES1() || ctx.isES2())
       return;
 
     if (mask)
-      ctx->dispatcher.emulation.glPopClientAttrib();
+      ctx.dispatcher.emulation.glPopClientAttrib();
   }
 
-  void glClientAttribDefaultEXT(RegalContext *ctx, GLbitfield mask)
+  void glClientAttribDefaultEXT(RegalContext &ctx, GLbitfield mask)
   {
     if (mask&GL_CLIENT_VERTEX_ARRAY_BIT)
     {
@@ -192,7 +193,7 @@
 
       // Ideally we'd only set the state that has changed - revisit
 
-      ClientState::VertexArray::set(ctx->dispatcher.emulation,driverAllowsVertexAttributeArraysWithoutBoundBuffer);
+      ClientState::VertexArray::set(ctx.dispatcher.emulation,driverAllowsVertexAttributeArraysWithoutBoundBuffer);
 
       mask &= ~GL_CLIENT_VERTEX_ARRAY_BIT;
     }
@@ -205,21 +206,21 @@
 
       // Ideally we'd only set the state that has changed - revisit
 
-      ClientState::PixelStore::set(ctx->dispatcher.emulation);
+      ClientState::PixelStore::set(ctx.dispatcher.emulation);
 
       mask &= ~GL_CLIENT_PIXEL_STORE_BIT;
     }
 
     // Pass the rest through, for now
 
-    if (ctx->info->core || ctx->info->es1 || ctx->info->es2)
+    if (ctx.isCore() || ctx.isES1() || ctx.isES2())
       return;
 
     if (mask)
-      ctx->dispatcher.emulation.glClientAttribDefaultEXT(mask);
+      ctx.dispatcher.emulation.glClientAttribDefaultEXT(mask);
   }
 
-  void glPushClientAttribDefaultEXT(RegalContext *ctx, GLbitfield mask)
+  void glPushClientAttribDefaultEXT(RegalContext &ctx, GLbitfield mask)
   {
     GLbitfield tmpMask = mask;
     glPushClientAttrib(ctx, tmpMask);
@@ -238,7 +239,7 @@
     ClientState::PixelStore::glDeleteBuffers(n,buffers);
   }
 
-  bool glGetv(RegalContext *ctx, GLenum pname, GLboolean *params)
+  bool glGetv(RegalContext &ctx, GLenum pname, GLboolean *params)
   {
     UNUSED_PARAMETER(ctx);
 
@@ -257,7 +258,7 @@
     return true;
   }
 
-  template <typename T> bool glGetv(RegalContext *ctx, GLenum pname, T *params)
+  template <typename T> bool glGetv(RegalContext &ctx, GLenum pname, T *params)
   {
     UNUSED_PARAMETER(ctx);
 
diff --git a/src/regal/RegalStatistics.cpp b/src/regal/RegalStatistics.cpp
index 9497e8a..e2e4318 100644
--- a/src/regal/RegalStatistics.cpp
+++ b/src/regal/RegalStatistics.cpp
@@ -440,6 +440,7 @@
   log("GL_NV_3DVISION_SETTINGS",gl_nv_3dvision_settings);
   log("GL_NV_BGR",gl_nv_bgr);
   log("GL_NV_BINDLESS_TEXTURE",gl_nv_bindless_texture);
+  log("GL_NV_BLEND_EQUATION_ADVANCED",gl_nv_blend_equation_advanced);
   log("GL_NV_BLEND_SQUARE",gl_nv_blend_square);
   log("GL_NV_COMPUTE_PROGRAM5",gl_nv_compute_program5);
   log("GL_NV_CONDITIONAL_RENDER",gl_nv_conditional_render);
@@ -3433,6 +3434,11 @@
   log("glUniformHandleui64NV",glUniformHandleui64NV);
   log("glUniformHandleui64vNV",glUniformHandleui64vNV);
 
+/* GL_NV_blend_equation_advanced */
+
+  log("glBlendBarrierNV",glBlendBarrierNV);
+  log("glBlendParameteriNV",glBlendParameteriNV);
+
 /* GL_NV_conditional_render */
 
   log("glBeginConditionalRenderNV",glBeginConditionalRenderNV);
diff --git a/src/regal/RegalStatistics.h b/src/regal/RegalStatistics.h
index 662ef08..f9d8c35 100644
--- a/src/regal/RegalStatistics.h
+++ b/src/regal/RegalStatistics.h
@@ -422,6 +422,7 @@
   GLuint gl_nv_3dvision_settings;
   GLuint gl_nv_bgr;
   GLuint gl_nv_bindless_texture;
+  GLuint gl_nv_blend_equation_advanced;
   GLuint gl_nv_blend_square;
   GLuint gl_nv_compute_program5;
   GLuint gl_nv_conditional_render;
@@ -3418,6 +3419,11 @@
   GLuint glUniformHandleui64NV;
   GLuint glUniformHandleui64vNV;
 
+  /* GL_NV_blend_equation_advanced */
+
+  GLuint glBlendBarrierNV;
+  GLuint glBlendParameteriNV;
+
   /* GL_NV_conditional_render */
 
   GLuint glBeginConditionalRenderNV;
diff --git a/src/regal/RegalSystem.h b/src/regal/RegalSystem.h
index 6fd149b..1135104 100644
--- a/src/regal/RegalSystem.h
+++ b/src/regal/RegalSystem.h
@@ -64,6 +64,9 @@
 #  ifndef REGAL_SYS_OSX
 #   define REGAL_SYS_OSX 1
 #  endif
+#  ifndef REGAL_SYS_GLX
+#   define REGAL_SYS_GLX 1
+#  endif
 # endif
 #elif defined(__native_client__)
 # ifndef REGAL_SYS_PPAPI
@@ -76,6 +79,9 @@
 # ifndef REGAL_SYS_EGL
 #  define REGAL_SYS_EGL 1
 # endif
+# ifndef REGAL_SYS_GLX
+#  define REGAL_SYS_GLX 1
+# endif
 #elif defined(EMSCRIPTEN)
 # ifndef REGAL_SYS_EMSCRIPTEN
 #  define REGAL_SYS_EMSCRIPTEN 1
@@ -87,13 +93,12 @@
 #  define REGAL_SYS_ES2 1
 # endif
 # ifndef REGAL_SYS_EMSCRIPTEN_STATIC
-#  define REGAL_SYS_EMSCRIPTEN_STATIC 0
+#  define REGAL_SYS_EMSCRIPTEN_STATIC 1
 # endif
 # if REGAL_SYS_EMSCRIPTEN_STATIC
-#  define REGAL_DRIVER 1
-#  define REGAL_NAMESPACE 1
-#  define REGAL_STATIC_ES2 1
-#  define REGAL_STATIC_EGL 1
+#  ifndef REGAL_NAMESPACE
+#   define REGAL_NAMESPACE 1
+#  endif
 # endif
 #elif !defined(REGAL_SYS_PPAPI) || !REGAL_SYS_PPAPI
 # ifndef REGAL_SYS_X11
@@ -144,6 +149,10 @@
 #define REGAL_SYS_EMSCRIPTEN 0
 #endif
 
+#ifndef REGAL_SYS_EMSCRIPTEN_STATIC
+#define REGAL_SYS_EMSCRIPTEN_STATIC 0
+#endif
+
 #ifndef REGAL_SYS_ES1
 #define REGAL_SYS_ES1 0
 #endif
diff --git a/src/regal/RegalToken.cpp b/src/regal/RegalToken.cpp
index 7301530..fd1e8f1 100644
--- a/src/regal/RegalToken.cpp
+++ b/src/regal/RegalToken.cpp
@@ -3336,6 +3336,52 @@
       case 0x00009277: return "GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2";
       case 0x00009278: return "GL_COMPRESSED_RGBA8_ETC2_EAC";
       case 0x00009279: return "GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC";
+      case 0x00009280: return "GL_BLEND_PREMULTIPLIED_SRC_NV";
+      case 0x00009281: return "GL_BLEND_OVERLAP_NV";
+      case 0x00009282: return "GL_UNCORRELATED_NV";
+      case 0x00009283: return "GL_DISJOINT_NV";
+      case 0x00009284: return "GL_CONJOINT_NV";
+      case 0x00009285: return "GL_BLEND_ADVANCED_COHERENT_NV";
+      case 0x00009286: return "GL_SRC_NV";
+      case 0x00009287: return "GL_DST_NV";
+      case 0x00009288: return "GL_SRC_OVER_NV";
+      case 0x00009289: return "GL_DST_OVER_NV";
+      case 0x0000928a: return "GL_SRC_IN_NV";
+      case 0x0000928b: return "GL_DST_IN_NV";
+      case 0x0000928c: return "GL_SRC_OUT_NV";
+      case 0x0000928d: return "GL_DST_OUT_NV";
+      case 0x0000928e: return "GL_SRC_ATOP_NV";
+      case 0x0000928f: return "GL_DST_ATOP_NV";
+      case 0x00009291: return "GL_PLUS_NV";
+      case 0x00009292: return "GL_PLUS_DARKER_NV";
+      case 0x00009294: return "GL_MULTIPLY_NV";
+      case 0x00009295: return "GL_SCREEN_NV";
+      case 0x00009296: return "GL_OVERLAY_NV";
+      case 0x00009297: return "GL_DARKEN_NV";
+      case 0x00009298: return "GL_LIGHTEN_NV";
+      case 0x00009299: return "GL_COLORDODGE_NV";
+      case 0x0000929a: return "GL_COLORBURN_NV";
+      case 0x0000929b: return "GL_HARDLIGHT_NV";
+      case 0x0000929c: return "GL_SOFTLIGHT_NV";
+      case 0x0000929e: return "GL_DIFFERENCE_NV";
+      case 0x0000929f: return "GL_MINUS_NV";
+      case 0x000092a0: return "GL_EXCLUSION_NV";
+      case 0x000092a1: return "GL_CONTRAST_NV";
+      case 0x000092a3: return "GL_INVERT_RGB_NV";
+      case 0x000092a4: return "GL_LINEARDODGE_NV";
+      case 0x000092a5: return "GL_LINEARBURN_NV";
+      case 0x000092a6: return "GL_VIVIDLIGHT_NV";
+      case 0x000092a7: return "GL_LINEARLIGHT_NV";
+      case 0x000092a8: return "GL_PINLIGHT_NV";
+      case 0x000092a9: return "GL_HARDMIX_NV";
+      case 0x000092ad: return "GL_HSL_HUE_NV";
+      case 0x000092ae: return "GL_HSL_SATURATION_NV";
+      case 0x000092af: return "GL_HSL_COLOR_NV";
+      case 0x000092b0: return "GL_HSL_LUMINOSITY_NV";
+      case 0x000092b1: return "GL_PLUS_CLAMPED_NV";
+      case 0x000092b2: return "GL_PLUS_CLAMPED_ALPHA_NV";
+      case 0x000092b3: return "GL_MINUS_CLAMPED_NV";
+      case 0x000092b4: return "GL_INVERT_OVG_NV";
       case 0x000092c0: return "GL_ATOMIC_COUNTER_BUFFER";
       case 0x000092c1: return "GL_ATOMIC_COUNTER_BUFFER_BINDING";
       case 0x000092c2: return "GL_ATOMIC_COUNTER_BUFFER_START";
diff --git a/src/regal/RegalUtil.h b/src/regal/RegalUtil.h
index 5026b3d..b4dcbe9 100644
--- a/src/regal/RegalUtil.h
+++ b/src/regal/RegalUtil.h
@@ -73,6 +73,38 @@
 #define REGAL_DECL_EXPORT 1
 #endif
 
+// Defaults for Emscripten static mode
+
+#if REGAL_SYS_EMSCRIPTEN_STATIC
+# ifndef REGAL_DRIVER
+#  define REGAL_DRIVER 1
+# endif
+# ifndef REGAL_NAMESPACE
+#  define REGAL_NAMESPACE 1
+# endif
+# ifndef REGAL_LOADER
+#  define REGAL_LOADER 0
+# endif
+# ifndef REGAL_MISSING
+#  define REGAL_MISSING 0
+# endif
+# ifndef REGAL_PLUGIN
+#  define REGAL_PLUGIN 0
+# endif
+# ifndef REGAL_TRACE
+#  define REGAL_TRACE 0
+# endif
+# ifndef REGAL_STATIC_ES2
+#  define REGAL_STATIC_ES2 1
+# endif
+# ifndef REGAL_STATIC_EGL
+#  define REGAL_STATIC_EGL 1
+# endif
+# ifndef REGAL_NO_GETENV
+#  define REGAL_NO_GETENV 1
+# endif
+#endif
+
 // Support for "plugin" dispatch or emulation layers by default.
 // Some features require this, otherwise: -DREGAL_PLUGIN=0
 
@@ -154,6 +186,18 @@
 #define REGAL_DRIVER 1
 #endif
 
+// Lazy loading of driver dispatch supported by default
+
+#ifndef REGAL_LOADER
+#define REGAL_LOADER 1
+#endif
+
+// Avoid crashing for missing driver functions by default
+
+#ifndef REGAL_MISSING
+#define REGAL_MISSING 1
+#endif
+
 #ifndef REGAL_LOG
 #define REGAL_LOG 1
 #endif
@@ -528,11 +572,30 @@
 #  define RegalAssert( foo ) if (!(foo)) ::REGAL_NAMESPACE_INTERNAL::AssertFunction( __FILE__ , __LINE__ , #foo);
 #endif
 
+//
+// RegalAssertArrayIndex
+//
+
+#if REGAL_NO_ASSERT
+#  define RegalAssertArrayIndex( array, index )
+#else
+#  define RegalAssertArrayIndex( array, index ) RegalAssert( static_cast<size_t>(index) < array_size(array) )
+#endif
+
 #if !REGAL_NO_ASSERT
 void AssertFunction(const char *file, const std::size_t line, const char *expr);
 #endif
 
 //
+// Array size - the number of elements of a C array
+//
+// http://stackoverflow.com/questions/437150/can-someone-explain-this-template-code-that-gives-me-the-size-of-an-array
+//
+
+template <typename T, size_t N>
+inline size_t array_size(const T (&)[N]) { return N; }
+
+//
 //
 //
 
diff --git a/src/regal/RegalX11.cpp b/src/regal/RegalX11.cpp
new file mode 100644
index 0000000..593e67e
--- /dev/null
+++ b/src/regal/RegalX11.cpp
@@ -0,0 +1,150 @@
+/*
+  Copyright (c) 2011-2013 NVIDIA Corporation
+  Copyright (c) 2011-2013 Cass Everitt
+  Copyright (c) 2012-2013 Scott Nations
+  Copyright (c) 2012-2013 Mathias Schott
+  Copyright (c) 2012-2013 Nigel Stewart
+  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.
+
+  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 HOLDER 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.
+*/
+
+/*
+
+ X11 emulation for Android, Windows and Mac
+ Nigel Stewart
+
+*/
+
+#include "pch.h" /* For MS precompiled header support */
+
+#include "RegalUtil.h"
+
+/* Only relevant if X11 isn't available: REGAL_X11==0 */
+
+#if REGAL_SYS_GLX && !REGAL_SYS_X11
+
+REGAL_GLOBAL_BEGIN
+
+#include <GL/Regal.h>
+
+#include <boost/print/interface.hpp>
+
+#include "RegalLog.h"
+#include "RegalInit.h"
+
+#define True  1
+#define False 0
+
+extern "C" {
+
+  ////////// libX11
+
+  REGAL_DECL int
+  DefaultScreen(Display *display)
+  {
+    ::REGAL_NAMESPACE_INTERNAL::Init::init();
+    Internal("Regal::DefaultScreen","display=",display);
+    return 1;
+  }
+
+  REGAL_DECL Window
+  RootWindow(Display *display, int screen_number)
+  {
+    ::REGAL_NAMESPACE_INTERNAL::Init::init();
+    Internal("Regal::RootWindow","display=",display," screen number=",screen_number);
+    return 1;
+  }
+
+  //////////
+
+  REGAL_DECL int
+  XMapWindow(Display *display, Window w)
+  {
+    ::REGAL_NAMESPACE_INTERNAL::Init::init();
+    Internal("Regal::XMapWindow","display=",display," w=",w);
+    return 1;
+  }
+
+  static Window dummyWindow = 0;
+
+  REGAL_DECL Window
+  XCreateWindow(Display *display, Window parent, int x, int y, unsigned int width, unsigned int height, unsigned int border_width, int depth, unsigned int clss, Visual *visual, unsigned long valuemask, XSetWindowAttributes *attributes)
+  {
+    ::REGAL_NAMESPACE_INTERNAL::Init::init();
+    Internal("Regal::XCreateWindow","display=",display," width=",width," height=",height);
+    return ++dummyWindow;
+  }
+
+  static Colormap dummyColormap = 0;
+  
+  REGAL_DECL Colormap 
+  XCreateColormap(Display *display, Window w, Visual *visual, int alloc)
+  {
+    ::REGAL_NAMESPACE_INTERNAL::Init::init();
+    Internal("Regal::XCreateColormap","display=",display);
+    return ++dummyColormap;
+  }
+
+  REGAL_DECL Display *
+  XOpenDisplay(char *display_name)
+  {
+    ::REGAL_NAMESPACE_INTERNAL::Init::init();
+    Internal("Regal::XOpenDisplay","display_name=",boost::print::optional(display_name,display_name));
+    return reinterpret_cast<Display *>(1);
+  }
+
+  REGAL_DECL int
+  XCloseDisplay(Display *display)
+  {
+    ::REGAL_NAMESPACE_INTERNAL::Init::init();
+    Internal("Regal::XCloseDisplay","display=",display);
+    return True;
+  }
+
+  static Pixmap dummyPixmap = 0;
+
+  REGAL_DECL Pixmap
+  XCreatePixmap(Display *display, Drawable d, unsigned int width, unsigned int height, unsigned int depth)
+  {
+    ::REGAL_NAMESPACE_INTERNAL::Init::init();
+    Internal("Regal::XCreatePixmap","display=",display," width=",width," height=",height);
+    return ++dummyPixmap;
+  }
+
+  REGAL_DECL int
+  XFreePixmap(Display *display, Pixmap pixmap)
+  {
+    ::REGAL_NAMESPACE_INTERNAL::Init::init();
+    Internal("Regal::XFreePixmap","display=",display," pixmap=",pixmap);
+    return True;
+  }
+
+} // extern "C" 
+
+REGAL_GLOBAL_END
+
+REGAL_NAMESPACE_BEGIN
+
+REGAL_NAMESPACE_END
+
+#endif // REGAL_SYS_GLX && !REGAL_SYS_X11
diff --git a/src/regal/Regalm.def b/src/regal/Regalm.def
index 949e1e4..57c7b31 100644
--- a/src/regal/Regalm.def
+++ b/src/regal/Regalm.def
@@ -104,6 +104,7 @@
   rglBinormal3svEXT
   rglBinormalPointerEXT
   rglBitmap
+  rglBlendBarrierNV
   rglBlendColor
   rglBlendColorEXT
   rglBlendEquation
@@ -129,6 +130,7 @@
   rglBlendFuncSeparateiARB
   rglBlendFunci
   rglBlendFunciARB
+  rglBlendParameteriNV
   rglBlitFramebuffer
   rglBlitFramebufferANGLE
   rglBlitFramebufferEXT
diff --git a/src/regal/export_list_mac.txt b/src/regal/export_list_mac.txt
index 88e6e9d..9b79103 100644
--- a/src/regal/export_list_mac.txt
+++ b/src/regal/export_list_mac.txt
@@ -155,6 +155,7 @@
 _glBinormal3svEXT
 _glBinormalPointerEXT
 _glBitmap
+_glBlendBarrierNV
 _glBlendColor
 _glBlendColorEXT
 _glBlendEquation
@@ -180,6 +181,7 @@
 _glBlendFuncSeparateiARB
 _glBlendFunci
 _glBlendFunciARB
+_glBlendParameteriNV
 _glBlitFramebuffer
 _glBlitFramebufferANGLE
 _glBlitFramebufferEXT
diff --git a/tests/testRegalPpca.cpp b/tests/testRegalPpca.cpp
index 0cb6f78..e96a0e8 100644
--- a/tests/testRegalPpca.cpp
+++ b/tests/testRegalPpca.cpp
@@ -139,7 +139,7 @@
 void checkPpcaDefaults(RegalContext& ctx, Ppca& ppca)
 {
   GLint clientAttribStackDepth = 666;
-  EXPECT_EQ( GLboolean( GL_TRUE ), ppca.glGetv(&ctx, GL_CLIENT_ATTRIB_STACK_DEPTH, &clientAttribStackDepth));
+  EXPECT_EQ( GLboolean( GL_TRUE ), ppca.glGetv(ctx, GL_CLIENT_ATTRIB_STACK_DEPTH, &clientAttribStackDepth));
   EXPECT_EQ( clientAttribStackDepth, GLint(0) );
 
   EXPECT_EQ( std::vector<GLbitfield>::size_type(0),               ppca.maskStack.size() );
@@ -162,20 +162,21 @@
   InitDispatchTableGMock( ctx.dispatcher.emulation );
 
   Ppca ppca;
+  ppca.Init(ctx);
   checkPpcaDefaults(ctx, ppca);
 
   GLint maxClientAttribStackDepth = 0;
-  EXPECT_EQ( GLboolean( GL_TRUE ), ppca.glGetv( &ctx, GL_MAX_CLIENT_ATTRIB_STACK_DEPTH, &maxClientAttribStackDepth ) );
+  EXPECT_EQ( GLboolean( GL_TRUE ), ppca.glGetv( ctx, GL_MAX_CLIENT_ATTRIB_STACK_DEPTH, &maxClientAttribStackDepth ) );
   EXPECT_GE( maxClientAttribStackDepth, GLint(16) );
 
   const GLbitfield remainder = ~( GL_CLIENT_PIXEL_STORE_BIT | GL_CLIENT_VERTEX_ARRAY_BIT );
   EXPECT_CALL( mock, glPushClientAttrib( remainder ) );
 
-  ppca.glPushClientAttrib( &ctx, GL_CLIENT_ALL_ATTRIB_BITS );
+  ppca.glPushClientAttrib( ctx, GL_CLIENT_ALL_ATTRIB_BITS );
   Mock::VerifyAndClear( &mock );
 
   GLint clientAttribStackDepth = 666;
-  EXPECT_EQ( GLboolean( GL_TRUE ), ppca.glGetv(&ctx, GL_CLIENT_ATTRIB_STACK_DEPTH, &clientAttribStackDepth));
+  EXPECT_EQ( GLboolean( GL_TRUE ), ppca.glGetv(ctx, GL_CLIENT_ATTRIB_STACK_DEPTH, &clientAttribStackDepth));
   EXPECT_EQ( GLint(1), clientAttribStackDepth );
 
   EXPECT_EQ( std::vector<GLbitfield>::size_type(1),               ppca.maskStack.size() );
@@ -192,6 +193,7 @@
   ctx.info = new ContextInfo();
 
   Ppca ppca;
+  ppca.Init(ctx);
   checkPpcaDefaults(ctx, ppca);
 
   ppca.VertexArray::elementArrayBufferBinding = GLuint(6);
@@ -242,6 +244,7 @@
   ctx.info = new ContextInfo();
 
   Ppca ppca;
+  ppca.Init(ctx);
   checkPpcaDefaults(ctx, ppca);
 
   ppca.PixelStore::unpackSwapBytes = GL_TRUE;
@@ -428,19 +431,20 @@
   InitDispatchTableGMock( ctx.dispatcher.emulation );
 
   Ppca ppca;
+  ppca.Init(ctx);
   checkPpcaDefaults(ctx, ppca);
 
   EXPECT_EQ( GLint(4), ppca.PixelStore::unpackAlignment );
   EXPECT_EQ( std::vector<ClientState::PixelStore>::size_type(0),  ppca.pixelStoreStack.size() );
 
   ppca.glPixelStore( GL_UNPACK_ALIGNMENT, 100 );
-  ppca.glPushClientAttrib( &ctx, 0 );
+  ppca.glPushClientAttrib( ctx, 0 );
 
   EXPECT_EQ( GLint(100), ppca.PixelStore::unpackAlignment );
   EXPECT_EQ( std::vector<ClientState::PixelStore>::size_type(0),  ppca.pixelStoreStack.size() );
 
   ppca.glPixelStore( GL_UNPACK_ALIGNMENT, 101 );
-  ppca.glPushClientAttrib( &ctx, GL_CLIENT_PIXEL_STORE_BIT );
+  ppca.glPushClientAttrib( ctx, GL_CLIENT_PIXEL_STORE_BIT );
 
   EXPECT_EQ( GLint(101), ppca.PixelStore::unpackAlignment );
   EXPECT_EQ( std::vector<ClientState::PixelStore>::size_type(1),  ppca.pixelStoreStack.size() );
@@ -470,7 +474,7 @@
   EXPECT_CALL( mock, glVertexBindingDivisor(_,_) ).Times(AnyNumber());
   EXPECT_CALL( mock, glVertexPointer(_,_,_,_) ).Times(AnyNumber());
 
-  ppca.glClientAttribDefaultEXT( &ctx, GL_CLIENT_PIXEL_STORE_BIT );
+  ppca.glClientAttribDefaultEXT( ctx, GL_CLIENT_PIXEL_STORE_BIT );
 
   Mock::VerifyAndClear( &mock );
 
@@ -506,7 +510,7 @@
   EXPECT_CALL( mock, glVertexBindingDivisor(_,_) ).Times(AnyNumber());
   EXPECT_CALL( mock, glVertexPointer(_,_,_,_) ).Times(AnyNumber());
 
-  ppca.glPushClientAttribDefaultEXT( &ctx, GL_CLIENT_PIXEL_STORE_BIT );
+  ppca.glPushClientAttribDefaultEXT( ctx, GL_CLIENT_PIXEL_STORE_BIT );
 
   Mock::VerifyAndClear( &mock );
 
@@ -538,7 +542,7 @@
   EXPECT_CALL( mock, glVertexBindingDivisor(_,_) ).Times(AnyNumber());
   EXPECT_CALL( mock, glVertexPointer(_,_,_,_) ).Times(AnyNumber());
 
-  ppca.glPopClientAttrib( &ctx );
+  ppca.glPopClientAttrib( ctx );
 
   Mock::VerifyAndClear( &mock );
 
@@ -570,7 +574,7 @@
   EXPECT_CALL( mock, glVertexBindingDivisor(_,_) ).Times(AnyNumber());
   EXPECT_CALL( mock, glVertexPointer(_,_,_,_) ).Times(AnyNumber());
 
-  ppca.glPopClientAttrib( &ctx );
+  ppca.glPopClientAttrib( ctx );
 
   Mock::VerifyAndClear( &mock );
 
@@ -602,7 +606,7 @@
   EXPECT_CALL( mock, glVertexBindingDivisor(_,_) ).Times(AnyNumber());
   EXPECT_CALL( mock, glVertexPointer(_,_,_,_) ).Times(AnyNumber());
 
-  ppca.glPopClientAttrib( &ctx );
+  ppca.glPopClientAttrib( ctx );
 
   Mock::VerifyAndClear( &mock );
 
@@ -634,7 +638,7 @@
   EXPECT_CALL( mock, glVertexBindingDivisor(_,_) ).Times(AnyNumber());
   EXPECT_CALL( mock, glVertexPointer(_,_,_,_) ).Times(AnyNumber());
 
-  ppca.glPopClientAttrib( &ctx );
+  ppca.glPopClientAttrib( ctx );
   Mock::VerifyAndClear( &mock );
 
   EXPECT_EQ( GLint(101), ppca.PixelStore::unpackAlignment );
@@ -651,19 +655,20 @@
   InitDispatchTableGMock( ctx.dispatcher.emulation );
 
   Ppca ppca;
+  ppca.Init(ctx);
   checkPpcaDefaults(ctx, ppca);
 
   EXPECT_EQ( GLint( 0 ), ppca.VertexArray::named[ ClientState::COLOR ].stride );
   EXPECT_EQ( std::vector<ClientState::VertexArray>::size_type(0), ppca.vertexArrayStack.size() );
 
   ppca.glColorPointer ( 4, GL_FLOAT, 100, NULL );
-  ppca.glPushClientAttrib( &ctx, 0 );
+  ppca.glPushClientAttrib( ctx, 0 );
 
   EXPECT_EQ( GLint( 100 ), ppca.VertexArray::named[ ClientState::COLOR ].stride );
   EXPECT_EQ( std::vector<ClientState::VertexArray>::size_type(0), ppca.vertexArrayStack.size() );
 
   ppca.glColorPointer ( 4, GL_FLOAT, 101, NULL );
-  ppca.glPushClientAttrib( &ctx, GL_CLIENT_VERTEX_ARRAY_BIT );
+  ppca.glPushClientAttrib( ctx, GL_CLIENT_VERTEX_ARRAY_BIT );
 
   EXPECT_EQ( GLint( 101 ), ppca.VertexArray::named[ ClientState::COLOR ].stride );
   EXPECT_EQ( std::vector<ClientState::VertexArray>::size_type(1), ppca.vertexArrayStack.size() );
@@ -695,7 +700,7 @@
   EXPECT_CALL( mock, glVertexBindingDivisor(_,_) ).Times(AnyNumber());
   EXPECT_CALL( mock, glVertexPointer(_,_,_,_) ).Times(AnyNumber());
 
-  ppca.glClientAttribDefaultEXT( &ctx, GL_CLIENT_VERTEX_ARRAY_BIT );
+  ppca.glClientAttribDefaultEXT( ctx, GL_CLIENT_VERTEX_ARRAY_BIT );
 
   Mock::VerifyAndClear( &mock );
 
@@ -731,7 +736,7 @@
   EXPECT_CALL( mock, glVertexBindingDivisor(_,_) ).Times(AnyNumber());
   EXPECT_CALL( mock, glVertexPointer(_,_,_,_) ).Times(AnyNumber());
 
-  ppca.glPushClientAttribDefaultEXT( &ctx, GL_CLIENT_VERTEX_ARRAY_BIT );
+  ppca.glPushClientAttribDefaultEXT( ctx, GL_CLIENT_VERTEX_ARRAY_BIT );
 
   Mock::VerifyAndClear( &mock );
 
@@ -765,7 +770,7 @@
   EXPECT_CALL( mock, glVertexBindingDivisor(_,_) ).Times(AnyNumber());
   EXPECT_CALL( mock, glVertexPointer(_,_,_,_) ).Times(AnyNumber());
 
-  ppca.glPopClientAttrib( &ctx );
+  ppca.glPopClientAttrib( ctx );
 
   Mock::VerifyAndClear( &mock );
 
@@ -799,21 +804,21 @@
   EXPECT_CALL( mock, glVertexBindingDivisor(_,_) ).Times(AnyNumber());
   EXPECT_CALL( mock, glVertexPointer(_,_,_,_) ).Times(AnyNumber());
 
-  ppca.glPopClientAttrib( &ctx );
+  ppca.glPopClientAttrib( ctx );
 
   Mock::VerifyAndClear( &mock );
 
   EXPECT_EQ( GLint( 101 ), ppca.VertexArray::named[ ClientState::COLOR ].stride );
   EXPECT_EQ( std::vector<ClientState::VertexArray>::size_type(0), ppca.vertexArrayStack.size() );
 
-  ppca.glPopClientAttrib( &ctx );
+  ppca.glPopClientAttrib( ctx );
 
   Mock::VerifyAndClear( &mock );
 
   EXPECT_EQ( GLint( 101 ), ppca.VertexArray::named[ ClientState::COLOR ].stride );
   EXPECT_EQ( std::vector<ClientState::VertexArray>::size_type(0), ppca.vertexArrayStack.size() );
 
-  ppca.glPopClientAttrib( &ctx );
+  ppca.glPopClientAttrib( ctx );
 
   Mock::VerifyAndClear( &mock );
 
@@ -833,30 +838,31 @@
   InitDispatchTableGMock( ctx.dispatcher.emulation );
 
   Ppca ppca;
+  ppca.Init(ctx);
   checkPpcaDefaults(ctx, ppca);
 
   const GLbitfield remainder = ~( GL_CLIENT_PIXEL_STORE_BIT | GL_CLIENT_VERTEX_ARRAY_BIT );
 
   GLint clientAttribStackDepth = 666;
-  EXPECT_EQ( GLboolean( GL_TRUE ), ppca.glGetv(&ctx, GL_CLIENT_ATTRIB_STACK_DEPTH, &clientAttribStackDepth));
+  EXPECT_EQ( GLboolean( GL_TRUE ), ppca.glGetv(ctx, GL_CLIENT_ATTRIB_STACK_DEPTH, &clientAttribStackDepth));
   EXPECT_EQ( clientAttribStackDepth, GLint(0) );
 
   EXPECT_EQ( std::vector<GLbitfield>::size_type(0),               ppca.maskStack.size() );
   EXPECT_EQ( std::vector<ClientState::VertexArray>::size_type(0), ppca.vertexArrayStack.size() );
   EXPECT_EQ( std::vector<ClientState::PixelStore>::size_type(0),  ppca.pixelStoreStack.size() );
 
-  ppca.glPushClientAttrib( &ctx, GL_CLIENT_PIXEL_STORE_BIT );
+  ppca.glPushClientAttrib( ctx, GL_CLIENT_PIXEL_STORE_BIT );
 
-  EXPECT_EQ( GLboolean( GL_TRUE ), ppca.glGetv(&ctx, GL_CLIENT_ATTRIB_STACK_DEPTH, &clientAttribStackDepth));
+  EXPECT_EQ( GLboolean( GL_TRUE ), ppca.glGetv(ctx, GL_CLIENT_ATTRIB_STACK_DEPTH, &clientAttribStackDepth));
   EXPECT_EQ( clientAttribStackDepth, GLint(1) );
 
   EXPECT_EQ( std::vector<GLbitfield>::size_type(1),               ppca.maskStack.size() );
   EXPECT_EQ( std::vector<ClientState::VertexArray>::size_type(0), ppca.vertexArrayStack.size() );
   EXPECT_EQ( std::vector<ClientState::PixelStore>::size_type(1),  ppca.pixelStoreStack.size() );
 
-  ppca.glPushClientAttrib( &ctx, GL_CLIENT_VERTEX_ARRAY_BIT );
+  ppca.glPushClientAttrib( ctx, GL_CLIENT_VERTEX_ARRAY_BIT );
 
-  EXPECT_EQ( GLboolean( GL_TRUE ), ppca.glGetv(&ctx, GL_CLIENT_ATTRIB_STACK_DEPTH, &clientAttribStackDepth));
+  EXPECT_EQ( GLboolean( GL_TRUE ), ppca.glGetv(ctx, GL_CLIENT_ATTRIB_STACK_DEPTH, &clientAttribStackDepth));
   EXPECT_EQ( clientAttribStackDepth, GLint(2) );
 
   EXPECT_EQ( std::vector<GLbitfield>::size_type(2),               ppca.maskStack.size() );
@@ -865,10 +871,10 @@
 
   EXPECT_CALL( mock, glPushClientAttrib( remainder ) );
 
-  ppca.glPushClientAttrib( &ctx, GL_CLIENT_ALL_ATTRIB_BITS );
+  ppca.glPushClientAttrib( ctx, GL_CLIENT_ALL_ATTRIB_BITS );
   Mock::VerifyAndClear( &mock );
 
-  EXPECT_EQ( GLboolean( GL_TRUE ), ppca.glGetv(&ctx, GL_CLIENT_ATTRIB_STACK_DEPTH, &clientAttribStackDepth));
+  EXPECT_EQ( GLboolean( GL_TRUE ), ppca.glGetv(ctx, GL_CLIENT_ATTRIB_STACK_DEPTH, &clientAttribStackDepth));
   EXPECT_EQ( clientAttribStackDepth, GLint(3) );
 
   EXPECT_EQ( std::vector<GLbitfield>::size_type(3),               ppca.maskStack.size() );
@@ -903,12 +909,12 @@
   EXPECT_CALL( mock, glVertexPointer(_,_,_,_) ).Times(AnyNumber());
 
   ctx.info->es2 = true;
-  ppca.glPushClientAttrib( &ctx, GL_CLIENT_ALL_ATTRIB_BITS );
-  ppca.glPopClientAttrib( &ctx );
+  ppca.glPushClientAttrib( ctx, GL_CLIENT_ALL_ATTRIB_BITS );
+  ppca.glPopClientAttrib( ctx );
   ctx.info->es2 = false;
   Mock::VerifyAndClear( &mock );
 
-  EXPECT_EQ( GLboolean( GL_TRUE ), ppca.glGetv(&ctx, GL_CLIENT_ATTRIB_STACK_DEPTH, &clientAttribStackDepth));
+  EXPECT_EQ( GLboolean( GL_TRUE ), ppca.glGetv(ctx, GL_CLIENT_ATTRIB_STACK_DEPTH, &clientAttribStackDepth));
   EXPECT_EQ( clientAttribStackDepth, GLint(3) );
 
   EXPECT_EQ( std::vector<GLbitfield>::size_type(3),               ppca.maskStack.size() );
@@ -971,10 +977,10 @@
   EXPECT_CALL( mock, glVertexBindingDivisor(_,_) ).Times(AnyNumber());
   EXPECT_CALL( mock, glVertexPointer(_,_,_,_) ).Times(AnyNumber());
 
-  ppca.glPopClientAttrib( &ctx );
+  ppca.glPopClientAttrib( ctx );
   Mock::VerifyAndClear( &mock );
 
-  EXPECT_EQ( GLboolean( GL_TRUE ), ppca.glGetv(&ctx, GL_CLIENT_ATTRIB_STACK_DEPTH, &clientAttribStackDepth));
+  EXPECT_EQ( GLboolean( GL_TRUE ), ppca.glGetv(ctx, GL_CLIENT_ATTRIB_STACK_DEPTH, &clientAttribStackDepth));
   EXPECT_EQ( clientAttribStackDepth, GLint(2) );
 
   EXPECT_EQ( std::vector<GLbitfield>::size_type(2),               ppca.maskStack.size() );
@@ -1008,10 +1014,10 @@
   EXPECT_CALL( mock, glVertexBindingDivisor(_,_) ).Times(AnyNumber());
   EXPECT_CALL( mock, glVertexPointer(_,_,_,_) ).Times(AnyNumber());
 
-  ppca.glPopClientAttrib( &ctx );
+  ppca.glPopClientAttrib( ctx );
   Mock::VerifyAndClear( &mock );
 
-  EXPECT_EQ( GLboolean( GL_TRUE ), ppca.glGetv(&ctx, GL_CLIENT_ATTRIB_STACK_DEPTH, &clientAttribStackDepth));
+  EXPECT_EQ( GLboolean( GL_TRUE ), ppca.glGetv(ctx, GL_CLIENT_ATTRIB_STACK_DEPTH, &clientAttribStackDepth));
   EXPECT_EQ( clientAttribStackDepth, GLint(1) );
 
   EXPECT_EQ( std::vector<GLbitfield>::size_type(1),               ppca.maskStack.size() );
@@ -1045,10 +1051,10 @@
   EXPECT_CALL( mock, glVertexBindingDivisor(_,_) ).Times(AnyNumber());
   EXPECT_CALL( mock, glVertexPointer(_,_,_,_) ).Times(AnyNumber());
 
-  ppca.glPopClientAttrib( &ctx );
+  ppca.glPopClientAttrib( ctx );
   Mock::VerifyAndClear( &mock );
 
-  EXPECT_EQ( GLboolean( GL_TRUE ), ppca.glGetv(&ctx, GL_CLIENT_ATTRIB_STACK_DEPTH, &clientAttribStackDepth));
+  EXPECT_EQ( GLboolean( GL_TRUE ), ppca.glGetv(ctx, GL_CLIENT_ATTRIB_STACK_DEPTH, &clientAttribStackDepth));
   EXPECT_EQ( clientAttribStackDepth, GLint(0) );
 
   EXPECT_EQ( std::vector<GLbitfield>::size_type(0),               ppca.maskStack.size() );
@@ -1083,7 +1089,7 @@
   EXPECT_CALL( mock, glVertexBindingDivisor(_,_) ).Times(AnyNumber());
   EXPECT_CALL( mock, glVertexPointer(_,_,_,_) ).Times(AnyNumber());
 
-  ppca.glClientAttribDefaultEXT( &ctx, GL_CLIENT_ALL_ATTRIB_BITS );
+  ppca.glClientAttribDefaultEXT( ctx, GL_CLIENT_ALL_ATTRIB_BITS );
 
   Mock::VerifyAndClear( &mock );
 
@@ -1120,7 +1126,7 @@
   EXPECT_CALL( mock, glVertexBindingDivisor(_,_) ).Times(AnyNumber());
   EXPECT_CALL( mock, glVertexPointer(_,_,_,_) ).Times(AnyNumber());
 
-  ppca.glPushClientAttribDefaultEXT( &ctx, GL_CLIENT_ALL_ATTRIB_BITS );
+  ppca.glPushClientAttribDefaultEXT( ctx, GL_CLIENT_ALL_ATTRIB_BITS );
 
   Mock::VerifyAndClear( &mock );
 
@@ -1608,6 +1614,7 @@
   ctx.info = new ContextInfo();
 
   Ppca ppca;
+  ppca.Init(ctx);
   checkPpcaDefaults(ctx, ppca);
 
   // VertexAttribFormat
@@ -1920,6 +1927,7 @@
   ctx.info = new ContextInfo();
 
   Ppca ppca;
+  ppca.Init(ctx);
   checkPpcaDefaults(ctx, ppca);
 
   ppca.glEnableClientState( GL_COLOR_ARRAY );
@@ -2084,6 +2092,7 @@
   ctx.info = new ContextInfo();
 
   Ppca ppca;
+  ppca.Init(ctx);
   checkPpcaDefaults(ctx, ppca);
 
   GLuint buffers[ 2 ] = { 0, 123 };
@@ -2128,6 +2137,7 @@
   ctx.info = new ContextInfo();
 
   Ppca ppca;
+  ppca.Init(ctx);
   checkPpcaDefaults(ctx, ppca);
 
   GLuint buffers[ 2 ] = { 0, 123 };
@@ -2151,6 +2161,7 @@
   ctx.info = new ContextInfo();
 
   Ppca ppca;
+  ppca.Init(ctx);
   checkPpcaDefaults(ctx, ppca);
 
   EXPECT_EQ( GLboolean(GL_FALSE), ppca.primitiveRestart );
@@ -2274,6 +2285,7 @@
   ctx.info = new ContextInfo();
 
   Ppca ppca;
+  ppca.Init(ctx);
   checkPpcaDefaults(ctx, ppca);
 
   // Do a comprehensive test on all settings for GL_T4F_C4F_N3F_V4F
@@ -2802,6 +2814,7 @@
   ctx.info = new ContextInfo();
 
   Ppca ppca;
+  ppca.Init(ctx);
   checkPpcaDefaults(ctx, ppca);
 
   GLint resulti[ 1 ] = { 123 };
@@ -2812,36 +2825,36 @@
 
   // First ensure getting an unimplemented value works (does nothing).
 
-  EXPECT_EQ( GLboolean( GL_FALSE ), ppca.glGetv( &ctx, GL_FLOAT, resulti ) );
+  EXPECT_EQ( GLboolean( GL_FALSE ), ppca.glGetv( ctx, GL_FLOAT, resulti ) );
   EXPECT_EQ( 123, resulti[ 0 ] );
 
-  EXPECT_EQ( GLboolean( GL_FALSE ), ppca.glGetv( &ctx, GL_FLOAT, resulti64 ) );
+  EXPECT_EQ( GLboolean( GL_FALSE ), ppca.glGetv( ctx, GL_FLOAT, resulti64 ) );
   EXPECT_EQ( 123, resulti64[ 0 ] );
 
-  EXPECT_EQ( GLboolean( GL_FALSE ), ppca.glGetv( &ctx, GL_FLOAT, resultf ) );
+  EXPECT_EQ( GLboolean( GL_FALSE ), ppca.glGetv( ctx, GL_FLOAT, resultf ) );
   EXPECT_EQ( 123, resultf[ 0 ] );
 
-  EXPECT_EQ( GLboolean( GL_FALSE ), ppca.glGetv( &ctx, GL_FLOAT, resultd ) );
+  EXPECT_EQ( GLboolean( GL_FALSE ), ppca.glGetv( ctx, GL_FLOAT, resultd ) );
   EXPECT_EQ( 123, resultd[ 0 ] );
 
-  EXPECT_EQ( GLboolean( GL_FALSE ), ppca.glGetv( &ctx, GL_FLOAT, resultb ) );
+  EXPECT_EQ( GLboolean( GL_FALSE ), ppca.glGetv( ctx, GL_FLOAT, resultb ) );
   EXPECT_EQ( GLboolean(GL_FALSE), resultb[ 0 ] );
 
   // Next verify that getting an implemented value gets the value.
 
-  EXPECT_EQ( GLboolean( GL_TRUE ), ppca.glGetv( &ctx, GL_MAX_CLIENT_ATTRIB_STACK_DEPTH, resulti ) );
+  EXPECT_EQ( GLboolean( GL_TRUE ), ppca.glGetv( ctx, GL_MAX_CLIENT_ATTRIB_STACK_DEPTH, resulti ) );
   EXPECT_EQ( REGAL_EMU_MAX_CLIENT_ATTRIB_STACK_DEPTH, resulti[ 0 ] );
 
-  EXPECT_EQ( GLboolean( GL_TRUE ), ppca.glGetv( &ctx, GL_MAX_CLIENT_ATTRIB_STACK_DEPTH, resulti64 ) );
+  EXPECT_EQ( GLboolean( GL_TRUE ), ppca.glGetv( ctx, GL_MAX_CLIENT_ATTRIB_STACK_DEPTH, resulti64 ) );
   EXPECT_EQ( REGAL_EMU_MAX_CLIENT_ATTRIB_STACK_DEPTH, resulti64[ 0 ] );
 
-  EXPECT_EQ( GLboolean( GL_TRUE ), ppca.glGetv( &ctx, GL_MAX_CLIENT_ATTRIB_STACK_DEPTH, resultf ) );
+  EXPECT_EQ( GLboolean( GL_TRUE ), ppca.glGetv( ctx, GL_MAX_CLIENT_ATTRIB_STACK_DEPTH, resultf ) );
   EXPECT_EQ( REGAL_EMU_MAX_CLIENT_ATTRIB_STACK_DEPTH, resultf[ 0 ] );
 
-  EXPECT_EQ( GLboolean( GL_TRUE ), ppca.glGetv( &ctx, GL_MAX_CLIENT_ATTRIB_STACK_DEPTH, resultd ) );
+  EXPECT_EQ( GLboolean( GL_TRUE ), ppca.glGetv( ctx, GL_MAX_CLIENT_ATTRIB_STACK_DEPTH, resultd ) );
   EXPECT_EQ( REGAL_EMU_MAX_CLIENT_ATTRIB_STACK_DEPTH, resultd[ 0 ] );
 
-  EXPECT_EQ( GLboolean( GL_TRUE ), ppca.glGetv( &ctx, GL_MAX_CLIENT_ATTRIB_STACK_DEPTH, resultb ) );
+  EXPECT_EQ( GLboolean( GL_TRUE ), ppca.glGetv( ctx, GL_MAX_CLIENT_ATTRIB_STACK_DEPTH, resultb ) );
   EXPECT_EQ( GLboolean(GL_TRUE), resultb[ 0 ] );
 }
 
@@ -2851,6 +2864,7 @@
   ctx.info = new ContextInfo();
 
   Ppca ppca;
+  ppca.Init(ctx);
   checkPpcaDefaults(ctx, ppca);
 
   // first test glPixelStorei
@@ -2948,6 +2962,7 @@
   ctx.info = new ContextInfo();
 
   Ppca ppca;
+  ppca.Init(ctx);
   checkPpcaDefaults(ctx, ppca);
 
   ppca.VertexArray::arrayBufferBinding = 0;
@@ -3046,6 +3061,7 @@
   ctx.info = new ContextInfo();
 
   Ppca ppca;
+  ppca.Init(ctx);
   checkPpcaDefaults(ctx, ppca);
 
   for (GLuint ii=0; ii<(REGAL_EMU_MAX_TEXTURE_COORDS * 2); ii++)
@@ -3090,6 +3106,7 @@
   ctx.info = new ContextInfo();
 
   Ppca ppca;
+  ppca.Init(ctx);
   checkPpcaDefaults(ctx, ppca);
 
   // test glEnableClientState & glDisableClientState with no vertex array bound
@@ -3311,6 +3328,7 @@
   ctx.info = new ContextInfo();
 
   Ppca ppca;
+  ppca.Init(ctx);
   checkPpcaDefaults(ctx, ppca);
 
   ppca.glBindVertexArray( GLuint(13579) );
@@ -3326,6 +3344,7 @@
   ctx.info = new ContextInfo();
 
   Ppca ppca;
+  ppca.Init(ctx);
   checkPpcaDefaults(ctx, ppca);
 
   // test glEnableVertexAttribArray & glDisableVertexAttribArray with no vertex array bound
@@ -3375,6 +3394,7 @@
   ctx.info = new ContextInfo();
 
   Ppca ppca;
+  ppca.Init(ctx);
   checkPpcaDefaults(ctx, ppca);
 
   // test glEnableVertexArrayAttribEXT & glDisableVertexArrayAttribEXT with no vertex array bound
@@ -3419,6 +3439,7 @@
   ctx.info = new ContextInfo();
 
   Ppca ppca;
+  ppca.Init(ctx);
   checkPpcaDefaults(ctx, ppca);
 
   // test glEnableVertexArrayEXT & glDisableVertexArrayEXT with no vertex array object
@@ -3497,6 +3518,7 @@
   ctx.info = new ContextInfo();
 
   Ppca ppca;
+  ppca.Init(ctx);
   checkPpcaDefaults(ctx, ppca);
 
   // test glVertexAttribBinding with no vertex array bound
@@ -3536,6 +3558,7 @@
   ctx.info = new ContextInfo();
 
   Ppca ppca;
+  ppca.Init(ctx);
   checkPpcaDefaults(ctx, ppca);
 
   // test glVertexBindingDivisor with no vertex array bound
@@ -3632,6 +3655,7 @@
   ctx.info = new ContextInfo();
 
   Ppca ppca;
+  ppca.Init(ctx);
   checkPpcaDefaults(ctx, ppca);
 
   // test glBindVertexBuffer with no vertex array bound
@@ -3685,6 +3709,7 @@
   ctx.info = new ContextInfo();
 
   Ppca ppca;
+  ppca.Init(ctx);
   checkPpcaDefaults(ctx, ppca);
 
   GLuint    buffers[REGAL_EMU_MAX_VERTEX_ATTRIB_BINDINGS];
@@ -4129,6 +4154,7 @@
   ctx.info = new ContextInfo();
 
   Ppca ppca;
+  ppca.Init(ctx);
   checkPpcaDefaults(ctx, ppca);
 
   // test glVertexAttrib(I|L|)Format with no vertex array bound
@@ -4331,6 +4357,7 @@
   ctx.info = new ContextInfo();
 
   Ppca ppca;
+  ppca.Init(ctx);
   checkPpcaDefaults(ctx, ppca);
 
   // test glVertexAttrib(I|L|)Pointer with no vertex array bound
@@ -4577,6 +4604,7 @@
   ctx.info = new ContextInfo();
 
   Ppca ppca;
+  ppca.Init(ctx);
   checkPpcaDefaults(ctx, ppca);
 
   // test glVertexArrayVertexAttrib(I|)OffsetEXT with no vertex array bound