Commits

yotis  committed 90ccd55

Fixed windows build

  • Participants
  • Parent commits 4ad0da4

Comments (0)

Files changed (6)

File generator/glxx.py

         #define WINAPI __stdcall
         #define APIENTRY WINAPI
     #endif
+    #define APIENTRYP APIENTRY *
 #endif
 
 

File generator/include_proto/glxx/gl_4_2_compatibility.h

 #define GLXX_4_2_COMPATIBILITY
 
 #include "gl_4_1_compatibility.h"
+#include "private/gl_version_4_2.h"
 
 namespace gl_4_2_compatibility
 {

File generator/wglxx.py

 #include <Windows.h>
 
 #include <wglxx/private/wglxx.h>
+#include <wglxx/wglxx_all.h>
 #include <cassert>
 #include <string>
 #include <sstream>

File src/glXxx.cpp

-/*
+/*
  * The glxx OpenGL extension loading library
  * Copyright (C) 2011, Giotis Nikos <giotis.nikos[]gmail.com>
  * All rights reserved.
  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 
  * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 
  * IN THE SOFTWARE.
- */
-
-// Comment the following line to disable thread local storage
-#define GLXX_TLS 
-
-#ifdef __linux__
-
-#include <cassert>
-#include <string>
-#include <cstring>
-#include <vector>
-#include <set>
-#include <sstream>
-#include <iterator>
-#include <algorithm>
-#include <memory>
-#include <tr1/memory>
-
-#include <glXxx/private/glXxx.h>
-#include <glXxx/glXxx_all.h>
-#include <GL/glx.h>
-
-GLXContext glXxxGetCurrentCtx()
-{
-    return glXGetCurrentContext();
-}
-
-void* glXxxGetProcAddr(const char* function_name)
-{
-    return (void*)glXGetProcAddress((const GLubyte*)function_name);
-}
-
-bool glXxxIsExtensionSupported(const char* extension)
-{
-    Display* d = glXGetCurrentDisplay();
-    assert(d && "Queried GLX extension without a current context");
-    if (!d)
-        return false;
-    int screen;
-    if (glXQueryContext(d, glXGetCurrentContext(), GLX_SCREEN, &screen) != 0)
-        return false;
-
-    using namespace std;
-    string ext_s((const char*)glXQueryExtensionsString(d, screen));
-    istringstream ext_ss(ext_s);
-    vector<string> extensions;
-    copy(istream_iterator<string>(ext_ss), istream_iterator<string>(),
-            back_inserter<vector<string> >(extensions));
-    if (find(extensions.begin(), extensions.end(), extension) == extensions.end())
-        return false;
-    return true;
-}
-
-bool glXxxIsVersionSupported(int major, int minor)
-{
-    Display* d = glXGetCurrentDisplay();
-    assert(d && "Queried GLX extension without a current context");
-    if (!d)
-        return false;
-    int maj, min;
-    if (!glXQueryVersion(d, &maj, &min))
-        return false;
-    if (maj > major)
-        return true;
-    else if (maj == major && min >= minor)
-        return true;
-    return false;
-}
-
-
-typedef GLXFBConfig * (APIENTRYP PFNGLXGETFBCONFIGSPROC)(Display* dpy, int screen, int* nelements);
-typedef GLXFBConfig * (APIENTRYP PFNGLXCHOOSEFBCONFIGPROC)(Display* dpy, int screen, const int* attrib_list, int* nelements);
-typedef int (APIENTRYP PFNGLXGETFBCONFIGATTRIBPROC)(Display* dpy, GLXFBConfig config, int attribute, int* value);
-typedef XVisualInfo * (APIENTRYP PFNGLXGETVISUALFROMFBCONFIGPROC)(Display* dpy, GLXFBConfig config);
-typedef GLXWindow (APIENTRYP PFNGLXCREATEWINDOWPROC)(Display* dpy, GLXFBConfig config, Window win, const int* attrib_list);
-typedef void (APIENTRYP PFNGLXDESTROYWINDOWPROC)(Display* dpy, GLXWindow win);
-typedef GLXPixmap (APIENTRYP PFNGLXCREATEPIXMAPPROC)(Display* dpy, GLXFBConfig config, Pixmap pixmap, const int* attrib_list);
-typedef void (APIENTRYP PFNGLXDESTROYPIXMAPPROC)(Display* dpy, GLXPixmap pixmap);
-typedef GLXPbuffer (APIENTRYP PFNGLXCREATEPBUFFERPROC)(Display* dpy, GLXFBConfig config, const int* attrib_list);
-typedef void (APIENTRYP PFNGLXDESTROYPBUFFERPROC)(Display* dpy, GLXPbuffer pbuf);
-typedef void (APIENTRYP PFNGLXQUERYDRAWABLEPROC)(Display* dpy, GLXDrawable draw, int attribute, unsigned int* value);
-typedef GLXContext (APIENTRYP PFNGLXCREATENEWCONTEXTPROC)(Display* dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
-typedef Bool (APIENTRYP PFNGLXMAKECONTEXTCURRENTPROC)(Display* dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
-typedef GLXDrawable (APIENTRYP PFNGLXGETCURRENTREADDRAWABLEPROC)();
-typedef Display * (APIENTRYP PFNGLXGETCURRENTDISPLAYPROC)();
-typedef int (APIENTRYP PFNGLXQUERYCONTEXTPROC)(Display* dpy, GLXContext ctx, int attribute, int* value);
-typedef void (APIENTRYP PFNGLXSELECTEVENTPROC)(Display* dpy, GLXDrawable draw, unsigned long event_mask);
-typedef void (APIENTRYP PFNGLXGETSELECTEDEVENTPROC)(Display* dpy, GLXDrawable draw, unsigned long* event_mask);
-typedef __GLXextFuncPtr (APIENTRYP PFNGLXGETPROCADDRESSPROC)(const GLubyte* procName);
-typedef __GLXextFuncPtr (APIENTRYP PFNGLXGETPROCADDRESSARBPROC)(const GLubyte* procName);
-typedef GLXContext (APIENTRYP PFNGLXCREATECONTEXTATTRIBSARBPROC)(Display* dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int* attrib_list);
-typedef int (APIENTRYP PFNGLXSWAPINTERVALSGIPROC)(int interval);
-typedef int (APIENTRYP PFNGLXGETVIDEOSYNCSGIPROC)(unsigned int* count);
-typedef int (APIENTRYP PFNGLXWAITVIDEOSYNCSGIPROC)(int divisor, int remainder, unsigned int* count);
-typedef Bool (APIENTRYP PFNGLXMAKECURRENTREADSGIPROC)(Display* dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
-typedef GLXDrawable (APIENTRYP PFNGLXGETCURRENTREADDRAWABLESGIPROC)();
-#ifdef _VL_H
-typedef GLXVideoSourceSGIX (APIENTRYP PFNGLXCREATEGLXVIDEOSOURCESGIXPROC)(Display* display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode);
-typedef void (APIENTRYP PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC)(Display* dpy, GLXVideoSourceSGIX glxvideosource);
-#endif /* _VL_H */
-typedef Display * (APIENTRYP PFNGLXGETCURRENTDISPLAYEXTPROC)();
-typedef int (APIENTRYP PFNGLXQUERYCONTEXTINFOEXTPROC)(Display* dpy, GLXContext context, int attribute, int* value);
-typedef GLXContextID (APIENTRYP PFNGLXGETCONTEXTIDEXTPROC)(const GLXContext context);
-typedef GLXContext (APIENTRYP PFNGLXIMPORTCONTEXTEXTPROC)(Display* dpy, GLXContextID contextID);
-typedef void (APIENTRYP PFNGLXFREECONTEXTEXTPROC)(Display* dpy, GLXContext context);
-typedef int (APIENTRYP PFNGLXGETFBCONFIGATTRIBSGIXPROC)(Display* dpy, GLXFBConfigSGIX config, int attribute, int* value);
-typedef GLXFBConfigSGIX * (APIENTRYP PFNGLXCHOOSEFBCONFIGSGIXPROC)(Display* dpy, int screen, int* attrib_list, int* nelements);
-typedef GLXPixmap (APIENTRYP PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC)(Display* dpy, GLXFBConfigSGIX config, Pixmap pixmap);
-typedef GLXContext (APIENTRYP PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC)(Display* dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct);
-typedef XVisualInfo * (APIENTRYP PFNGLXGETVISUALFROMFBCONFIGSGIXPROC)(Display* dpy, GLXFBConfigSGIX config);
-typedef GLXFBConfigSGIX (APIENTRYP PFNGLXGETFBCONFIGFROMVISUALSGIXPROC)(Display* dpy, XVisualInfo* vis);
-typedef GLXPbufferSGIX (APIENTRYP PFNGLXCREATEGLXPBUFFERSGIXPROC)(Display* dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int* attrib_list);
-typedef void (APIENTRYP PFNGLXDESTROYGLXPBUFFERSGIXPROC)(Display* dpy, GLXPbufferSGIX pbuf);
-typedef int (APIENTRYP PFNGLXQUERYGLXPBUFFERSGIXPROC)(Display* dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int* value);
-typedef void (APIENTRYP PFNGLXSELECTEVENTSGIXPROC)(Display* dpy, GLXDrawable drawable, unsigned long mask);
-typedef void (APIENTRYP PFNGLXGETSELECTEDEVENTSGIXPROC)(Display* dpy, GLXDrawable drawable, unsigned long* mask);
-typedef void (APIENTRYP PFNGLXCUSHIONSGIPROC)(Display* dpy, Window window, float cushion);
-typedef int (APIENTRYP PFNGLXBINDCHANNELTOWINDOWSGIXPROC)(Display* display, int screen, int channel, Window window);
-typedef int (APIENTRYP PFNGLXCHANNELRECTSGIXPROC)(Display* display, int screen, int channel, int x, int y, int w, int h);
-typedef int (APIENTRYP PFNGLXQUERYCHANNELRECTSGIXPROC)(Display* display, int screen, int channel, int* dx, int* dy, int* dw, int* dh);
-typedef int (APIENTRYP PFNGLXQUERYCHANNELDELTASSGIXPROC)(Display* display, int screen, int channel, int* x, int* y, int* w, int* h);
-typedef int (APIENTRYP PFNGLXCHANNELRECTSYNCSGIXPROC)(Display* display, int screen, int channel, GLenum synctype);
-#ifdef _DM_BUFFER_H_
-typedef Bool (APIENTRYP PFNGLXASSOCIATEDMPBUFFERSGIXPROC)(Display* dpy, GLXPbufferSGIX pbuffer, DMparams* params, DMbuffer dmbuffer);
-#endif /* _DM_BUFFER_H_ */
-typedef void (APIENTRYP PFNGLXJOINSWAPGROUPSGIXPROC)(Display* dpy, GLXDrawable drawable, GLXDrawable member);
-typedef void (APIENTRYP PFNGLXBINDSWAPBARRIERSGIXPROC)(Display* dpy, GLXDrawable drawable, int barrier);
-typedef Bool (APIENTRYP PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC)(Display* dpy, int screen, int* max);
-typedef Status (APIENTRYP PFNGLXGETTRANSPARENTINDEXSUNPROC)(Display* dpy, Window overlay, Window underlay, long* pTransparentIndex);
-typedef void (APIENTRYP PFNGLXCOPYSUBBUFFERMESAPROC)(Display* dpy, GLXDrawable drawable, int x, int y, int width, int height);
-typedef GLXPixmap (APIENTRYP PFNGLXCREATEGLXPIXMAPMESAPROC)(Display* dpy, XVisualInfo* visual, Pixmap pixmap, Colormap cmap);
-typedef Bool (APIENTRYP PFNGLXRELEASEBUFFERSMESAPROC)(Display* dpy, GLXDrawable drawable);
-typedef Bool (APIENTRYP PFNGLXSET3DFXMODEMESAPROC)(int mode);
-typedef Bool (APIENTRYP PFNGLXGETSYNCVALUESOMLPROC)(Display* dpy, GLXDrawable drawable, int64_t* ust, int64_t* msc, int64_t* sbc);
-typedef Bool (APIENTRYP PFNGLXGETMSCRATEOMLPROC)(Display* dpy, GLXDrawable drawable, int32_t* numerator, int32_t* denominator);
-typedef int64_t (APIENTRYP PFNGLXSWAPBUFFERSMSCOMLPROC)(Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder);
-typedef Bool (APIENTRYP PFNGLXWAITFORMSCOMLPROC)(Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t* ust, int64_t* msc, int64_t* sbc);
-typedef Bool (APIENTRYP PFNGLXWAITFORSBCOMLPROC)(Display* dpy, GLXDrawable drawable, int64_t target_sbc, int64_t* ust, int64_t* msc, int64_t* sbc);
-typedef GLXHyperpipeNetworkSGIX * (APIENTRYP PFNGLXQUERYHYPERPIPENETWORKSGIXPROC)(Display* dpy, int* npipes);
-typedef int (APIENTRYP PFNGLXHYPERPIPECONFIGSGIXPROC)(Display* dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX* cfg, int* hpId);
-typedef GLXHyperpipeConfigSGIX * (APIENTRYP PFNGLXQUERYHYPERPIPECONFIGSGIXPROC)(Display* dpy, int hpId, int* npipes);
-typedef int (APIENTRYP PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC)(Display* dpy, int hpId);
-typedef int (APIENTRYP PFNGLXBINDHYPERPIPESGIXPROC)(Display* dpy, int hpId);
-typedef int (APIENTRYP PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC)(Display* dpy, int timeSlice, int attrib, int size, void* attribList, void* returnAttribList);
-typedef int (APIENTRYP PFNGLXHYPERPIPEATTRIBSGIXPROC)(Display* dpy, int timeSlice, int attrib, int size, void* attribList);
-typedef int (APIENTRYP PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC)(Display* dpy, int timeSlice, int attrib, int size, void* returnAttribList);
-typedef unsigned int (APIENTRYP PFNGLXGETAGPOFFSETMESAPROC)(const void* pointer);
-typedef void (APIENTRYP PFNGLXBINDTEXIMAGEEXTPROC)(Display* dpy, GLXDrawable drawable, int buffer, const int* attrib_list);
-typedef void (APIENTRYP PFNGLXRELEASETEXIMAGEEXTPROC)(Display* dpy, GLXDrawable drawable, int buffer);
-typedef unsigned int * (APIENTRYP PFNGLXENUMERATEVIDEODEVICESNVPROC)(Display* dpy, int screen, int* nelements);
-typedef int (APIENTRYP PFNGLXBINDVIDEODEVICENVPROC)(Display* dpy, unsigned int video_slot, unsigned int video_device, const int* attrib_list);
-typedef int (APIENTRYP PFNGLXGETVIDEODEVICENVPROC)(Display* dpy, int screen, int numVideoDevices, GLXVideoDeviceNV* pVideoDevice);
-typedef int (APIENTRYP PFNGLXRELEASEVIDEODEVICENVPROC)(Display* dpy, int screen, GLXVideoDeviceNV VideoDevice);
-typedef int (APIENTRYP PFNGLXBINDVIDEOIMAGENVPROC)(Display* dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer);
-typedef int (APIENTRYP PFNGLXRELEASEVIDEOIMAGENVPROC)(Display* dpy, GLXPbuffer pbuf);
-typedef int (APIENTRYP PFNGLXSENDPBUFFERTOVIDEONVPROC)(Display* dpy, GLXPbuffer pbuf, int iBufferType, unsigned long* pulCounterPbuffer, GLboolean bBlock);
-typedef int (APIENTRYP PFNGLXGETVIDEOINFONVPROC)(Display* dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long* pulCounterOutputPbuffer, unsigned long* pulCounterOutputVideo);
-typedef Bool (APIENTRYP PFNGLXJOINSWAPGROUPNVPROC)(Display* dpy, GLXDrawable drawable, GLuint group);
-typedef Bool (APIENTRYP PFNGLXBINDSWAPBARRIERNVPROC)(Display* dpy, GLuint group, GLuint barrier);
-typedef Bool (APIENTRYP PFNGLXQUERYSWAPGROUPNVPROC)(Display* dpy, GLXDrawable drawable, GLuint* group, GLuint* barrier);
-typedef Bool (APIENTRYP PFNGLXQUERYMAXSWAPGROUPSNVPROC)(Display* dpy, int screen, GLuint* maxGroups, GLuint* maxBarriers);
-typedef Bool (APIENTRYP PFNGLXQUERYFRAMECOUNTNVPROC)(Display* dpy, int screen, GLuint* count);
-typedef Bool (APIENTRYP PFNGLXRESETFRAMECOUNTNVPROC)(Display* dpy, int screen);
-typedef int (APIENTRYP PFNGLXBINDVIDEOCAPTUREDEVICENVPROC)(Display* dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device);
-typedef GLXVideoCaptureDeviceNV * (APIENTRYP PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC)(Display* dpy, int screen, int* nelements);
-typedef void (APIENTRYP PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC)(Display* dpy, GLXVideoCaptureDeviceNV device);
-typedef int (APIENTRYP PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC)(Display* dpy, GLXVideoCaptureDeviceNV device, int attribute, int* value);
-typedef void (APIENTRYP PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC)(Display* dpy, GLXVideoCaptureDeviceNV device);
-typedef int (APIENTRYP PFNGLXSWAPINTERVALEXTPROC)(Display* dpy, GLXDrawable drawable, int interval);
-typedef void (APIENTRYP PFNGLXCOPYIMAGESUBDATANVPROC)(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);
-
-struct glxxxLoader {
-    PFNGLXGETFBCONFIGSPROC GetFBConfigs;
-    PFNGLXCHOOSEFBCONFIGPROC ChooseFBConfig;
-    PFNGLXGETFBCONFIGATTRIBPROC GetFBConfigAttrib;
-    PFNGLXGETVISUALFROMFBCONFIGPROC GetVisualFromFBConfig;
-    PFNGLXCREATEWINDOWPROC CreateWindow;
-    PFNGLXDESTROYWINDOWPROC DestroyWindow;
-    PFNGLXCREATEPIXMAPPROC CreatePixmap;
-    PFNGLXDESTROYPIXMAPPROC DestroyPixmap;
-    PFNGLXCREATEPBUFFERPROC CreatePbuffer;
-    PFNGLXDESTROYPBUFFERPROC DestroyPbuffer;
-    PFNGLXQUERYDRAWABLEPROC QueryDrawable;
-    PFNGLXCREATENEWCONTEXTPROC CreateNewContext;
-    PFNGLXMAKECONTEXTCURRENTPROC MakeContextCurrent;
-    PFNGLXGETCURRENTREADDRAWABLEPROC GetCurrentReadDrawable;
-    PFNGLXGETCURRENTDISPLAYPROC GetCurrentDisplay;
-    PFNGLXQUERYCONTEXTPROC QueryContext;
-    PFNGLXSELECTEVENTPROC SelectEvent;
-    PFNGLXGETSELECTEDEVENTPROC GetSelectedEvent;
-    PFNGLXGETPROCADDRESSPROC GetProcAddress;
-    PFNGLXGETPROCADDRESSARBPROC GetProcAddressARB;
-    PFNGLXCREATECONTEXTATTRIBSARBPROC CreateContextAttribsARB;
-    PFNGLXSWAPINTERVALSGIPROC SwapIntervalSGI;
-    PFNGLXGETVIDEOSYNCSGIPROC GetVideoSyncSGI;
-    PFNGLXWAITVIDEOSYNCSGIPROC WaitVideoSyncSGI;
-    PFNGLXMAKECURRENTREADSGIPROC MakeCurrentReadSGI;
-    PFNGLXGETCURRENTREADDRAWABLESGIPROC GetCurrentReadDrawableSGI;
-#ifdef _VL_H
-    PFNGLXCREATEGLXVIDEOSOURCESGIXPROC CreateGLXVideoSourceSGIX;
-    PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC DestroyGLXVideoSourceSGIX;
-#endif /* _VL_H */
-    PFNGLXGETCURRENTDISPLAYEXTPROC GetCurrentDisplayEXT;
-    PFNGLXQUERYCONTEXTINFOEXTPROC QueryContextInfoEXT;
-    PFNGLXGETCONTEXTIDEXTPROC GetContextIDEXT;
-    PFNGLXIMPORTCONTEXTEXTPROC ImportContextEXT;
-    PFNGLXFREECONTEXTEXTPROC FreeContextEXT;
-    PFNGLXGETFBCONFIGATTRIBSGIXPROC GetFBConfigAttribSGIX;
-    PFNGLXCHOOSEFBCONFIGSGIXPROC ChooseFBConfigSGIX;
-    PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC CreateGLXPixmapWithConfigSGIX;
-    PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC CreateContextWithConfigSGIX;
-    PFNGLXGETVISUALFROMFBCONFIGSGIXPROC GetVisualFromFBConfigSGIX;
-    PFNGLXGETFBCONFIGFROMVISUALSGIXPROC GetFBConfigFromVisualSGIX;
-    PFNGLXCREATEGLXPBUFFERSGIXPROC CreateGLXPbufferSGIX;
-    PFNGLXDESTROYGLXPBUFFERSGIXPROC DestroyGLXPbufferSGIX;
-    PFNGLXQUERYGLXPBUFFERSGIXPROC QueryGLXPbufferSGIX;
-    PFNGLXSELECTEVENTSGIXPROC SelectEventSGIX;
-    PFNGLXGETSELECTEDEVENTSGIXPROC GetSelectedEventSGIX;
-    PFNGLXCUSHIONSGIPROC CushionSGI;
-    PFNGLXBINDCHANNELTOWINDOWSGIXPROC BindChannelToWindowSGIX;
-    PFNGLXCHANNELRECTSGIXPROC ChannelRectSGIX;
-    PFNGLXQUERYCHANNELRECTSGIXPROC QueryChannelRectSGIX;
-    PFNGLXQUERYCHANNELDELTASSGIXPROC QueryChannelDeltasSGIX;
-    PFNGLXCHANNELRECTSYNCSGIXPROC ChannelRectSyncSGIX;
-#ifdef _DM_BUFFER_H_
-    PFNGLXASSOCIATEDMPBUFFERSGIXPROC AssociateDMPbufferSGIX;
-#endif /* _DM_BUFFER_H_ */
-    PFNGLXJOINSWAPGROUPSGIXPROC JoinSwapGroupSGIX;
-    PFNGLXBINDSWAPBARRIERSGIXPROC BindSwapBarrierSGIX;
-    PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC QueryMaxSwapBarriersSGIX;
-    PFNGLXGETTRANSPARENTINDEXSUNPROC GetTransparentIndexSUN;
-    PFNGLXCOPYSUBBUFFERMESAPROC CopySubBufferMESA;
-    PFNGLXCREATEGLXPIXMAPMESAPROC CreateGLXPixmapMESA;
-    PFNGLXRELEASEBUFFERSMESAPROC ReleaseBuffersMESA;
-    PFNGLXSET3DFXMODEMESAPROC Set3DfxModeMESA;
-    PFNGLXGETSYNCVALUESOMLPROC GetSyncValuesOML;
-    PFNGLXGETMSCRATEOMLPROC GetMscRateOML;
-    PFNGLXSWAPBUFFERSMSCOMLPROC SwapBuffersMscOML;
-    PFNGLXWAITFORMSCOMLPROC WaitForMscOML;
-    PFNGLXWAITFORSBCOMLPROC WaitForSbcOML;
-    PFNGLXQUERYHYPERPIPENETWORKSGIXPROC QueryHyperpipeNetworkSGIX;
-    PFNGLXHYPERPIPECONFIGSGIXPROC HyperpipeConfigSGIX;
-    PFNGLXQUERYHYPERPIPECONFIGSGIXPROC QueryHyperpipeConfigSGIX;
-    PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC DestroyHyperpipeConfigSGIX;
-    PFNGLXBINDHYPERPIPESGIXPROC BindHyperpipeSGIX;
-    PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC QueryHyperpipeBestAttribSGIX;
-    PFNGLXHYPERPIPEATTRIBSGIXPROC HyperpipeAttribSGIX;
-    PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC QueryHyperpipeAttribSGIX;
-    PFNGLXGETAGPOFFSETMESAPROC GetAGPOffsetMESA;
-    PFNGLXBINDTEXIMAGEEXTPROC BindTexImageEXT;
-    PFNGLXRELEASETEXIMAGEEXTPROC ReleaseTexImageEXT;
-    PFNGLXENUMERATEVIDEODEVICESNVPROC EnumerateVideoDevicesNV;
-    PFNGLXBINDVIDEODEVICENVPROC BindVideoDeviceNV;
-    PFNGLXGETVIDEODEVICENVPROC GetVideoDeviceNV;
-    PFNGLXRELEASEVIDEODEVICENVPROC ReleaseVideoDeviceNV;
-    PFNGLXBINDVIDEOIMAGENVPROC BindVideoImageNV;
-    PFNGLXRELEASEVIDEOIMAGENVPROC ReleaseVideoImageNV;
-    PFNGLXSENDPBUFFERTOVIDEONVPROC SendPbufferToVideoNV;
-    PFNGLXGETVIDEOINFONVPROC GetVideoInfoNV;
-    PFNGLXJOINSWAPGROUPNVPROC JoinSwapGroupNV;
-    PFNGLXBINDSWAPBARRIERNVPROC BindSwapBarrierNV;
-    PFNGLXQUERYSWAPGROUPNVPROC QuerySwapGroupNV;
-    PFNGLXQUERYMAXSWAPGROUPSNVPROC QueryMaxSwapGroupsNV;
-    PFNGLXQUERYFRAMECOUNTNVPROC QueryFrameCountNV;
-    PFNGLXRESETFRAMECOUNTNVPROC ResetFrameCountNV;
-    PFNGLXBINDVIDEOCAPTUREDEVICENVPROC BindVideoCaptureDeviceNV;
-    PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC EnumerateVideoCaptureDevicesNV;
-    PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC LockVideoCaptureDeviceNV;
-    PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC QueryVideoCaptureDeviceNV;
-    PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC ReleaseVideoCaptureDeviceNV;
-    PFNGLXSWAPINTERVALEXTPROC SwapIntervalEXT;
-    PFNGLXCOPYIMAGESUBDATANVPROC CopyImageSubDataNV;
-
-    glxxxLoader() { memset(this, 0, sizeof(glxxxLoader)); }
-};
-
-#ifdef GLXX_TLS
-    #if defined(_WIN32) || defined(WIN32)
-    __declspec(thread)
-    #endif
-    #if defined(__linux__)
-    __thread
-    #endif
-#endif
-glxxxLoader* glxxx_current_loader = 0;
-
-
-std::vector<std::tr1::shared_ptr<glxxxLoader> > glxxx_loaders;
-std::set<GLXXXloader> glxxx_unused_loader_indices;
-
-
-GLXXXloader glxxxGenLoader()
-{
-    if (glxxx_unused_loader_indices.empty()) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        return glxxx_loaders.size() - 1;
-    } else {
-        GLXXXloader first_unused_loader = *(glxxx_unused_loader_indices.begin());
-        glxxx_loaders[first_unused_loader].reset(new glxxxLoader);
-        glxxx_unused_loader_indices.erase(glxxx_unused_loader_indices.begin());
-        return first_unused_loader;
-    }
-}
-
-void glxxxBindLoader(GLXXXloader loader)
-{
-    glxxx_current_loader = glxxx_loaders[loader].get();
-}
-
-void glxxxDeleteLoader(GLuint loader)
-{
-    if (glxxx_loaders[loader].get() == glxxx_current_loader) {
-        if (!glxxx_loaders.empty())
-            glxxx_current_loader = glxxx_loaders[0].get();
-        else
-            glxxx_current_loader = 0;
-    }
-    glxxx_loaders[loader].reset();
-    glxxx_unused_loader_indices.insert(loader);
-}
-
-
-bool load_glx_version_1_3()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_version_1_3() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-    
-    glxxx_current_loader->GetFBConfigs = (PFNGLXGETFBCONFIGSPROC) glXxxGetProcAddr("glXGetFBConfigs");
-    if (!glxxx_current_loader->GetFBConfigs) is_loaded = false;
-    
-    glxxx_current_loader->ChooseFBConfig = (PFNGLXCHOOSEFBCONFIGPROC) glXxxGetProcAddr("glXChooseFBConfig");
-    if (!glxxx_current_loader->ChooseFBConfig) is_loaded = false;
-    
-    glxxx_current_loader->GetFBConfigAttrib = (PFNGLXGETFBCONFIGATTRIBPROC) glXxxGetProcAddr("glXGetFBConfigAttrib");
-    if (!glxxx_current_loader->GetFBConfigAttrib) is_loaded = false;
-    
-    glxxx_current_loader->GetVisualFromFBConfig = (PFNGLXGETVISUALFROMFBCONFIGPROC) glXxxGetProcAddr("glXGetVisualFromFBConfig");
-    if (!glxxx_current_loader->GetVisualFromFBConfig) is_loaded = false;
-    
-    glxxx_current_loader->CreateWindow = (PFNGLXCREATEWINDOWPROC) glXxxGetProcAddr("glXCreateWindow");
-    if (!glxxx_current_loader->CreateWindow) is_loaded = false;
-    
-    glxxx_current_loader->DestroyWindow = (PFNGLXDESTROYWINDOWPROC) glXxxGetProcAddr("glXDestroyWindow");
-    if (!glxxx_current_loader->DestroyWindow) is_loaded = false;
-    
-    glxxx_current_loader->CreatePixmap = (PFNGLXCREATEPIXMAPPROC) glXxxGetProcAddr("glXCreatePixmap");
-    if (!glxxx_current_loader->CreatePixmap) is_loaded = false;
-    
-    glxxx_current_loader->DestroyPixmap = (PFNGLXDESTROYPIXMAPPROC) glXxxGetProcAddr("glXDestroyPixmap");
-    if (!glxxx_current_loader->DestroyPixmap) is_loaded = false;
-    
-    glxxx_current_loader->CreatePbuffer = (PFNGLXCREATEPBUFFERPROC) glXxxGetProcAddr("glXCreatePbuffer");
-    if (!glxxx_current_loader->CreatePbuffer) is_loaded = false;
-    
-    glxxx_current_loader->DestroyPbuffer = (PFNGLXDESTROYPBUFFERPROC) glXxxGetProcAddr("glXDestroyPbuffer");
-    if (!glxxx_current_loader->DestroyPbuffer) is_loaded = false;
-    
-    glxxx_current_loader->QueryDrawable = (PFNGLXQUERYDRAWABLEPROC) glXxxGetProcAddr("glXQueryDrawable");
-    if (!glxxx_current_loader->QueryDrawable) is_loaded = false;
-    
-    glxxx_current_loader->CreateNewContext = (PFNGLXCREATENEWCONTEXTPROC) glXxxGetProcAddr("glXCreateNewContext");
-    if (!glxxx_current_loader->CreateNewContext) is_loaded = false;
-    
-    glxxx_current_loader->MakeContextCurrent = (PFNGLXMAKECONTEXTCURRENTPROC) glXxxGetProcAddr("glXMakeContextCurrent");
-    if (!glxxx_current_loader->MakeContextCurrent) is_loaded = false;
-    
-    glxxx_current_loader->GetCurrentReadDrawable = (PFNGLXGETCURRENTREADDRAWABLEPROC) glXxxGetProcAddr("glXGetCurrentReadDrawable");
-    if (!glxxx_current_loader->GetCurrentReadDrawable) is_loaded = false;
-    
-    glxxx_current_loader->GetCurrentDisplay = (PFNGLXGETCURRENTDISPLAYPROC) glXxxGetProcAddr("glXGetCurrentDisplay");
-    if (!glxxx_current_loader->GetCurrentDisplay) is_loaded = false;
-    
-    glxxx_current_loader->QueryContext = (PFNGLXQUERYCONTEXTPROC) glXxxGetProcAddr("glXQueryContext");
-    if (!glxxx_current_loader->QueryContext) is_loaded = false;
-    
-    glxxx_current_loader->SelectEvent = (PFNGLXSELECTEVENTPROC) glXxxGetProcAddr("glXSelectEvent");
-    if (!glxxx_current_loader->SelectEvent) is_loaded = false;
-    
-    glxxx_current_loader->GetSelectedEvent = (PFNGLXGETSELECTEDEVENTPROC) glXxxGetProcAddr("glXGetSelectedEvent");
-    if (!glxxx_current_loader->GetSelectedEvent) is_loaded = false;
-        
-    return is_loaded;
-}
-
-GLXFBConfig * glx_version_1_3::glXGetFBConfigs(Display* dpy, int screen, int* nelements)
-{
-    return glxxx_current_loader->GetFBConfigs(dpy, screen, nelements);
-}
-
-GLXFBConfig * glx_version_1_3::glXChooseFBConfig(Display* dpy, int screen, const int* attrib_list, int* nelements)
-{
-    return glxxx_current_loader->ChooseFBConfig(dpy, screen, attrib_list, nelements);
-}
-
-int glx_version_1_3::glXGetFBConfigAttrib(Display* dpy, GLXFBConfig config, int attribute, int* value)
-{
-    return glxxx_current_loader->GetFBConfigAttrib(dpy, config, attribute, value);
-}
-
-XVisualInfo * glx_version_1_3::glXGetVisualFromFBConfig(Display* dpy, GLXFBConfig config)
-{
-    return glxxx_current_loader->GetVisualFromFBConfig(dpy, config);
-}
-
-GLXWindow glx_version_1_3::glXCreateWindow(Display* dpy, GLXFBConfig config, Window win, const int* attrib_list)
-{
-    return glxxx_current_loader->CreateWindow(dpy, config, win, attrib_list);
-}
-
-void glx_version_1_3::glXDestroyWindow(Display* dpy, GLXWindow win)
-{
-    glxxx_current_loader->DestroyWindow(dpy, win);
-}
-
-GLXPixmap glx_version_1_3::glXCreatePixmap(Display* dpy, GLXFBConfig config, Pixmap pixmap, const int* attrib_list)
-{
-    return glxxx_current_loader->CreatePixmap(dpy, config, pixmap, attrib_list);
-}
-
-void glx_version_1_3::glXDestroyPixmap(Display* dpy, GLXPixmap pixmap)
-{
-    glxxx_current_loader->DestroyPixmap(dpy, pixmap);
-}
-
-GLXPbuffer glx_version_1_3::glXCreatePbuffer(Display* dpy, GLXFBConfig config, const int* attrib_list)
-{
-    return glxxx_current_loader->CreatePbuffer(dpy, config, attrib_list);
-}
-
-void glx_version_1_3::glXDestroyPbuffer(Display* dpy, GLXPbuffer pbuf)
-{
-    glxxx_current_loader->DestroyPbuffer(dpy, pbuf);
-}
-
-void glx_version_1_3::glXQueryDrawable(Display* dpy, GLXDrawable draw, int attribute, unsigned int* value)
-{
-    glxxx_current_loader->QueryDrawable(dpy, draw, attribute, value);
-}
-
-GLXContext glx_version_1_3::glXCreateNewContext(Display* dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct)
-{
-    return glxxx_current_loader->CreateNewContext(dpy, config, render_type, share_list, direct);
-}
-
-Bool glx_version_1_3::glXMakeContextCurrent(Display* dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx)
-{
-    return glxxx_current_loader->MakeContextCurrent(dpy, draw, read, ctx);
-}
-
-GLXDrawable glx_version_1_3::glXGetCurrentReadDrawable()
-{
-    return glxxx_current_loader->GetCurrentReadDrawable();
-}
-
-Display * glx_version_1_3::glXGetCurrentDisplay()
-{
-    return glxxx_current_loader->GetCurrentDisplay();
-}
-
-int glx_version_1_3::glXQueryContext(Display* dpy, GLXContext ctx, int attribute, int* value)
-{
-    return glxxx_current_loader->QueryContext(dpy, ctx, attribute, value);
-}
-
-void glx_version_1_3::glXSelectEvent(Display* dpy, GLXDrawable draw, unsigned long event_mask)
-{
-    glxxx_current_loader->SelectEvent(dpy, draw, event_mask);
-}
-
-void glx_version_1_3::glXGetSelectedEvent(Display* dpy, GLXDrawable draw, unsigned long* event_mask)
-{
-    glxxx_current_loader->GetSelectedEvent(dpy, draw, event_mask);
-}
-
-
-
-bool load_glx_version_1_4()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_version_1_4() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-    
-    glxxx_current_loader->GetProcAddress = (PFNGLXGETPROCADDRESSPROC) glXxxGetProcAddr("glXGetProcAddress");
-    if (!glxxx_current_loader->GetProcAddress) is_loaded = false;
-        
-    return is_loaded;
-}
-
-__GLXextFuncPtr glx_version_1_4::glXGetProcAddress(const GLubyte* procName)
-{
-    return glxxx_current_loader->GetProcAddress(procName);
-}
-
-
-
-bool load_glx_arb_get_proc_address()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_arb_get_proc_address() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-    
-    glxxx_current_loader->GetProcAddressARB = (PFNGLXGETPROCADDRESSARBPROC) glXxxGetProcAddr("glXGetProcAddressARB");
-    if (!glxxx_current_loader->GetProcAddressARB) is_loaded = false;
-        
-    return is_loaded;
-}
-
-bool has_glx_arb_get_proc_address()
-{
-    return glXxxIsExtensionSupported("GLX_ARB_get_proc_address");
-}
-
-
-__GLXextFuncPtr glx_arb_get_proc_address::glXGetProcAddressARB(const GLubyte* procName)
-{
-    return glxxx_current_loader->GetProcAddressARB(procName);
-}
-
-
-
-bool load_glx_arb_multisample()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_arb_multisample() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-        
-    return is_loaded;
-}
-
-bool has_glx_arb_multisample()
-{
-    return glXxxIsExtensionSupported("GLX_ARB_multisample");
-}
-
-
-
-
-bool load_glx_arb_fbconfig_float()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_arb_fbconfig_float() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-        
-    return is_loaded;
-}
-
-bool has_glx_arb_fbconfig_float()
-{
-    return glXxxIsExtensionSupported("GLX_ARB_fbconfig_float");
-}
-
-
-
-
-bool load_glx_arb_framebuffer_srgb()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_arb_framebuffer_srgb() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-        
-    return is_loaded;
-}
-
-bool has_glx_arb_framebuffer_srgb()
-{
-    return glXxxIsExtensionSupported("GLX_ARB_framebuffer_sRGB");
-}
-
-
-
-
-bool load_glx_arb_create_context()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_arb_create_context() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-    
-    glxxx_current_loader->CreateContextAttribsARB = (PFNGLXCREATECONTEXTATTRIBSARBPROC) glXxxGetProcAddr("glXCreateContextAttribsARB");
-    if (!glxxx_current_loader->CreateContextAttribsARB) is_loaded = false;
-        
-    return is_loaded;
-}
-
-bool has_glx_arb_create_context()
-{
-    return glXxxIsExtensionSupported("GLX_ARB_create_context");
-}
-
-
-GLXContext glx_arb_create_context::glXCreateContextAttribsARB(Display* dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int* attrib_list)
-{
-    return glxxx_current_loader->CreateContextAttribsARB(dpy, config, share_context, direct, attrib_list);
-}
-
-
-
-bool load_glx_arb_create_context_profile()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_arb_create_context_profile() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-        
-    return is_loaded;
-}
-
-bool has_glx_arb_create_context_profile()
-{
-    return glXxxIsExtensionSupported("GLX_ARB_create_context_profile");
-}
-
-
-
-
-bool load_glx_arb_create_context_robustness()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_arb_create_context_robustness() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-        
-    return is_loaded;
-}
-
-bool has_glx_arb_create_context_robustness()
-{
-    return glXxxIsExtensionSupported("GLX_ARB_create_context_robustness");
-}
-
-
-
-
-bool load_glx_sgis_multisample()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_sgis_multisample() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-        
-    return is_loaded;
-}
-
-bool has_glx_sgis_multisample()
-{
-    return glXxxIsExtensionSupported("GLX_SGIS_multisample");
-}
-
-
-
-
-bool load_glx_ext_visual_info()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_ext_visual_info() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-        
-    return is_loaded;
-}
-
-bool has_glx_ext_visual_info()
-{
-    return glXxxIsExtensionSupported("GLX_EXT_visual_info");
-}
-
-
-
-
-bool load_glx_sgi_swap_control()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_sgi_swap_control() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-    
-    glxxx_current_loader->SwapIntervalSGI = (PFNGLXSWAPINTERVALSGIPROC) glXxxGetProcAddr("glXSwapIntervalSGI");
-    if (!glxxx_current_loader->SwapIntervalSGI) is_loaded = false;
-        
-    return is_loaded;
-}
-
-bool has_glx_sgi_swap_control()
-{
-    return glXxxIsExtensionSupported("GLX_SGI_swap_control");
-}
-
-
-int glx_sgi_swap_control::glXSwapIntervalSGI(int interval)
-{
-    return glxxx_current_loader->SwapIntervalSGI(interval);
-}
-
-
-
-bool load_glx_sgi_video_sync()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_sgi_video_sync() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-    
-    glxxx_current_loader->GetVideoSyncSGI = (PFNGLXGETVIDEOSYNCSGIPROC) glXxxGetProcAddr("glXGetVideoSyncSGI");
-    if (!glxxx_current_loader->GetVideoSyncSGI) is_loaded = false;
-    
-    glxxx_current_loader->WaitVideoSyncSGI = (PFNGLXWAITVIDEOSYNCSGIPROC) glXxxGetProcAddr("glXWaitVideoSyncSGI");
-    if (!glxxx_current_loader->WaitVideoSyncSGI) is_loaded = false;
-        
-    return is_loaded;
-}
-
-bool has_glx_sgi_video_sync()
-{
-    return glXxxIsExtensionSupported("GLX_SGI_video_sync");
-}
-
-
-int glx_sgi_video_sync::glXGetVideoSyncSGI(unsigned int* count)
-{
-    return glxxx_current_loader->GetVideoSyncSGI(count);
-}
-
-int glx_sgi_video_sync::glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int* count)
-{
-    return glxxx_current_loader->WaitVideoSyncSGI(divisor, remainder, count);
-}
-
-
-
-bool load_glx_sgi_make_current_read()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_sgi_make_current_read() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-    
-    glxxx_current_loader->MakeCurrentReadSGI = (PFNGLXMAKECURRENTREADSGIPROC) glXxxGetProcAddr("glXMakeCurrentReadSGI");
-    if (!glxxx_current_loader->MakeCurrentReadSGI) is_loaded = false;
-    
-    glxxx_current_loader->GetCurrentReadDrawableSGI = (PFNGLXGETCURRENTREADDRAWABLESGIPROC) glXxxGetProcAddr("glXGetCurrentReadDrawableSGI");
-    if (!glxxx_current_loader->GetCurrentReadDrawableSGI) is_loaded = false;
-        
-    return is_loaded;
-}
-
-bool has_glx_sgi_make_current_read()
-{
-    return glXxxIsExtensionSupported("GLX_SGI_make_current_read");
-}
-
-
-Bool glx_sgi_make_current_read::glXMakeCurrentReadSGI(Display* dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx)
-{
-    return glxxx_current_loader->MakeCurrentReadSGI(dpy, draw, read, ctx);
-}
-
-GLXDrawable glx_sgi_make_current_read::glXGetCurrentReadDrawableSGI()
-{
-    return glxxx_current_loader->GetCurrentReadDrawableSGI();
-}
-
-#ifdef _VL_H
-
-bool load_glx_sgix_video_source()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_sgix_video_source() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-    
-    glxxx_current_loader->CreateGLXVideoSourceSGIX = (PFNGLXCREATEGLXVIDEOSOURCESGIXPROC) glXxxGetProcAddr("glXCreateGLXVideoSourceSGIX");
-    if (!glxxx_current_loader->CreateGLXVideoSourceSGIX) is_loaded = false;
-    
-    glxxx_current_loader->DestroyGLXVideoSourceSGIX = (PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC) glXxxGetProcAddr("glXDestroyGLXVideoSourceSGIX");
-    if (!glxxx_current_loader->DestroyGLXVideoSourceSGIX) is_loaded = false;
-        
-    return is_loaded;
-}
-
-bool has_glx_sgix_video_source()
-{
-    return glXxxIsExtensionSupported("GLX_SGIX_video_source");
-}
-
-
-GLXVideoSourceSGIX glx_sgix_video_source::glXCreateGLXVideoSourceSGIX(Display* display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode)
-{
-    return glxxx_current_loader->CreateGLXVideoSourceSGIX(display, screen, server, path, nodeClass, drainNode);
-}
-
-void glx_sgix_video_source::glXDestroyGLXVideoSourceSGIX(Display* dpy, GLXVideoSourceSGIX glxvideosource)
-{
-    glxxx_current_loader->DestroyGLXVideoSourceSGIX(dpy, glxvideosource);
-}
-#endif /* _VL_H */
-
-
-bool load_glx_ext_visual_rating()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_ext_visual_rating() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-        
-    return is_loaded;
-}
-
-bool has_glx_ext_visual_rating()
-{
-    return glXxxIsExtensionSupported("GLX_EXT_visual_rating");
-}
-
-
-
-
-bool load_glx_ext_import_context()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_ext_import_context() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-    
-    glxxx_current_loader->GetCurrentDisplayEXT = (PFNGLXGETCURRENTDISPLAYEXTPROC) glXxxGetProcAddr("glXGetCurrentDisplayEXT");
-    if (!glxxx_current_loader->GetCurrentDisplayEXT) is_loaded = false;
-    
-    glxxx_current_loader->QueryContextInfoEXT = (PFNGLXQUERYCONTEXTINFOEXTPROC) glXxxGetProcAddr("glXQueryContextInfoEXT");
-    if (!glxxx_current_loader->QueryContextInfoEXT) is_loaded = false;
-    
-    glxxx_current_loader->GetContextIDEXT = (PFNGLXGETCONTEXTIDEXTPROC) glXxxGetProcAddr("glXGetContextIDEXT");
-    if (!glxxx_current_loader->GetContextIDEXT) is_loaded = false;
-    
-    glxxx_current_loader->ImportContextEXT = (PFNGLXIMPORTCONTEXTEXTPROC) glXxxGetProcAddr("glXImportContextEXT");
-    if (!glxxx_current_loader->ImportContextEXT) is_loaded = false;
-    
-    glxxx_current_loader->FreeContextEXT = (PFNGLXFREECONTEXTEXTPROC) glXxxGetProcAddr("glXFreeContextEXT");
-    if (!glxxx_current_loader->FreeContextEXT) is_loaded = false;
-        
-    return is_loaded;
-}
-
-bool has_glx_ext_import_context()
-{
-    return glXxxIsExtensionSupported("GLX_EXT_import_context");
-}
-
-
-Display * glx_ext_import_context::glXGetCurrentDisplayEXT()
-{
-    return glxxx_current_loader->GetCurrentDisplayEXT();
-}
-
-int glx_ext_import_context::glXQueryContextInfoEXT(Display* dpy, GLXContext context, int attribute, int* value)
-{
-    return glxxx_current_loader->QueryContextInfoEXT(dpy, context, attribute, value);
-}
-
-GLXContextID glx_ext_import_context::glXGetContextIDEXT(const GLXContext context)
-{
-    return glxxx_current_loader->GetContextIDEXT(context);
-}
-
-GLXContext glx_ext_import_context::glXImportContextEXT(Display* dpy, GLXContextID contextID)
-{
-    return glxxx_current_loader->ImportContextEXT(dpy, contextID);
-}
-
-void glx_ext_import_context::glXFreeContextEXT(Display* dpy, GLXContext context)
-{
-    glxxx_current_loader->FreeContextEXT(dpy, context);
-}
-
-
-
-bool load_glx_sgix_fbconfig()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_sgix_fbconfig() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-    
-    glxxx_current_loader->GetFBConfigAttribSGIX = (PFNGLXGETFBCONFIGATTRIBSGIXPROC) glXxxGetProcAddr("glXGetFBConfigAttribSGIX");
-    if (!glxxx_current_loader->GetFBConfigAttribSGIX) is_loaded = false;
-    
-    glxxx_current_loader->ChooseFBConfigSGIX = (PFNGLXCHOOSEFBCONFIGSGIXPROC) glXxxGetProcAddr("glXChooseFBConfigSGIX");
-    if (!glxxx_current_loader->ChooseFBConfigSGIX) is_loaded = false;
-    
-    glxxx_current_loader->CreateGLXPixmapWithConfigSGIX = (PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) glXxxGetProcAddr("glXCreateGLXPixmapWithConfigSGIX");
-    if (!glxxx_current_loader->CreateGLXPixmapWithConfigSGIX) is_loaded = false;
-    
-    glxxx_current_loader->CreateContextWithConfigSGIX = (PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) glXxxGetProcAddr("glXCreateContextWithConfigSGIX");
-    if (!glxxx_current_loader->CreateContextWithConfigSGIX) is_loaded = false;
-    
-    glxxx_current_loader->GetVisualFromFBConfigSGIX = (PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) glXxxGetProcAddr("glXGetVisualFromFBConfigSGIX");
-    if (!glxxx_current_loader->GetVisualFromFBConfigSGIX) is_loaded = false;
-    
-    glxxx_current_loader->GetFBConfigFromVisualSGIX = (PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) glXxxGetProcAddr("glXGetFBConfigFromVisualSGIX");
-    if (!glxxx_current_loader->GetFBConfigFromVisualSGIX) is_loaded = false;
-        
-    return is_loaded;
-}
-
-bool has_glx_sgix_fbconfig()
-{
-    return glXxxIsExtensionSupported("GLX_SGIX_fbconfig");
-}
-
-
-int glx_sgix_fbconfig::glXGetFBConfigAttribSGIX(Display* dpy, GLXFBConfigSGIX config, int attribute, int* value)
-{
-    return glxxx_current_loader->GetFBConfigAttribSGIX(dpy, config, attribute, value);
-}
-
-GLXFBConfigSGIX * glx_sgix_fbconfig::glXChooseFBConfigSGIX(Display* dpy, int screen, int* attrib_list, int* nelements)
-{
-    return glxxx_current_loader->ChooseFBConfigSGIX(dpy, screen, attrib_list, nelements);
-}
-
-GLXPixmap glx_sgix_fbconfig::glXCreateGLXPixmapWithConfigSGIX(Display* dpy, GLXFBConfigSGIX config, Pixmap pixmap)
-{
-    return glxxx_current_loader->CreateGLXPixmapWithConfigSGIX(dpy, config, pixmap);
-}
-
-GLXContext glx_sgix_fbconfig::glXCreateContextWithConfigSGIX(Display* dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct)
-{
-    return glxxx_current_loader->CreateContextWithConfigSGIX(dpy, config, render_type, share_list, direct);
-}
-
-XVisualInfo * glx_sgix_fbconfig::glXGetVisualFromFBConfigSGIX(Display* dpy, GLXFBConfigSGIX config)
-{
-    return glxxx_current_loader->GetVisualFromFBConfigSGIX(dpy, config);
-}
-
-GLXFBConfigSGIX glx_sgix_fbconfig::glXGetFBConfigFromVisualSGIX(Display* dpy, XVisualInfo* vis)
-{
-    return glxxx_current_loader->GetFBConfigFromVisualSGIX(dpy, vis);
-}
-
-
-
-bool load_glx_sgix_pbuffer()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_sgix_pbuffer() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-    
-    glxxx_current_loader->CreateGLXPbufferSGIX = (PFNGLXCREATEGLXPBUFFERSGIXPROC) glXxxGetProcAddr("glXCreateGLXPbufferSGIX");
-    if (!glxxx_current_loader->CreateGLXPbufferSGIX) is_loaded = false;
-    
-    glxxx_current_loader->DestroyGLXPbufferSGIX = (PFNGLXDESTROYGLXPBUFFERSGIXPROC) glXxxGetProcAddr("glXDestroyGLXPbufferSGIX");
-    if (!glxxx_current_loader->DestroyGLXPbufferSGIX) is_loaded = false;
-    
-    glxxx_current_loader->QueryGLXPbufferSGIX = (PFNGLXQUERYGLXPBUFFERSGIXPROC) glXxxGetProcAddr("glXQueryGLXPbufferSGIX");
-    if (!glxxx_current_loader->QueryGLXPbufferSGIX) is_loaded = false;
-    
-    glxxx_current_loader->SelectEventSGIX = (PFNGLXSELECTEVENTSGIXPROC) glXxxGetProcAddr("glXSelectEventSGIX");
-    if (!glxxx_current_loader->SelectEventSGIX) is_loaded = false;
-    
-    glxxx_current_loader->GetSelectedEventSGIX = (PFNGLXGETSELECTEDEVENTSGIXPROC) glXxxGetProcAddr("glXGetSelectedEventSGIX");
-    if (!glxxx_current_loader->GetSelectedEventSGIX) is_loaded = false;
-        
-    return is_loaded;
-}
-
-bool has_glx_sgix_pbuffer()
-{
-    return glXxxIsExtensionSupported("GLX_SGIX_pbuffer");
-}
-
-
-GLXPbufferSGIX glx_sgix_pbuffer::glXCreateGLXPbufferSGIX(Display* dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int* attrib_list)
-{
-    return glxxx_current_loader->CreateGLXPbufferSGIX(dpy, config, width, height, attrib_list);
-}
-
-void glx_sgix_pbuffer::glXDestroyGLXPbufferSGIX(Display* dpy, GLXPbufferSGIX pbuf)
-{
-    glxxx_current_loader->DestroyGLXPbufferSGIX(dpy, pbuf);
-}
-
-int glx_sgix_pbuffer::glXQueryGLXPbufferSGIX(Display* dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int* value)
-{
-    return glxxx_current_loader->QueryGLXPbufferSGIX(dpy, pbuf, attribute, value);
-}
-
-void glx_sgix_pbuffer::glXSelectEventSGIX(Display* dpy, GLXDrawable drawable, unsigned long mask)
-{
-    glxxx_current_loader->SelectEventSGIX(dpy, drawable, mask);
-}
-
-void glx_sgix_pbuffer::glXGetSelectedEventSGIX(Display* dpy, GLXDrawable drawable, unsigned long* mask)
-{
-    glxxx_current_loader->GetSelectedEventSGIX(dpy, drawable, mask);
-}
-
-
-
-bool load_glx_sgi_cushion()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_sgi_cushion() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-    
-    glxxx_current_loader->CushionSGI = (PFNGLXCUSHIONSGIPROC) glXxxGetProcAddr("glXCushionSGI");
-    if (!glxxx_current_loader->CushionSGI) is_loaded = false;
-        
-    return is_loaded;
-}
-
-bool has_glx_sgi_cushion()
-{
-    return glXxxIsExtensionSupported("GLX_SGI_cushion");
-}
-
-
-void glx_sgi_cushion::glXCushionSGI(Display* dpy, Window window, float cushion)
-{
-    glxxx_current_loader->CushionSGI(dpy, window, cushion);
-}
-
-
-
-bool load_glx_sgix_video_resize()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_sgix_video_resize() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-    
-    glxxx_current_loader->BindChannelToWindowSGIX = (PFNGLXBINDCHANNELTOWINDOWSGIXPROC) glXxxGetProcAddr("glXBindChannelToWindowSGIX");
-    if (!glxxx_current_loader->BindChannelToWindowSGIX) is_loaded = false;
-    
-    glxxx_current_loader->ChannelRectSGIX = (PFNGLXCHANNELRECTSGIXPROC) glXxxGetProcAddr("glXChannelRectSGIX");
-    if (!glxxx_current_loader->ChannelRectSGIX) is_loaded = false;
-    
-    glxxx_current_loader->QueryChannelRectSGIX = (PFNGLXQUERYCHANNELRECTSGIXPROC) glXxxGetProcAddr("glXQueryChannelRectSGIX");
-    if (!glxxx_current_loader->QueryChannelRectSGIX) is_loaded = false;
-    
-    glxxx_current_loader->QueryChannelDeltasSGIX = (PFNGLXQUERYCHANNELDELTASSGIXPROC) glXxxGetProcAddr("glXQueryChannelDeltasSGIX");
-    if (!glxxx_current_loader->QueryChannelDeltasSGIX) is_loaded = false;
-    
-    glxxx_current_loader->ChannelRectSyncSGIX = (PFNGLXCHANNELRECTSYNCSGIXPROC) glXxxGetProcAddr("glXChannelRectSyncSGIX");
-    if (!glxxx_current_loader->ChannelRectSyncSGIX) is_loaded = false;
-        
-    return is_loaded;
-}
-
-bool has_glx_sgix_video_resize()
-{
-    return glXxxIsExtensionSupported("GLX_SGIX_video_resize");
-}
-
-
-int glx_sgix_video_resize::glXBindChannelToWindowSGIX(Display* display, int screen, int channel, Window window)
-{
-    return glxxx_current_loader->BindChannelToWindowSGIX(display, screen, channel, window);
-}
-
-int glx_sgix_video_resize::glXChannelRectSGIX(Display* display, int screen, int channel, int x, int y, int w, int h)
-{
-    return glxxx_current_loader->ChannelRectSGIX(display, screen, channel, x, y, w, h);
-}
-
-int glx_sgix_video_resize::glXQueryChannelRectSGIX(Display* display, int screen, int channel, int* dx, int* dy, int* dw, int* dh)
-{
-    return glxxx_current_loader->QueryChannelRectSGIX(display, screen, channel, dx, dy, dw, dh);
-}
-
-int glx_sgix_video_resize::glXQueryChannelDeltasSGIX(Display* display, int screen, int channel, int* x, int* y, int* w, int* h)
-{
-    return glxxx_current_loader->QueryChannelDeltasSGIX(display, screen, channel, x, y, w, h);
-}
-
-int glx_sgix_video_resize::glXChannelRectSyncSGIX(Display* display, int screen, int channel, GLenum synctype)
-{
-    return glxxx_current_loader->ChannelRectSyncSGIX(display, screen, channel, synctype);
-}
-
-#ifdef _DM_BUFFER_H_
-
-bool load_glx_sgix_dmbuffer()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_sgix_dmbuffer() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-    
-    glxxx_current_loader->AssociateDMPbufferSGIX = (PFNGLXASSOCIATEDMPBUFFERSGIXPROC) glXxxGetProcAddr("glXAssociateDMPbufferSGIX");
-    if (!glxxx_current_loader->AssociateDMPbufferSGIX) is_loaded = false;
-        
-    return is_loaded;
-}
-
-bool has_glx_sgix_dmbuffer()
-{
-    return glXxxIsExtensionSupported("GLX_SGIX_dmbuffer");
-}
-
-
-Bool glx_sgix_dmbuffer::glXAssociateDMPbufferSGIX(Display* dpy, GLXPbufferSGIX pbuffer, DMparams* params, DMbuffer dmbuffer)
-{
-    return glxxx_current_loader->AssociateDMPbufferSGIX(dpy, pbuffer, params, dmbuffer);
-}
-#endif /* _DM_BUFFER_H_ */
-
-
-bool load_glx_sgix_swap_group()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_sgix_swap_group() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-    
-    glxxx_current_loader->JoinSwapGroupSGIX = (PFNGLXJOINSWAPGROUPSGIXPROC) glXxxGetProcAddr("glXJoinSwapGroupSGIX");
-    if (!glxxx_current_loader->JoinSwapGroupSGIX) is_loaded = false;
-        
-    return is_loaded;
-}
-
-bool has_glx_sgix_swap_group()
-{
-    return glXxxIsExtensionSupported("GLX_SGIX_swap_group");
-}
-
-
-void glx_sgix_swap_group::glXJoinSwapGroupSGIX(Display* dpy, GLXDrawable drawable, GLXDrawable member)
-{
-    glxxx_current_loader->JoinSwapGroupSGIX(dpy, drawable, member);
-}
-
-
-
-bool load_glx_sgix_swap_barrier()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_sgix_swap_barrier() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-    
-    glxxx_current_loader->BindSwapBarrierSGIX = (PFNGLXBINDSWAPBARRIERSGIXPROC) glXxxGetProcAddr("glXBindSwapBarrierSGIX");
-    if (!glxxx_current_loader->BindSwapBarrierSGIX) is_loaded = false;
-    
-    glxxx_current_loader->QueryMaxSwapBarriersSGIX = (PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) glXxxGetProcAddr("glXQueryMaxSwapBarriersSGIX");
-    if (!glxxx_current_loader->QueryMaxSwapBarriersSGIX) is_loaded = false;
-        
-    return is_loaded;
-}
-
-bool has_glx_sgix_swap_barrier()
-{
-    return glXxxIsExtensionSupported("GLX_SGIX_swap_barrier");
-}
-
-
-void glx_sgix_swap_barrier::glXBindSwapBarrierSGIX(Display* dpy, GLXDrawable drawable, int barrier)
-{
-    glxxx_current_loader->BindSwapBarrierSGIX(dpy, drawable, barrier);
-}
-
-Bool glx_sgix_swap_barrier::glXQueryMaxSwapBarriersSGIX(Display* dpy, int screen, int* max)
-{
-    return glxxx_current_loader->QueryMaxSwapBarriersSGIX(dpy, screen, max);
-}
-
-
-
-bool load_glx_sun_get_transparent_index()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_sun_get_transparent_index() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-    
-    glxxx_current_loader->GetTransparentIndexSUN = (PFNGLXGETTRANSPARENTINDEXSUNPROC) glXxxGetProcAddr("glXGetTransparentIndexSUN");
-    if (!glxxx_current_loader->GetTransparentIndexSUN) is_loaded = false;
-        
-    return is_loaded;
-}
-
-bool has_glx_sun_get_transparent_index()
-{
-    return glXxxIsExtensionSupported("GLX_SUN_get_transparent_index");
-}
-
-
-Status glx_sun_get_transparent_index::glXGetTransparentIndexSUN(Display* dpy, Window overlay, Window underlay, long* pTransparentIndex)
-{
-    return glxxx_current_loader->GetTransparentIndexSUN(dpy, overlay, underlay, pTransparentIndex);
-}
-
-
-
-bool load_glx_mesa_copy_sub_buffer()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_mesa_copy_sub_buffer() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-    
-    glxxx_current_loader->CopySubBufferMESA = (PFNGLXCOPYSUBBUFFERMESAPROC) glXxxGetProcAddr("glXCopySubBufferMESA");
-    if (!glxxx_current_loader->CopySubBufferMESA) is_loaded = false;
-        
-    return is_loaded;
-}
-
-bool has_glx_mesa_copy_sub_buffer()
-{
-    return glXxxIsExtensionSupported("GLX_MESA_copy_sub_buffer");
-}
-
-
-void glx_mesa_copy_sub_buffer::glXCopySubBufferMESA(Display* dpy, GLXDrawable drawable, int x, int y, int width, int height)
-{
-    glxxx_current_loader->CopySubBufferMESA(dpy, drawable, x, y, width, height);
-}
-
-
-
-bool load_glx_mesa_pixmap_colormap()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_mesa_pixmap_colormap() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-    
-    glxxx_current_loader->CreateGLXPixmapMESA = (PFNGLXCREATEGLXPIXMAPMESAPROC) glXxxGetProcAddr("glXCreateGLXPixmapMESA");
-    if (!glxxx_current_loader->CreateGLXPixmapMESA) is_loaded = false;
-        
-    return is_loaded;
-}
-
-bool has_glx_mesa_pixmap_colormap()
-{
-    return glXxxIsExtensionSupported("GLX_MESA_pixmap_colormap");
-}
-
-
-GLXPixmap glx_mesa_pixmap_colormap::glXCreateGLXPixmapMESA(Display* dpy, XVisualInfo* visual, Pixmap pixmap, Colormap cmap)
-{
-    return glxxx_current_loader->CreateGLXPixmapMESA(dpy, visual, pixmap, cmap);
-}
-
-
-
-bool load_glx_mesa_release_buffers()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_mesa_release_buffers() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-    
-    glxxx_current_loader->ReleaseBuffersMESA = (PFNGLXRELEASEBUFFERSMESAPROC) glXxxGetProcAddr("glXReleaseBuffersMESA");
-    if (!glxxx_current_loader->ReleaseBuffersMESA) is_loaded = false;
-        
-    return is_loaded;
-}
-
-bool has_glx_mesa_release_buffers()
-{
-    return glXxxIsExtensionSupported("GLX_MESA_release_buffers");
-}
-
-
-Bool glx_mesa_release_buffers::glXReleaseBuffersMESA(Display* dpy, GLXDrawable drawable)
-{
-    return glxxx_current_loader->ReleaseBuffersMESA(dpy, drawable);
-}
-
-
-
-bool load_glx_mesa_set_3dfx_mode()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_mesa_set_3dfx_mode() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-    
-    glxxx_current_loader->Set3DfxModeMESA = (PFNGLXSET3DFXMODEMESAPROC) glXxxGetProcAddr("glXSet3DfxModeMESA");
-    if (!glxxx_current_loader->Set3DfxModeMESA) is_loaded = false;
-        
-    return is_loaded;
-}
-
-bool has_glx_mesa_set_3dfx_mode()
-{
-    return glXxxIsExtensionSupported("GLX_MESA_set_3dfx_mode");
-}
-
-
-Bool glx_mesa_set_3dfx_mode::glXSet3DfxModeMESA(int mode)
-{
-    return glxxx_current_loader->Set3DfxModeMESA(mode);
-}
-
-
-
-bool load_glx_sgix_visual_select_group()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_sgix_visual_select_group() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-        
-    return is_loaded;
-}
-
-bool has_glx_sgix_visual_select_group()
-{
-    return glXxxIsExtensionSupported("GLX_SGIX_visual_select_group");
-}
-
-
-
-
-bool load_glx_oml_swap_method()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_oml_swap_method() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-        
-    return is_loaded;
-}
-
-bool has_glx_oml_swap_method()
-{
-    return glXxxIsExtensionSupported("GLX_OML_swap_method");
-}
-
-
-
-
-bool load_glx_oml_sync_control()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_oml_sync_control() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-    
-    glxxx_current_loader->GetSyncValuesOML = (PFNGLXGETSYNCVALUESOMLPROC) glXxxGetProcAddr("glXGetSyncValuesOML");
-    if (!glxxx_current_loader->GetSyncValuesOML) is_loaded = false;
-    
-    glxxx_current_loader->GetMscRateOML = (PFNGLXGETMSCRATEOMLPROC) glXxxGetProcAddr("glXGetMscRateOML");
-    if (!glxxx_current_loader->GetMscRateOML) is_loaded = false;
-    
-    glxxx_current_loader->SwapBuffersMscOML = (PFNGLXSWAPBUFFERSMSCOMLPROC) glXxxGetProcAddr("glXSwapBuffersMscOML");
-    if (!glxxx_current_loader->SwapBuffersMscOML) is_loaded = false;
-    
-    glxxx_current_loader->WaitForMscOML = (PFNGLXWAITFORMSCOMLPROC) glXxxGetProcAddr("glXWaitForMscOML");
-    if (!glxxx_current_loader->WaitForMscOML) is_loaded = false;
-    
-    glxxx_current_loader->WaitForSbcOML = (PFNGLXWAITFORSBCOMLPROC) glXxxGetProcAddr("glXWaitForSbcOML");
-    if (!glxxx_current_loader->WaitForSbcOML) is_loaded = false;
-        
-    return is_loaded;
-}
-
-bool has_glx_oml_sync_control()
-{
-    return glXxxIsExtensionSupported("GLX_OML_sync_control");
-}
-
-
-Bool glx_oml_sync_control::glXGetSyncValuesOML(Display* dpy, GLXDrawable drawable, int64_t* ust, int64_t* msc, int64_t* sbc)
-{
-    return glxxx_current_loader->GetSyncValuesOML(dpy, drawable, ust, msc, sbc);
-}
-
-Bool glx_oml_sync_control::glXGetMscRateOML(Display* dpy, GLXDrawable drawable, int32_t* numerator, int32_t* denominator)
-{
-    return glxxx_current_loader->GetMscRateOML(dpy, drawable, numerator, denominator);
-}
-
-int64_t glx_oml_sync_control::glXSwapBuffersMscOML(Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder)
-{
-    return glxxx_current_loader->SwapBuffersMscOML(dpy, drawable, target_msc, divisor, remainder);
-}
-
-Bool glx_oml_sync_control::glXWaitForMscOML(Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t* ust, int64_t* msc, int64_t* sbc)
-{
-    return glxxx_current_loader->WaitForMscOML(dpy, drawable, target_msc, divisor, remainder, ust, msc, sbc);
-}
-
-Bool glx_oml_sync_control::glXWaitForSbcOML(Display* dpy, GLXDrawable drawable, int64_t target_sbc, int64_t* ust, int64_t* msc, int64_t* sbc)
-{
-    return glxxx_current_loader->WaitForSbcOML(dpy, drawable, target_sbc, ust, msc, sbc);
-}
-
-
-
-bool load_glx_nv_float_buffer()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_nv_float_buffer() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-        
-    return is_loaded;
-}
-
-bool has_glx_nv_float_buffer()
-{
-    return glXxxIsExtensionSupported("GLX_NV_float_buffer");
-}
-
-
-
-
-bool load_glx_sgix_hyperpipe()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_sgix_hyperpipe() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-    
-    glxxx_current_loader->QueryHyperpipeNetworkSGIX = (PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) glXxxGetProcAddr("glXQueryHyperpipeNetworkSGIX");
-    if (!glxxx_current_loader->QueryHyperpipeNetworkSGIX) is_loaded = false;
-    
-    glxxx_current_loader->HyperpipeConfigSGIX = (PFNGLXHYPERPIPECONFIGSGIXPROC) glXxxGetProcAddr("glXHyperpipeConfigSGIX");
-    if (!glxxx_current_loader->HyperpipeConfigSGIX) is_loaded = false;
-    
-    glxxx_current_loader->QueryHyperpipeConfigSGIX = (PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) glXxxGetProcAddr("glXQueryHyperpipeConfigSGIX");
-    if (!glxxx_current_loader->QueryHyperpipeConfigSGIX) is_loaded = false;
-    
-    glxxx_current_loader->DestroyHyperpipeConfigSGIX = (PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) glXxxGetProcAddr("glXDestroyHyperpipeConfigSGIX");
-    if (!glxxx_current_loader->DestroyHyperpipeConfigSGIX) is_loaded = false;
-    
-    glxxx_current_loader->BindHyperpipeSGIX = (PFNGLXBINDHYPERPIPESGIXPROC) glXxxGetProcAddr("glXBindHyperpipeSGIX");
-    if (!glxxx_current_loader->BindHyperpipeSGIX) is_loaded = false;
-    
-    glxxx_current_loader->QueryHyperpipeBestAttribSGIX = (PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) glXxxGetProcAddr("glXQueryHyperpipeBestAttribSGIX");
-    if (!glxxx_current_loader->QueryHyperpipeBestAttribSGIX) is_loaded = false;
-    
-    glxxx_current_loader->HyperpipeAttribSGIX = (PFNGLXHYPERPIPEATTRIBSGIXPROC) glXxxGetProcAddr("glXHyperpipeAttribSGIX");
-    if (!glxxx_current_loader->HyperpipeAttribSGIX) is_loaded = false;
-    
-    glxxx_current_loader->QueryHyperpipeAttribSGIX = (PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) glXxxGetProcAddr("glXQueryHyperpipeAttribSGIX");
-    if (!glxxx_current_loader->QueryHyperpipeAttribSGIX) is_loaded = false;
-        
-    return is_loaded;
-}
-
-bool has_glx_sgix_hyperpipe()
-{
-    return glXxxIsExtensionSupported("GLX_SGIX_hyperpipe");
-}
-
-
-GLXHyperpipeNetworkSGIX * glx_sgix_hyperpipe::glXQueryHyperpipeNetworkSGIX(Display* dpy, int* npipes)
-{
-    return glxxx_current_loader->QueryHyperpipeNetworkSGIX(dpy, npipes);
-}
-
-int glx_sgix_hyperpipe::glXHyperpipeConfigSGIX(Display* dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX* cfg, int* hpId)
-{
-    return glxxx_current_loader->HyperpipeConfigSGIX(dpy, networkId, npipes, cfg, hpId);
-}
-
-GLXHyperpipeConfigSGIX * glx_sgix_hyperpipe::glXQueryHyperpipeConfigSGIX(Display* dpy, int hpId, int* npipes)
-{
-    return glxxx_current_loader->QueryHyperpipeConfigSGIX(dpy, hpId, npipes);
-}
-
-int glx_sgix_hyperpipe::glXDestroyHyperpipeConfigSGIX(Display* dpy, int hpId)
-{
-    return glxxx_current_loader->DestroyHyperpipeConfigSGIX(dpy, hpId);
-}
-
-int glx_sgix_hyperpipe::glXBindHyperpipeSGIX(Display* dpy, int hpId)
-{
-    return glxxx_current_loader->BindHyperpipeSGIX(dpy, hpId);
-}
-
-int glx_sgix_hyperpipe::glXQueryHyperpipeBestAttribSGIX(Display* dpy, int timeSlice, int attrib, int size, void* attribList, void* returnAttribList)
-{
-    return glxxx_current_loader->QueryHyperpipeBestAttribSGIX(dpy, timeSlice, attrib, size, attribList, returnAttribList);
-}
-
-int glx_sgix_hyperpipe::glXHyperpipeAttribSGIX(Display* dpy, int timeSlice, int attrib, int size, void* attribList)
-{
-    return glxxx_current_loader->HyperpipeAttribSGIX(dpy, timeSlice, attrib, size, attribList);
-}
-
-int glx_sgix_hyperpipe::glXQueryHyperpipeAttribSGIX(Display* dpy, int timeSlice, int attrib, int size, void* returnAttribList)
-{
-    return glxxx_current_loader->QueryHyperpipeAttribSGIX(dpy, timeSlice, attrib, size, returnAttribList);
-}
-
-
-
-bool load_glx_mesa_agp_offset()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_mesa_agp_offset() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-    
-    glxxx_current_loader->GetAGPOffsetMESA = (PFNGLXGETAGPOFFSETMESAPROC) glXxxGetProcAddr("glXGetAGPOffsetMESA");
-    if (!glxxx_current_loader->GetAGPOffsetMESA) is_loaded = false;
-        
-    return is_loaded;
-}
-
-bool has_glx_mesa_agp_offset()
-{
-    return glXxxIsExtensionSupported("GLX_MESA_agp_offset");
-}
-
-
-unsigned int glx_mesa_agp_offset::glXGetAGPOffsetMESA(const void* pointer)
-{
-    return glxxx_current_loader->GetAGPOffsetMESA(pointer);
-}
-
-
-
-bool load_glx_ext_fbconfig_packed_float()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_ext_fbconfig_packed_float() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-        
-    return is_loaded;
-}
-
-bool has_glx_ext_fbconfig_packed_float()
-{
-    return glXxxIsExtensionSupported("GLX_EXT_fbconfig_packed_float");
-}
-
-
-
-
-bool load_glx_ext_framebuffer_srgb()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_ext_framebuffer_srgb() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-        
-    return is_loaded;
-}
-
-bool has_glx_ext_framebuffer_srgb()
-{
-    return glXxxIsExtensionSupported("GLX_EXT_framebuffer_sRGB");
-}
-
-
-
-
-bool load_glx_ext_texture_from_pixmap()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_ext_texture_from_pixmap() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-    
-    glxxx_current_loader->BindTexImageEXT = (PFNGLXBINDTEXIMAGEEXTPROC) glXxxGetProcAddr("glXBindTexImageEXT");
-    if (!glxxx_current_loader->BindTexImageEXT) is_loaded = false;
-    
-    glxxx_current_loader->ReleaseTexImageEXT = (PFNGLXRELEASETEXIMAGEEXTPROC) glXxxGetProcAddr("glXReleaseTexImageEXT");
-    if (!glxxx_current_loader->ReleaseTexImageEXT) is_loaded = false;
-        
-    return is_loaded;
-}
-
-bool has_glx_ext_texture_from_pixmap()
-{
-    return glXxxIsExtensionSupported("GLX_EXT_texture_from_pixmap");
-}
-
-
-void glx_ext_texture_from_pixmap::glXBindTexImageEXT(Display* dpy, GLXDrawable drawable, int buffer, const int* attrib_list)
-{
-    glxxx_current_loader->BindTexImageEXT(dpy, drawable, buffer, attrib_list);
-}
-
-void glx_ext_texture_from_pixmap::glXReleaseTexImageEXT(Display* dpy, GLXDrawable drawable, int buffer)
-{
-    glxxx_current_loader->ReleaseTexImageEXT(dpy, drawable, buffer);
-}
-
-
-
-bool load_glx_nv_present_video()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_nv_present_video() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-    
-    glxxx_current_loader->EnumerateVideoDevicesNV = (PFNGLXENUMERATEVIDEODEVICESNVPROC) glXxxGetProcAddr("glXEnumerateVideoDevicesNV");
-    if (!glxxx_current_loader->EnumerateVideoDevicesNV) is_loaded = false;
-    
-    glxxx_current_loader->BindVideoDeviceNV = (PFNGLXBINDVIDEODEVICENVPROC) glXxxGetProcAddr("glXBindVideoDeviceNV");
-    if (!glxxx_current_loader->BindVideoDeviceNV) is_loaded = false;
-        
-    return is_loaded;
-}
-
-bool has_glx_nv_present_video()
-{
-    return glXxxIsExtensionSupported("GLX_NV_present_video");
-}
-
-
-unsigned int * glx_nv_present_video::glXEnumerateVideoDevicesNV(Display* dpy, int screen, int* nelements)
-{
-    return glxxx_current_loader->EnumerateVideoDevicesNV(dpy, screen, nelements);
-}
-
-int glx_nv_present_video::glXBindVideoDeviceNV(Display* dpy, unsigned int video_slot, unsigned int video_device, const int* attrib_list)
-{
-    return glxxx_current_loader->BindVideoDeviceNV(dpy, video_slot, video_device, attrib_list);
-}
-
-
-
-bool load_glx_nv_video_output()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_nv_video_output() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-    
-    glxxx_current_loader->GetVideoDeviceNV = (PFNGLXGETVIDEODEVICENVPROC) glXxxGetProcAddr("glXGetVideoDeviceNV");
-    if (!glxxx_current_loader->GetVideoDeviceNV) is_loaded = false;
-    
-    glxxx_current_loader->ReleaseVideoDeviceNV = (PFNGLXRELEASEVIDEODEVICENVPROC) glXxxGetProcAddr("glXReleaseVideoDeviceNV");
-    if (!glxxx_current_loader->ReleaseVideoDeviceNV) is_loaded = false;
-    
-    glxxx_current_loader->BindVideoImageNV = (PFNGLXBINDVIDEOIMAGENVPROC) glXxxGetProcAddr("glXBindVideoImageNV");
-    if (!glxxx_current_loader->BindVideoImageNV) is_loaded = false;
-    
-    glxxx_current_loader->ReleaseVideoImageNV = (PFNGLXRELEASEVIDEOIMAGENVPROC) glXxxGetProcAddr("glXReleaseVideoImageNV");
-    if (!glxxx_current_loader->ReleaseVideoImageNV) is_loaded = false;
-    
-    glxxx_current_loader->SendPbufferToVideoNV = (PFNGLXSENDPBUFFERTOVIDEONVPROC) glXxxGetProcAddr("glXSendPbufferToVideoNV");
-    if (!glxxx_current_loader->SendPbufferToVideoNV) is_loaded = false;
-    
-    glxxx_current_loader->GetVideoInfoNV = (PFNGLXGETVIDEOINFONVPROC) glXxxGetProcAddr("glXGetVideoInfoNV");
-    if (!glxxx_current_loader->GetVideoInfoNV) is_loaded = false;
-        
-    return is_loaded;
-}
-
-bool has_glx_nv_video_output()
-{
-    return glXxxIsExtensionSupported("GLX_NV_video_output");
-}
-
-
-int glx_nv_video_output::glXGetVideoDeviceNV(Display* dpy, int screen, int numVideoDevices, GLXVideoDeviceNV* pVideoDevice)
-{
-    return glxxx_current_loader->GetVideoDeviceNV(dpy, screen, numVideoDevices, pVideoDevice);
-}
-
-int glx_nv_video_output::glXReleaseVideoDeviceNV(Display* dpy, int screen, GLXVideoDeviceNV VideoDevice)
-{
-    return glxxx_current_loader->ReleaseVideoDeviceNV(dpy, screen, VideoDevice);
-}
-
-int glx_nv_video_output::glXBindVideoImageNV(Display* dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer)
-{
-    return glxxx_current_loader->BindVideoImageNV(dpy, VideoDevice, pbuf, iVideoBuffer);
-}
-
-int glx_nv_video_output::glXReleaseVideoImageNV(Display* dpy, GLXPbuffer pbuf)
-{
-    return glxxx_current_loader->ReleaseVideoImageNV(dpy, pbuf);
-}
-
-int glx_nv_video_output::glXSendPbufferToVideoNV(Display* dpy, GLXPbuffer pbuf, int iBufferType, unsigned long* pulCounterPbuffer, GLboolean bBlock)
-{
-    return glxxx_current_loader->SendPbufferToVideoNV(dpy, pbuf, iBufferType, pulCounterPbuffer, bBlock);
-}
-
-int glx_nv_video_output::glXGetVideoInfoNV(Display* dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long* pulCounterOutputPbuffer, unsigned long* pulCounterOutputVideo)
-{
-    return glxxx_current_loader->GetVideoInfoNV(dpy, screen, VideoDevice, pulCounterOutputPbuffer, pulCounterOutputVideo);
-}
-
-
-
-bool load_glx_nv_swap_group()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_nv_swap_group() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-    
-    glxxx_current_loader->JoinSwapGroupNV = (PFNGLXJOINSWAPGROUPNVPROC) glXxxGetProcAddr("glXJoinSwapGroupNV");
-    if (!glxxx_current_loader->JoinSwapGroupNV) is_loaded = false;
-    
-    glxxx_current_loader->BindSwapBarrierNV = (PFNGLXBINDSWAPBARRIERNVPROC) glXxxGetProcAddr("glXBindSwapBarrierNV");
-    if (!glxxx_current_loader->BindSwapBarrierNV) is_loaded = false;
-    
-    glxxx_current_loader->QuerySwapGroupNV = (PFNGLXQUERYSWAPGROUPNVPROC) glXxxGetProcAddr("glXQuerySwapGroupNV");
-    if (!glxxx_current_loader->QuerySwapGroupNV) is_loaded = false;
-    
-    glxxx_current_loader->QueryMaxSwapGroupsNV = (PFNGLXQUERYMAXSWAPGROUPSNVPROC) glXxxGetProcAddr("glXQueryMaxSwapGroupsNV");
-    if (!glxxx_current_loader->QueryMaxSwapGroupsNV) is_loaded = false;
-    
-    glxxx_current_loader->QueryFrameCountNV = (PFNGLXQUERYFRAMECOUNTNVPROC) glXxxGetProcAddr("glXQueryFrameCountNV");
-    if (!glxxx_current_loader->QueryFrameCountNV) is_loaded = false;
-    
-    glxxx_current_loader->ResetFrameCountNV = (PFNGLXRESETFRAMECOUNTNVPROC) glXxxGetProcAddr("glXResetFrameCountNV");
-    if (!glxxx_current_loader->ResetFrameCountNV) is_loaded = false;
-        
-    return is_loaded;
-}
-
-bool has_glx_nv_swap_group()
-{
-    return glXxxIsExtensionSupported("GLX_NV_swap_group");
-}
-
-
-Bool glx_nv_swap_group::glXJoinSwapGroupNV(Display* dpy, GLXDrawable drawable, GLuint group)
-{
-    return glxxx_current_loader->JoinSwapGroupNV(dpy, drawable, group);
-}
-
-Bool glx_nv_swap_group::glXBindSwapBarrierNV(Display* dpy, GLuint group, GLuint barrier)
-{
-    return glxxx_current_loader->BindSwapBarrierNV(dpy, group, barrier);
-}
-
-Bool glx_nv_swap_group::glXQuerySwapGroupNV(Display* dpy, GLXDrawable drawable, GLuint* group, GLuint* barrier)
-{
-    return glxxx_current_loader->QuerySwapGroupNV(dpy, drawable, group, barrier);
-}
-
-Bool glx_nv_swap_group::glXQueryMaxSwapGroupsNV(Display* dpy, int screen, GLuint* maxGroups, GLuint* maxBarriers)
-{
-    return glxxx_current_loader->QueryMaxSwapGroupsNV(dpy, screen, maxGroups, maxBarriers);
-}
-
-Bool glx_nv_swap_group::glXQueryFrameCountNV(Display* dpy, int screen, GLuint* count)
-{
-    return glxxx_current_loader->QueryFrameCountNV(dpy, screen, count);
-}
-
-Bool glx_nv_swap_group::glXResetFrameCountNV(Display* dpy, int screen)
-{
-    return glxxx_current_loader->ResetFrameCountNV(dpy, screen);
-}
-
-
-
-bool load_glx_nv_video_capture()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_nv_video_capture() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-    
-    glxxx_current_loader->BindVideoCaptureDeviceNV = (PFNGLXBINDVIDEOCAPTUREDEVICENVPROC) glXxxGetProcAddr("glXBindVideoCaptureDeviceNV");
-    if (!glxxx_current_loader->BindVideoCaptureDeviceNV) is_loaded = false;
-    
-    glxxx_current_loader->EnumerateVideoCaptureDevicesNV = (PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC) glXxxGetProcAddr("glXEnumerateVideoCaptureDevicesNV");
-    if (!glxxx_current_loader->EnumerateVideoCaptureDevicesNV) is_loaded = false;
-    
-    glxxx_current_loader->LockVideoCaptureDeviceNV = (PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC) glXxxGetProcAddr("glXLockVideoCaptureDeviceNV");
-    if (!glxxx_current_loader->LockVideoCaptureDeviceNV) is_loaded = false;
-    
-    glxxx_current_loader->QueryVideoCaptureDeviceNV = (PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC) glXxxGetProcAddr("glXQueryVideoCaptureDeviceNV");
-    if (!glxxx_current_loader->QueryVideoCaptureDeviceNV) is_loaded = false;
-    
-    glxxx_current_loader->ReleaseVideoCaptureDeviceNV = (PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC) glXxxGetProcAddr("glXReleaseVideoCaptureDeviceNV");
-    if (!glxxx_current_loader->ReleaseVideoCaptureDeviceNV) is_loaded = false;
-        
-    return is_loaded;
-}
-
-bool has_glx_nv_video_capture()
-{
-    return glXxxIsExtensionSupported("GLX_NV_video_capture");
-}
-
-
-int glx_nv_video_capture::glXBindVideoCaptureDeviceNV(Display* dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device)
-{
-    return glxxx_current_loader->BindVideoCaptureDeviceNV(dpy, video_capture_slot, device);
-}
-
-GLXVideoCaptureDeviceNV * glx_nv_video_capture::glXEnumerateVideoCaptureDevicesNV(Display* dpy, int screen, int* nelements)
-{
-    return glxxx_current_loader->EnumerateVideoCaptureDevicesNV(dpy, screen, nelements);
-}
-
-void glx_nv_video_capture::glXLockVideoCaptureDeviceNV(Display* dpy, GLXVideoCaptureDeviceNV device)
-{
-    glxxx_current_loader->LockVideoCaptureDeviceNV(dpy, device);
-}
-
-int glx_nv_video_capture::glXQueryVideoCaptureDeviceNV(Display* dpy, GLXVideoCaptureDeviceNV device, int attribute, int* value)
-{
-    return glxxx_current_loader->QueryVideoCaptureDeviceNV(dpy, device, attribute, value);
-}
-
-void glx_nv_video_capture::glXReleaseVideoCaptureDeviceNV(Display* dpy, GLXVideoCaptureDeviceNV device)
-{
-    glxxx_current_loader->ReleaseVideoCaptureDeviceNV(dpy, device);
-}
-
-
-
-bool load_glx_ext_swap_control()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_ext_swap_control() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-    
-    glxxx_current_loader->SwapIntervalEXT = (PFNGLXSWAPINTERVALEXTPROC) glXxxGetProcAddr("glXSwapIntervalEXT");
-    if (!glxxx_current_loader->SwapIntervalEXT) is_loaded = false;
-        
-    return is_loaded;
-}
-
-bool has_glx_ext_swap_control()
-{
-    return glXxxIsExtensionSupported("GLX_EXT_swap_control");
-}
-
-
-int glx_ext_swap_control::glXSwapIntervalEXT(Display* dpy, GLXDrawable drawable, int interval)
-{
-    return glxxx_current_loader->SwapIntervalEXT(dpy, drawable, interval);
-}
-
-
-
-bool load_glx_nv_copy_image()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_nv_copy_image() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-    
-    glxxx_current_loader->CopyImageSubDataNV = (PFNGLXCOPYIMAGESUBDATANVPROC) glXxxGetProcAddr("glXCopyImageSubDataNV");
-    if (!glxxx_current_loader->CopyImageSubDataNV) is_loaded = false;
-        
-    return is_loaded;
-}
-
-bool has_glx_nv_copy_image()
-{
-    return glXxxIsExtensionSupported("GLX_NV_copy_image");
-}
-
-
-void glx_nv_copy_image::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)
-{
-    glxxx_current_loader->CopyImageSubDataNV(dpy, srcCtx, srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstCtx, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, width, height, depth);
-}
-
-
-
-bool load_glx_intel_swap_event()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_intel_swap_event() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-        
-    return is_loaded;
-}
-
-bool has_glx_intel_swap_event()
-{
-    return glXxxIsExtensionSupported("GLX_INTEL_swap_event");
-}
-
-
-
-
-bool load_glx_nv_multisample_coverage()
-{
-    assert(glXxxGetCurrentCtx() && "load_glx_nv_multisample_coverage() called without a current context");
-
-    if (glxxx_current_loader == 0) {
-        glxxx_loaders.push_back(std::tr1::shared_ptr<glxxxLoader>(new glxxxLoader));
-        glxxx_current_loader = glxxx_loaders[0].get();
-    }
-
-    bool is_loaded = true;
-
-        
-    return is_loaded;
-}
-
-bool has_glx_nv_multisample_coverage()
-{
-    return glXxxIsExtensionSupported("GLX_NV_multisample_coverage");
-}
-
-
-bool has_glx_1_3() { return glXxxIsVersionSupported(1, 3); }
-bool has_glx_1_4() { return glXxxIsVersionSupported(1, 4); }
-
-bool load_glx_1_3() { return load_glx_version_1_3(); }
-bool load_glx_1_4() { return load_glx_version_1_3() && load_glx_version_1_4(); }
-
-#endif // __linux__
+ */
+
+// Comment the following line to disable thread local storage
+#define GLXX_TLS 
+
+#ifdef __linux__
+
+#include <cassert>
+#include <string>
+#include <cstring>
+#include <vector>
+#include <set>
+#include <sstream>
+#include <iterator>