Commits

yotis committed 38e7244

Fixed linux compilation failures due to previous changes

  • Participants
  • Parent commits f29cf75

Comments (0)

Files changed (12)

 glob:generator/unprocessed_glx.spec.txt
 glob:*.pyc
 glob:*.lib
+glob:*.a
 glob:*.pro.user*
+glob:*~

generator/generator.py

+# -*- coding: utf-8 -*-
 # Copyright (C) 2011, Giotis Nikos <giotis.nikos[]gmail.com>
 #
 # This program is distributed under the terms and conditions of the GNU
 import urllib
 import glxx, wglxx, glXxx
     
-if __name__ == '__main__':
-    if not os.path.exists('specs'):
-        os.mkdir('specs')
-    
+def download_specs():
     urllib.urlretrieve("http://www.opengl.org/registry/api/enumext.spec", "specs/enumext.spec")
     urllib.urlretrieve("http://www.opengl.org/registry/api/gl.spec", "specs/gl.spec")
     urllib.urlretrieve("http://www.opengl.org/registry/api/gl.tm", "specs/gl.tm")
     urllib.urlretrieve("http://www.opengl.org/registry/api/glxext.spec", "specs/glxext.spec")
     urllib.urlretrieve("http://www.opengl.org/registry/api/glx.tm", "specs/glx.tm")
     
+if __name__ == '__main__':
+    if not os.path.exists('specs'):
+        os.mkdir('specs')
+    
+    download_specs()
+    
     glxx.make_glxx()
     wglxx.make_wglxx()
     glXxx.make_glXxx()

generator/glXxx.py

+# -*- coding: utf-8 -*-
 # Copyright (C) 2011, Giotis Nikos <giotis.nikos[]gmail.com>
 #
 # This program is distributed under the terms and conditions of the GNU
 #include <GL/glx.h>
 #include <cassert>
 #include <string>
+#include <cstring>
 #include <vector>
 #include <set>
 #include <sstream>
 #include <algorithm>
 #include <memory>
 
+#include <tr1/memory>
+
+
 namespace glXxx
 {
     GLXContext GetCurrentCtx()

generator/glxx.py

+# -*- coding: utf-8 -*-
 # Copyright (C) 2011, Giotis Nikos <giotis.nikos[]gmail.com>
 #
 # This program is distributed under the terms and conditions of the GNU
 #include <iostream>
 #include <iterator>
 #include <string>
+#include <cstring>
 #include <sstream>
 #include <vector>
 #include <set>
 #include <algorithm>
 #include <memory>
+#ifdef __linux__
+    #include <tr1/memory>
+#endif
 
 
 #ifdef __linux__

generator/parse.py

+# -*- coding: utf-8 -*-
 # Copyright (C) 2011, Giotis Nikos <giotis.nikos[]gmail.com>
 #
 # This program is distributed under the terms and conditions of the GNU
     
     # The first passthrus
     out_h = []
+    out_cpp_pre = []
     out_cpp = []
     #out_h_passthru = ''
     first_lines = [ps.lstrip('passthru:').strip() for ps in passthrus['first']]
             deprecated_versions.insert(categories.index(missing_depr_cat)+1, missing_depr_cat + '_DEPRECATED')
         print deprecated_versions
 
+
 #############################################
 # Big cpp loader with all functions.
-###################
-        
-    out_cpp.append('''
+###################    
+    out_cpp_pre.append('''
     struct Loader {''')
-    for f in functions:
-        out_cpp.append(
-'        typedef %s (APIENTRYP PFN%s%sPROC)(%s);' % 
-                    (tm[f.returns], prefix.upper(), f.name.upper(), ', '.join(f.make_param_list(tm))))
-        out_cpp.append(
-'        PFN%s%sPROC %s;' % (prefix.upper(), f.name.upper(), f.name))
-    out_cpp.append('''
-        Loader() { memset(this, 0, sizeof(Loader)); }
-    };
     
-#ifdef GLXX_TLS
-    #if defined(_WIN32) || defined(WIN32)
-    __declspec(thread) Loader* current_loader = 0;
-    #endif
-    #if defined(__linux__)
-    __thread Loader* current_loader = 0;
-    #endif
-#else
-    Loader* current_loader = 0;
-#endif //GLXX_TLS
-
-
-    std::vector<std::tr1::shared_ptr<Loader> > loaders;
-    std::set<GLuint> unused_loader_indices;
-
-    GLuint GenLoader()
-    {
-        if (unused_loader_indices.empty()) {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            return loaders.size() - 1;
-        } else {
-            GLuint first_unused_loader = *(unused_loader_indices.begin());
-            loaders[first_unused_loader].reset(new Loader);
-            unused_loader_indices.erase(unused_loader_indices.begin());
-            return first_unused_loader;
-        }
-    }
-
-    void BindLoader(GLuint loader)
-    {
-        current_loader = loaders[loader].get();
-    }
-
-    void DeleteLoader(GLuint loader)
-    {
-        if (loaders[loader].get() == current_loader) {
-            if (!loaders.empty())
-                current_loader = loaders[0].get();
-            else
-                current_loader = 0;
-        }
-        loaders[loader].reset();
-        unused_loader_indices.insert(loader);
-    }
-
-    ''')
-    
-        
+          
         
     for category in categories:
         category_functions = []
 ########################################################
         passes = [p for p in passes if p.startswith('#ifdef')]
         passes_end = [p for p in passes_end if p.startswith('#endif')]
+        
+        
+        ## loader struct part
+        out_cpp_pre.append('\n'.join([p for p in passes]))
+        for f in fs:
+            out_cpp_pre.append(
+'        typedef %s (APIENTRYP PFN%s%sPROC)(%s);' % 
+                    (tm[f.returns], prefix.upper(), f.name.upper(), ', '.join(f.make_param_list(tm))))
+            out_cpp_pre.append(
+'        PFN%s%sPROC %s;' % (prefix.upper(), f.name.upper(), f.name))
+        out_cpp_pre.append('\n'.join([p for p in passes_end]))
+        ## loader struct part end
 
         out_cpp.append('\n'.join(passes))
 
 
         out_cpp.append('\n'.join(passes_end))
         
+    out_cpp_pre = filter(None, out_cpp_pre)
+    out_cpp_pre.append('''
+        Loader() { memset(this, 0, sizeof(Loader)); }
+    };
+    
+#ifdef GLXX_TLS
+    #if defined(_WIN32) || defined(WIN32)
+    __declspec(thread) Loader* current_loader = 0;
+    #endif
+    #if defined(__linux__)
+    __thread Loader* current_loader = 0;
+    #endif
+#else
+    Loader* current_loader = 0;
+#endif //GLXX_TLS
+
+
+    std::vector<std::tr1::shared_ptr<Loader> > loaders;
+    std::set<GLuint> unused_loader_indices;
+
+    GLuint GenLoader()
+    {
+        if (unused_loader_indices.empty()) {
+            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
+            return loaders.size() - 1;
+        } else {
+            GLuint first_unused_loader = *(unused_loader_indices.begin());
+            loaders[first_unused_loader].reset(new Loader);
+            unused_loader_indices.erase(unused_loader_indices.begin());
+            return first_unused_loader;
+        }
+    }
+
+    void BindLoader(GLuint loader)
+    {
+        current_loader = loaders[loader].get();
+    }
+
+    void DeleteLoader(GLuint loader)
+    {
+        if (loaders[loader].get() == current_loader) {
+            if (!loaders.empty())
+                current_loader = loaders[0].get();
+            else
+                current_loader = 0;
+        }
+        loaders[loader].reset();
+        unused_loader_indices.insert(loader);
+    }
+
+    ''')
+        
     print('SUM FUNCTION DEFINITIONS: ' + str(len(functions)))
-    return ('\n'.join(out_h), out_h_passthru, '\n'.join(out_cpp))
+    return ('\n'.join(out_h), out_h_passthru, '\n'.join(out_cpp_pre + out_cpp))

generator/wglxx.py

+# -*- coding: utf-8 -*-
 # Copyright (C) 2011, Giotis Nikos <giotis.nikos[]gmail.com>
 #
 # This program is distributed under the terms and conditions of the GNU
 
 #endif // _WIN32
         
-#endif // WGLXX''')
+#endif // WGLXX
+''')
         
         
         with open('../wglxx.cpp', 'w') as 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 "glXxx.h"
-#include <GL/glx.h>
-#include <cassert>
-#include <string>
-#include <vector>
-#include <set>
-#include <sstream>
-#include <iterator>
-#include <algorithm>
-#include <memory>
-
-namespace glXxx
-{
-    GLXContext GetCurrentCtx()
-    {
-        return glXGetCurrentContext();
-    }
-
-    void* GetProcAddr(const char* function_name)
-    {
-        return (void*)glXGetProcAddress((const GLubyte*)function_name);
-    }
-
-    bool IsExtensionSupported(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 IsVersionSupported(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;
-    }
-
-    struct Loader {
-        typedef GLXFBConfig * (APIENTRYP PFNGLXGETFBCONFIGSPROC)(Display* dpy, int screen, int* nelements);
-        PFNGLXGETFBCONFIGSPROC GetFBConfigs;
-        typedef GLXFBConfig * (APIENTRYP PFNGLXCHOOSEFBCONFIGPROC)(Display* dpy, int screen, const int* attrib_list, int* nelements);
-        PFNGLXCHOOSEFBCONFIGPROC ChooseFBConfig;
-        typedef int (APIENTRYP PFNGLXGETFBCONFIGATTRIBPROC)(Display* dpy, GLXFBConfig config, int attribute, int* value);
-        PFNGLXGETFBCONFIGATTRIBPROC GetFBConfigAttrib;
-        typedef XVisualInfo * (APIENTRYP PFNGLXGETVISUALFROMFBCONFIGPROC)(Display* dpy, GLXFBConfig config);
-        PFNGLXGETVISUALFROMFBCONFIGPROC GetVisualFromFBConfig;
-        typedef GLXWindow (APIENTRYP PFNGLXCREATEWINDOWPROC)(Display* dpy, GLXFBConfig config, Window win, const int* attrib_list);
-        PFNGLXCREATEWINDOWPROC CreateWindow;
-        typedef void (APIENTRYP PFNGLXDESTROYWINDOWPROC)(Display* dpy, GLXWindow win);
-        PFNGLXDESTROYWINDOWPROC DestroyWindow;
-        typedef GLXPixmap (APIENTRYP PFNGLXCREATEPIXMAPPROC)(Display* dpy, GLXFBConfig config, Pixmap pixmap, const int* attrib_list);
-        PFNGLXCREATEPIXMAPPROC CreatePixmap;
-        typedef void (APIENTRYP PFNGLXDESTROYPIXMAPPROC)(Display* dpy, GLXPixmap pixmap);
-        PFNGLXDESTROYPIXMAPPROC DestroyPixmap;
-        typedef GLXPbuffer (APIENTRYP PFNGLXCREATEPBUFFERPROC)(Display* dpy, GLXFBConfig config, const int* attrib_list);
-        PFNGLXCREATEPBUFFERPROC CreatePbuffer;
-        typedef void (APIENTRYP PFNGLXDESTROYPBUFFERPROC)(Display* dpy, GLXPbuffer pbuf);
-        PFNGLXDESTROYPBUFFERPROC DestroyPbuffer;
-        typedef void (APIENTRYP PFNGLXQUERYDRAWABLEPROC)(Display* dpy, GLXDrawable draw, int attribute, unsigned int* value);
-        PFNGLXQUERYDRAWABLEPROC QueryDrawable;
-        typedef GLXContext (APIENTRYP PFNGLXCREATENEWCONTEXTPROC)(Display* dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
-        PFNGLXCREATENEWCONTEXTPROC CreateNewContext;
-        typedef Bool (APIENTRYP PFNGLXMAKECONTEXTCURRENTPROC)(Display* dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
-        PFNGLXMAKECONTEXTCURRENTPROC MakeContextCurrent;
-        typedef GLXDrawable (APIENTRYP PFNGLXGETCURRENTREADDRAWABLEPROC)();
-        PFNGLXGETCURRENTREADDRAWABLEPROC GetCurrentReadDrawable;
-        typedef Display * (APIENTRYP PFNGLXGETCURRENTDISPLAYPROC)();
-        PFNGLXGETCURRENTDISPLAYPROC GetCurrentDisplay;
-        typedef int (APIENTRYP PFNGLXQUERYCONTEXTPROC)(Display* dpy, GLXContext ctx, int attribute, int* value);
-        PFNGLXQUERYCONTEXTPROC QueryContext;
-        typedef void (APIENTRYP PFNGLXSELECTEVENTPROC)(Display* dpy, GLXDrawable draw, unsigned long event_mask);
-        PFNGLXSELECTEVENTPROC SelectEvent;
-        typedef void (APIENTRYP PFNGLXGETSELECTEDEVENTPROC)(Display* dpy, GLXDrawable draw, unsigned long* event_mask);
-        PFNGLXGETSELECTEDEVENTPROC GetSelectedEvent;
-        typedef __GLXextFuncPtr (APIENTRYP PFNGLXGETPROCADDRESSPROC)(const GLubyte* procName);
-        PFNGLXGETPROCADDRESSPROC GetProcAddress;
-        typedef __GLXextFuncPtr (APIENTRYP PFNGLXGETPROCADDRESSARBPROC)(const GLubyte* procName);
-        PFNGLXGETPROCADDRESSARBPROC GetProcAddressARB;
-        typedef GLXContext (APIENTRYP PFNGLXCREATECONTEXTATTRIBSARBPROC)(Display* dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int* attrib_list);
-        PFNGLXCREATECONTEXTATTRIBSARBPROC CreateContextAttribsARB;
-        typedef int (APIENTRYP PFNGLXSWAPINTERVALSGIPROC)(int interval);
-        PFNGLXSWAPINTERVALSGIPROC SwapIntervalSGI;
-        typedef int (APIENTRYP PFNGLXGETVIDEOSYNCSGIPROC)(unsigned int* count);
-        PFNGLXGETVIDEOSYNCSGIPROC GetVideoSyncSGI;
-        typedef int (APIENTRYP PFNGLXWAITVIDEOSYNCSGIPROC)(int divisor, int remainder, unsigned int* count);
-        PFNGLXWAITVIDEOSYNCSGIPROC WaitVideoSyncSGI;
-        typedef Bool (APIENTRYP PFNGLXMAKECURRENTREADSGIPROC)(Display* dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
-        PFNGLXMAKECURRENTREADSGIPROC MakeCurrentReadSGI;
-        typedef GLXDrawable (APIENTRYP PFNGLXGETCURRENTREADDRAWABLESGIPROC)();
-        PFNGLXGETCURRENTREADDRAWABLESGIPROC GetCurrentReadDrawableSGI;
-        typedef GLXVideoSourceSGIX (APIENTRYP PFNGLXCREATEGLXVIDEOSOURCESGIXPROC)(Display* display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode);
-        PFNGLXCREATEGLXVIDEOSOURCESGIXPROC CreateGLXVideoSourceSGIX;
-        typedef void (APIENTRYP PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC)(Display* dpy, GLXVideoSourceSGIX glxvideosource);
-        PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC DestroyGLXVideoSourceSGIX;
-        typedef Display * (APIENTRYP PFNGLXGETCURRENTDISPLAYEXTPROC)();
-        PFNGLXGETCURRENTDISPLAYEXTPROC GetCurrentDisplayEXT;
-        typedef int (APIENTRYP PFNGLXQUERYCONTEXTINFOEXTPROC)(Display* dpy, GLXContext context, int attribute, int* value);
-        PFNGLXQUERYCONTEXTINFOEXTPROC QueryContextInfoEXT;
-        typedef GLXContextID (APIENTRYP PFNGLXGETCONTEXTIDEXTPROC)(const GLXContext context);
-        PFNGLXGETCONTEXTIDEXTPROC GetContextIDEXT;
-        typedef GLXContext (APIENTRYP PFNGLXIMPORTCONTEXTEXTPROC)(Display* dpy, GLXContextID contextID);
-        PFNGLXIMPORTCONTEXTEXTPROC ImportContextEXT;
-        typedef void (APIENTRYP PFNGLXFREECONTEXTEXTPROC)(Display* dpy, GLXContext context);
-        PFNGLXFREECONTEXTEXTPROC FreeContextEXT;
-        typedef int (APIENTRYP PFNGLXGETFBCONFIGATTRIBSGIXPROC)(Display* dpy, GLXFBConfigSGIX config, int attribute, int* value);
-        PFNGLXGETFBCONFIGATTRIBSGIXPROC GetFBConfigAttribSGIX;
-        typedef GLXFBConfigSGIX * (APIENTRYP PFNGLXCHOOSEFBCONFIGSGIXPROC)(Display* dpy, int screen, int* attrib_list, int* nelements);
-        PFNGLXCHOOSEFBCONFIGSGIXPROC ChooseFBConfigSGIX;
-        typedef GLXPixmap (APIENTRYP PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC)(Display* dpy, GLXFBConfigSGIX config, Pixmap pixmap);
-        PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC CreateGLXPixmapWithConfigSGIX;
-        typedef GLXContext (APIENTRYP PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC)(Display* dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct);
-        PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC CreateContextWithConfigSGIX;
-        typedef XVisualInfo * (APIENTRYP PFNGLXGETVISUALFROMFBCONFIGSGIXPROC)(Display* dpy, GLXFBConfigSGIX config);
-        PFNGLXGETVISUALFROMFBCONFIGSGIXPROC GetVisualFromFBConfigSGIX;
-        typedef GLXFBConfigSGIX (APIENTRYP PFNGLXGETFBCONFIGFROMVISUALSGIXPROC)(Display* dpy, XVisualInfo* vis);
-        PFNGLXGETFBCONFIGFROMVISUALSGIXPROC GetFBConfigFromVisualSGIX;
-        typedef GLXPbufferSGIX (APIENTRYP PFNGLXCREATEGLXPBUFFERSGIXPROC)(Display* dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int* attrib_list);
-        PFNGLXCREATEGLXPBUFFERSGIXPROC CreateGLXPbufferSGIX;
-        typedef void (APIENTRYP PFNGLXDESTROYGLXPBUFFERSGIXPROC)(Display* dpy, GLXPbufferSGIX pbuf);
-        PFNGLXDESTROYGLXPBUFFERSGIXPROC DestroyGLXPbufferSGIX;
-        typedef int (APIENTRYP PFNGLXQUERYGLXPBUFFERSGIXPROC)(Display* dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int* value);
-        PFNGLXQUERYGLXPBUFFERSGIXPROC QueryGLXPbufferSGIX;
-        typedef void (APIENTRYP PFNGLXSELECTEVENTSGIXPROC)(Display* dpy, GLXDrawable drawable, unsigned long mask);
-        PFNGLXSELECTEVENTSGIXPROC SelectEventSGIX;
-        typedef void (APIENTRYP PFNGLXGETSELECTEDEVENTSGIXPROC)(Display* dpy, GLXDrawable drawable, unsigned long* mask);
-        PFNGLXGETSELECTEDEVENTSGIXPROC GetSelectedEventSGIX;
-        typedef void (APIENTRYP PFNGLXCUSHIONSGIPROC)(Display* dpy, Window window, float cushion);
-        PFNGLXCUSHIONSGIPROC CushionSGI;
-        typedef int (APIENTRYP PFNGLXBINDCHANNELTOWINDOWSGIXPROC)(Display* display, int screen, int channel, Window window);
-        PFNGLXBINDCHANNELTOWINDOWSGIXPROC BindChannelToWindowSGIX;
-        typedef int (APIENTRYP PFNGLXCHANNELRECTSGIXPROC)(Display* display, int screen, int channel, int x, int y, int w, int h);
-        PFNGLXCHANNELRECTSGIXPROC ChannelRectSGIX;
-        typedef int (APIENTRYP PFNGLXQUERYCHANNELRECTSGIXPROC)(Display* display, int screen, int channel, int* dx, int* dy, int* dw, int* dh);
-        PFNGLXQUERYCHANNELRECTSGIXPROC QueryChannelRectSGIX;
-        typedef int (APIENTRYP PFNGLXQUERYCHANNELDELTASSGIXPROC)(Display* display, int screen, int channel, int* x, int* y, int* w, int* h);
-        PFNGLXQUERYCHANNELDELTASSGIXPROC QueryChannelDeltasSGIX;
-        typedef int (APIENTRYP PFNGLXCHANNELRECTSYNCSGIXPROC)(Display* display, int screen, int channel, GLenum synctype);
-        PFNGLXCHANNELRECTSYNCSGIXPROC ChannelRectSyncSGIX;
-        typedef Bool (APIENTRYP PFNGLXASSOCIATEDMPBUFFERSGIXPROC)(Display* dpy, GLXPbufferSGIX pbuffer, DMparams* params, DMbuffer dmbuffer);
-        PFNGLXASSOCIATEDMPBUFFERSGIXPROC AssociateDMPbufferSGIX;
-        typedef void (APIENTRYP PFNGLXJOINSWAPGROUPSGIXPROC)(Display* dpy, GLXDrawable drawable, GLXDrawable member);
-        PFNGLXJOINSWAPGROUPSGIXPROC JoinSwapGroupSGIX;
-        typedef void (APIENTRYP PFNGLXBINDSWAPBARRIERSGIXPROC)(Display* dpy, GLXDrawable drawable, int barrier);
-        PFNGLXBINDSWAPBARRIERSGIXPROC BindSwapBarrierSGIX;
-        typedef Bool (APIENTRYP PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC)(Display* dpy, int screen, int* max);
-        PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC QueryMaxSwapBarriersSGIX;
-        typedef Status (APIENTRYP PFNGLXGETTRANSPARENTINDEXSUNPROC)(Display* dpy, Window overlay, Window underlay, long* pTransparentIndex);
-        PFNGLXGETTRANSPARENTINDEXSUNPROC GetTransparentIndexSUN;
-        typedef void (APIENTRYP PFNGLXCOPYSUBBUFFERMESAPROC)(Display* dpy, GLXDrawable drawable, int x, int y, int width, int height);
-        PFNGLXCOPYSUBBUFFERMESAPROC CopySubBufferMESA;
-        typedef GLXPixmap (APIENTRYP PFNGLXCREATEGLXPIXMAPMESAPROC)(Display* dpy, XVisualInfo* visual, Pixmap pixmap, Colormap cmap);
-        PFNGLXCREATEGLXPIXMAPMESAPROC CreateGLXPixmapMESA;
-        typedef Bool (APIENTRYP PFNGLXRELEASEBUFFERSMESAPROC)(Display* dpy, GLXDrawable drawable);
-        PFNGLXRELEASEBUFFERSMESAPROC ReleaseBuffersMESA;
-        typedef Bool (APIENTRYP PFNGLXSET3DFXMODEMESAPROC)(int mode);
-        PFNGLXSET3DFXMODEMESAPROC Set3DfxModeMESA;
-        typedef Bool (APIENTRYP PFNGLXGETSYNCVALUESOMLPROC)(Display* dpy, GLXDrawable drawable, int64_t* ust, int64_t* msc, int64_t* sbc);
-        PFNGLXGETSYNCVALUESOMLPROC GetSyncValuesOML;
-        typedef Bool (APIENTRYP PFNGLXGETMSCRATEOMLPROC)(Display* dpy, GLXDrawable drawable, int32_t* numerator, int32_t* denominator);
-        PFNGLXGETMSCRATEOMLPROC GetMscRateOML;
-        typedef int64_t (APIENTRYP PFNGLXSWAPBUFFERSMSCOMLPROC)(Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder);
-        PFNGLXSWAPBUFFERSMSCOMLPROC SwapBuffersMscOML;
-        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);
-        PFNGLXWAITFORMSCOMLPROC WaitForMscOML;
-        typedef Bool (APIENTRYP PFNGLXWAITFORSBCOMLPROC)(Display* dpy, GLXDrawable drawable, int64_t target_sbc, int64_t* ust, int64_t* msc, int64_t* sbc);
-        PFNGLXWAITFORSBCOMLPROC WaitForSbcOML;
-        typedef GLXHyperpipeNetworkSGIX * (APIENTRYP PFNGLXQUERYHYPERPIPENETWORKSGIXPROC)(Display* dpy, int* npipes);
-        PFNGLXQUERYHYPERPIPENETWORKSGIXPROC QueryHyperpipeNetworkSGIX;
-        typedef int (APIENTRYP PFNGLXHYPERPIPECONFIGSGIXPROC)(Display* dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX* cfg, int* hpId);
-        PFNGLXHYPERPIPECONFIGSGIXPROC HyperpipeConfigSGIX;
-        typedef GLXHyperpipeConfigSGIX * (APIENTRYP PFNGLXQUERYHYPERPIPECONFIGSGIXPROC)(Display* dpy, int hpId, int* npipes);
-        PFNGLXQUERYHYPERPIPECONFIGSGIXPROC QueryHyperpipeConfigSGIX;
-        typedef int (APIENTRYP PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC)(Display* dpy, int hpId);
-        PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC DestroyHyperpipeConfigSGIX;
-        typedef int (APIENTRYP PFNGLXBINDHYPERPIPESGIXPROC)(Display* dpy, int hpId);
-        PFNGLXBINDHYPERPIPESGIXPROC BindHyperpipeSGIX;
-        typedef int (APIENTRYP PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC)(Display* dpy, int timeSlice, int attrib, int size, void* attribList, void* returnAttribList);
-        PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC QueryHyperpipeBestAttribSGIX;
-        typedef int (APIENTRYP PFNGLXHYPERPIPEATTRIBSGIXPROC)(Display* dpy, int timeSlice, int attrib, int size, void* attribList);
-        PFNGLXHYPERPIPEATTRIBSGIXPROC HyperpipeAttribSGIX;
-        typedef int (APIENTRYP PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC)(Display* dpy, int timeSlice, int attrib, int size, void* returnAttribList);
-        PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC QueryHyperpipeAttribSGIX;
-        typedef unsigned int (APIENTRYP PFNGLXGETAGPOFFSETMESAPROC)(const void* pointer);
-        PFNGLXGETAGPOFFSETMESAPROC GetAGPOffsetMESA;
-        typedef void (APIENTRYP PFNGLXBINDTEXIMAGEEXTPROC)(Display* dpy, GLXDrawable drawable, int buffer, const int* attrib_list);
-        PFNGLXBINDTEXIMAGEEXTPROC BindTexImageEXT;
-        typedef void (APIENTRYP PFNGLXRELEASETEXIMAGEEXTPROC)(Display* dpy, GLXDrawable drawable, int buffer);
-        PFNGLXRELEASETEXIMAGEEXTPROC ReleaseTexImageEXT;
-        typedef unsigned int * (APIENTRYP PFNGLXENUMERATEVIDEODEVICESNVPROC)(Display* dpy, int screen, int* nelements);
-        PFNGLXENUMERATEVIDEODEVICESNVPROC EnumerateVideoDevicesNV;
-        typedef int (APIENTRYP PFNGLXBINDVIDEODEVICENVPROC)(Display* dpy, unsigned int video_slot, unsigned int video_device, const int* attrib_list);
-        PFNGLXBINDVIDEODEVICENVPROC BindVideoDeviceNV;
-        typedef int (APIENTRYP PFNGLXGETVIDEODEVICENVPROC)(Display* dpy, int screen, int numVideoDevices, GLXVideoDeviceNV* pVideoDevice);
-        PFNGLXGETVIDEODEVICENVPROC GetVideoDeviceNV;
-        typedef int (APIENTRYP PFNGLXRELEASEVIDEODEVICENVPROC)(Display* dpy, int screen, GLXVideoDeviceNV VideoDevice);
-        PFNGLXRELEASEVIDEODEVICENVPROC ReleaseVideoDeviceNV;
-        typedef int (APIENTRYP PFNGLXBINDVIDEOIMAGENVPROC)(Display* dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer);
-        PFNGLXBINDVIDEOIMAGENVPROC BindVideoImageNV;
-        typedef int (APIENTRYP PFNGLXRELEASEVIDEOIMAGENVPROC)(Display* dpy, GLXPbuffer pbuf);
-        PFNGLXRELEASEVIDEOIMAGENVPROC ReleaseVideoImageNV;
-        typedef int (APIENTRYP PFNGLXSENDPBUFFERTOVIDEONVPROC)(Display* dpy, GLXPbuffer pbuf, int iBufferType, unsigned long* pulCounterPbuffer, GLboolean bBlock);
-        PFNGLXSENDPBUFFERTOVIDEONVPROC SendPbufferToVideoNV;
-        typedef int (APIENTRYP PFNGLXGETVIDEOINFONVPROC)(Display* dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long* pulCounterOutputPbuffer, unsigned long* pulCounterOutputVideo);
-        PFNGLXGETVIDEOINFONVPROC GetVideoInfoNV;
-        typedef Bool (APIENTRYP PFNGLXJOINSWAPGROUPNVPROC)(Display* dpy, GLXDrawable drawable, GLuint group);
-        PFNGLXJOINSWAPGROUPNVPROC JoinSwapGroupNV;
-        typedef Bool (APIENTRYP PFNGLXBINDSWAPBARRIERNVPROC)(Display* dpy, GLuint group, GLuint barrier);
-        PFNGLXBINDSWAPBARRIERNVPROC BindSwapBarrierNV;
-        typedef Bool (APIENTRYP PFNGLXQUERYSWAPGROUPNVPROC)(Display* dpy, GLXDrawable drawable, GLuint* group, GLuint* barrier);
-        PFNGLXQUERYSWAPGROUPNVPROC QuerySwapGroupNV;
-        typedef Bool (APIENTRYP PFNGLXQUERYMAXSWAPGROUPSNVPROC)(Display* dpy, int screen, GLuint* maxGroups, GLuint* maxBarriers);
-        PFNGLXQUERYMAXSWAPGROUPSNVPROC QueryMaxSwapGroupsNV;
-        typedef Bool (APIENTRYP PFNGLXQUERYFRAMECOUNTNVPROC)(Display* dpy, int screen, GLuint* count);
-        PFNGLXQUERYFRAMECOUNTNVPROC QueryFrameCountNV;
-        typedef Bool (APIENTRYP PFNGLXRESETFRAMECOUNTNVPROC)(Display* dpy, int screen);
-        PFNGLXRESETFRAMECOUNTNVPROC ResetFrameCountNV;
-        typedef int (APIENTRYP PFNGLXBINDVIDEOCAPTUREDEVICENVPROC)(Display* dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device);
-        PFNGLXBINDVIDEOCAPTUREDEVICENVPROC BindVideoCaptureDeviceNV;
-        typedef GLXVideoCaptureDeviceNV * (APIENTRYP PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC)(Display* dpy, int screen, int* nelements);
-        PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC EnumerateVideoCaptureDevicesNV;
-        typedef void (APIENTRYP PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC)(Display* dpy, GLXVideoCaptureDeviceNV device);
-        PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC LockVideoCaptureDeviceNV;
-        typedef int (APIENTRYP PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC)(Display* dpy, GLXVideoCaptureDeviceNV device, int attribute, int* value);
-        PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC QueryVideoCaptureDeviceNV;
-        typedef void (APIENTRYP PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC)(Display* dpy, GLXVideoCaptureDeviceNV device);
-        PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC ReleaseVideoCaptureDeviceNV;
-        typedef int (APIENTRYP PFNGLXSWAPINTERVALEXTPROC)(Display* dpy, GLXDrawable drawable, int interval);
-        PFNGLXSWAPINTERVALEXTPROC SwapIntervalEXT;
-        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);
-        PFNGLXCOPYIMAGESUBDATANVPROC CopyImageSubDataNV;
-
-        Loader() { memset(this, 0, sizeof(Loader)); }
-    };
-    
-#ifdef GLXX_TLS
-    #if defined(_WIN32) || defined(WIN32)
-    __declspec(thread) Loader* current_loader = 0;
-    #endif
-    #if defined(__linux__)
-    __thread Loader* current_loader = 0;
-    #endif
-#else
-    Loader* current_loader = 0;
-#endif //GLXX_TLS
-
-
-    std::vector<std::tr1::shared_ptr<Loader> > loaders;
-    std::set<GLuint> unused_loader_indices;
-
-    GLuint GenLoader()
-    {
-        if (unused_loader_indices.empty()) {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            return loaders.size() - 1;
-        } else {
-            GLuint first_unused_loader = *(unused_loader_indices.begin());
-            loaders[first_unused_loader].reset(new Loader);
-            unused_loader_indices.erase(unused_loader_indices.begin());
-            return first_unused_loader;
-        }
-    }
-
-    void BindLoader(GLuint loader)
-    {
-        current_loader = loaders[loader].get();
-    }
-
-    void DeleteLoader(GLuint loader)
-    {
-        if (loaders[loader].get() == current_loader) {
-            if (!loaders.empty())
-                current_loader = loaders[0].get();
-            else
-                current_loader = 0;
-        }
-        loaders[loader].reset();
-        unused_loader_indices.insert(loader);
-    }
-
-    
-
-    bool load_version_1_3()
-    {        
-        assert(GetCurrentCtx() && "load_version_1_3() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        current_loader->GetFBConfigs = (Loader::PFNGLXGETFBCONFIGSPROC) GetProcAddr("glXGetFBConfigs");
-        if (!current_loader->GetFBConfigs) is_loaded = false;
-        current_loader->ChooseFBConfig = (Loader::PFNGLXCHOOSEFBCONFIGPROC) GetProcAddr("glXChooseFBConfig");
-        if (!current_loader->ChooseFBConfig) is_loaded = false;
-        current_loader->GetFBConfigAttrib = (Loader::PFNGLXGETFBCONFIGATTRIBPROC) GetProcAddr("glXGetFBConfigAttrib");
-        if (!current_loader->GetFBConfigAttrib) is_loaded = false;
-        current_loader->GetVisualFromFBConfig = (Loader::PFNGLXGETVISUALFROMFBCONFIGPROC) GetProcAddr("glXGetVisualFromFBConfig");
-        if (!current_loader->GetVisualFromFBConfig) is_loaded = false;
-        current_loader->CreateWindow = (Loader::PFNGLXCREATEWINDOWPROC) GetProcAddr("glXCreateWindow");
-        if (!current_loader->CreateWindow) is_loaded = false;
-        current_loader->DestroyWindow = (Loader::PFNGLXDESTROYWINDOWPROC) GetProcAddr("glXDestroyWindow");
-        if (!current_loader->DestroyWindow) is_loaded = false;
-        current_loader->CreatePixmap = (Loader::PFNGLXCREATEPIXMAPPROC) GetProcAddr("glXCreatePixmap");
-        if (!current_loader->CreatePixmap) is_loaded = false;
-        current_loader->DestroyPixmap = (Loader::PFNGLXDESTROYPIXMAPPROC) GetProcAddr("glXDestroyPixmap");
-        if (!current_loader->DestroyPixmap) is_loaded = false;
-        current_loader->CreatePbuffer = (Loader::PFNGLXCREATEPBUFFERPROC) GetProcAddr("glXCreatePbuffer");
-        if (!current_loader->CreatePbuffer) is_loaded = false;
-        current_loader->DestroyPbuffer = (Loader::PFNGLXDESTROYPBUFFERPROC) GetProcAddr("glXDestroyPbuffer");
-        if (!current_loader->DestroyPbuffer) is_loaded = false;
-        current_loader->QueryDrawable = (Loader::PFNGLXQUERYDRAWABLEPROC) GetProcAddr("glXQueryDrawable");
-        if (!current_loader->QueryDrawable) is_loaded = false;
-        current_loader->CreateNewContext = (Loader::PFNGLXCREATENEWCONTEXTPROC) GetProcAddr("glXCreateNewContext");
-        if (!current_loader->CreateNewContext) is_loaded = false;
-        current_loader->MakeContextCurrent = (Loader::PFNGLXMAKECONTEXTCURRENTPROC) GetProcAddr("glXMakeContextCurrent");
-        if (!current_loader->MakeContextCurrent) is_loaded = false;
-        current_loader->GetCurrentReadDrawable = (Loader::PFNGLXGETCURRENTREADDRAWABLEPROC) GetProcAddr("glXGetCurrentReadDrawable");
-        if (!current_loader->GetCurrentReadDrawable) is_loaded = false;
-        current_loader->GetCurrentDisplay = (Loader::PFNGLXGETCURRENTDISPLAYPROC) GetProcAddr("glXGetCurrentDisplay");
-        if (!current_loader->GetCurrentDisplay) is_loaded = false;
-        current_loader->QueryContext = (Loader::PFNGLXQUERYCONTEXTPROC) GetProcAddr("glXQueryContext");
-        if (!current_loader->QueryContext) is_loaded = false;
-        current_loader->SelectEvent = (Loader::PFNGLXSELECTEVENTPROC) GetProcAddr("glXSelectEvent");
-        if (!current_loader->SelectEvent) is_loaded = false;
-        current_loader->GetSelectedEvent = (Loader::PFNGLXGETSELECTEDEVENTPROC) GetProcAddr("glXGetSelectedEvent");
-        if (!current_loader->GetSelectedEvent) is_loaded = false;
-        
-        return is_loaded;
-    }
-
-    GLXFBConfig * glx_version_1_3::glXGetFBConfigs(Display* dpy, int screen, int* nelements)
-    {
-        return current_loader->GetFBConfigs(dpy, screen, nelements);
-    }
-
-    GLXFBConfig * glx_version_1_3::glXChooseFBConfig(Display* dpy, int screen, const int* attrib_list, int* nelements)
-    {
-        return current_loader->ChooseFBConfig(dpy, screen, attrib_list, nelements);
-    }
-
-    int glx_version_1_3::glXGetFBConfigAttrib(Display* dpy, GLXFBConfig config, int attribute, int* value)
-    {
-        return current_loader->GetFBConfigAttrib(dpy, config, attribute, value);
-    }
-
-    XVisualInfo * glx_version_1_3::glXGetVisualFromFBConfig(Display* dpy, GLXFBConfig config)
-    {
-        return current_loader->GetVisualFromFBConfig(dpy, config);
-    }
-
-    GLXWindow glx_version_1_3::glXCreateWindow(Display* dpy, GLXFBConfig config, Window win, const int* attrib_list)
-    {
-        return current_loader->CreateWindow(dpy, config, win, attrib_list);
-    }
-
-    void glx_version_1_3::glXDestroyWindow(Display* dpy, GLXWindow win)
-    {
-        current_loader->DestroyWindow(dpy, win);
-    }
-
-    GLXPixmap glx_version_1_3::glXCreatePixmap(Display* dpy, GLXFBConfig config, Pixmap pixmap, const int* attrib_list)
-    {
-        return current_loader->CreatePixmap(dpy, config, pixmap, attrib_list);
-    }
-
-    void glx_version_1_3::glXDestroyPixmap(Display* dpy, GLXPixmap pixmap)
-    {
-        current_loader->DestroyPixmap(dpy, pixmap);
-    }
-
-    GLXPbuffer glx_version_1_3::glXCreatePbuffer(Display* dpy, GLXFBConfig config, const int* attrib_list)
-    {
-        return current_loader->CreatePbuffer(dpy, config, attrib_list);
-    }
-
-    void glx_version_1_3::glXDestroyPbuffer(Display* dpy, GLXPbuffer pbuf)
-    {
-        current_loader->DestroyPbuffer(dpy, pbuf);
-    }
-
-    void glx_version_1_3::glXQueryDrawable(Display* dpy, GLXDrawable draw, int attribute, unsigned int* value)
-    {
-        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 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 current_loader->MakeContextCurrent(dpy, draw, read, ctx);
-    }
-
-    GLXDrawable glx_version_1_3::glXGetCurrentReadDrawable()
-    {
-        return current_loader->GetCurrentReadDrawable();
-    }
-
-    Display * glx_version_1_3::glXGetCurrentDisplay()
-    {
-        return current_loader->GetCurrentDisplay();
-    }
-
-    int glx_version_1_3::glXQueryContext(Display* dpy, GLXContext ctx, int attribute, int* value)
-    {
-        return current_loader->QueryContext(dpy, ctx, attribute, value);
-    }
-
-    void glx_version_1_3::glXSelectEvent(Display* dpy, GLXDrawable draw, unsigned long event_mask)
-    {
-        current_loader->SelectEvent(dpy, draw, event_mask);
-    }
-
-    void glx_version_1_3::glXGetSelectedEvent(Display* dpy, GLXDrawable draw, unsigned long* event_mask)
-    {
-        current_loader->GetSelectedEvent(dpy, draw, event_mask);
-    }
-
-
-    bool load_version_1_4()
-    {        
-        assert(GetCurrentCtx() && "load_version_1_4() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        current_loader->GetProcAddress = (Loader::PFNGLXGETPROCADDRESSPROC) GetProcAddr("glXGetProcAddress");
-        if (!current_loader->GetProcAddress) is_loaded = false;
-        
-        return is_loaded;
-    }
-
-    __GLXextFuncPtr glx_version_1_4::glXGetProcAddress(const GLubyte* procName)
-    {
-        return current_loader->GetProcAddress(procName);
-    }
-
-
-    bool load_arb_get_proc_address()
-    {        
-        assert(GetCurrentCtx() && "load_arb_get_proc_address() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        current_loader->GetProcAddressARB = (Loader::PFNGLXGETPROCADDRESSARBPROC) GetProcAddr("glXGetProcAddressARB");
-        if (!current_loader->GetProcAddressARB) is_loaded = false;
-        
-        return is_loaded;
-    }
-
-    bool has_arb_get_proc_address()
-    {
-        return IsExtensionSupported("GLX_ARB_get_proc_address");
-    }
-
-
-    __GLXextFuncPtr glx_arb_get_proc_address::glXGetProcAddressARB(const GLubyte* procName)
-    {
-        return current_loader->GetProcAddressARB(procName);
-    }
-
-
-    bool load_arb_multisample()
-    {        
-        assert(GetCurrentCtx() && "load_arb_multisample() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        
-        return is_loaded;
-    }
-
-    bool has_arb_multisample()
-    {
-        return IsExtensionSupported("GLX_ARB_multisample");
-    }
-
-
-
-    bool load_arb_fbconfig_float()
-    {        
-        assert(GetCurrentCtx() && "load_arb_fbconfig_float() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        
-        return is_loaded;
-    }
-
-    bool has_arb_fbconfig_float()
-    {
-        return IsExtensionSupported("GLX_ARB_fbconfig_float");
-    }
-
-
-
-    bool load_arb_framebuffer_srgb()
-    {        
-        assert(GetCurrentCtx() && "load_arb_framebuffer_srgb() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        
-        return is_loaded;
-    }
-
-    bool has_arb_framebuffer_srgb()
-    {
-        return IsExtensionSupported("GLX_ARB_framebuffer_sRGB");
-    }
-
-
-
-    bool load_arb_create_context()
-    {        
-        assert(GetCurrentCtx() && "load_arb_create_context() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        current_loader->CreateContextAttribsARB = (Loader::PFNGLXCREATECONTEXTATTRIBSARBPROC) GetProcAddr("glXCreateContextAttribsARB");
-        if (!current_loader->CreateContextAttribsARB) is_loaded = false;
-        
-        return is_loaded;
-    }
-
-    bool has_arb_create_context()
-    {
-        return IsExtensionSupported("GLX_ARB_create_context");
-    }
-
-
-    GLXContext glx_arb_create_context::glXCreateContextAttribsARB(Display* dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int* attrib_list)
-    {
-        return current_loader->CreateContextAttribsARB(dpy, config, share_context, direct, attrib_list);
-    }
-
-
-    bool load_arb_create_context_profile()
-    {        
-        assert(GetCurrentCtx() && "load_arb_create_context_profile() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        
-        return is_loaded;
-    }
-
-    bool has_arb_create_context_profile()
-    {
-        return IsExtensionSupported("GLX_ARB_create_context_profile");
-    }
-
-
-
-    bool load_arb_create_context_robustness()
-    {        
-        assert(GetCurrentCtx() && "load_arb_create_context_robustness() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        
-        return is_loaded;
-    }
-
-    bool has_arb_create_context_robustness()
-    {
-        return IsExtensionSupported("GLX_ARB_create_context_robustness");
-    }
-
-
-
-    bool load_sgis_multisample()
-    {        
-        assert(GetCurrentCtx() && "load_sgis_multisample() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        
-        return is_loaded;
-    }
-
-    bool has_sgis_multisample()
-    {
-        return IsExtensionSupported("GLX_SGIS_multisample");
-    }
-
-
-
-    bool load_ext_visual_info()
-    {        
-        assert(GetCurrentCtx() && "load_ext_visual_info() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        
-        return is_loaded;
-    }
-
-    bool has_ext_visual_info()
-    {
-        return IsExtensionSupported("GLX_EXT_visual_info");
-    }
-
-
-
-    bool load_sgi_swap_control()
-    {        
-        assert(GetCurrentCtx() && "load_sgi_swap_control() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        current_loader->SwapIntervalSGI = (Loader::PFNGLXSWAPINTERVALSGIPROC) GetProcAddr("glXSwapIntervalSGI");
-        if (!current_loader->SwapIntervalSGI) is_loaded = false;
-        
-        return is_loaded;
-    }
-
-    bool has_sgi_swap_control()
-    {
-        return IsExtensionSupported("GLX_SGI_swap_control");
-    }
-
-
-    int glx_sgi_swap_control::glXSwapIntervalSGI(int interval)
-    {
-        return current_loader->SwapIntervalSGI(interval);
-    }
-
-
-    bool load_sgi_video_sync()
-    {        
-        assert(GetCurrentCtx() && "load_sgi_video_sync() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        current_loader->GetVideoSyncSGI = (Loader::PFNGLXGETVIDEOSYNCSGIPROC) GetProcAddr("glXGetVideoSyncSGI");
-        if (!current_loader->GetVideoSyncSGI) is_loaded = false;
-        current_loader->WaitVideoSyncSGI = (Loader::PFNGLXWAITVIDEOSYNCSGIPROC) GetProcAddr("glXWaitVideoSyncSGI");
-        if (!current_loader->WaitVideoSyncSGI) is_loaded = false;
-        
-        return is_loaded;
-    }
-
-    bool has_sgi_video_sync()
-    {
-        return IsExtensionSupported("GLX_SGI_video_sync");
-    }
-
-
-    int glx_sgi_video_sync::glXGetVideoSyncSGI(unsigned int* count)
-    {
-        return current_loader->GetVideoSyncSGI(count);
-    }
-
-    int glx_sgi_video_sync::glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int* count)
-    {
-        return current_loader->WaitVideoSyncSGI(divisor, remainder, count);
-    }
-
-
-    bool load_sgi_make_current_read()
-    {        
-        assert(GetCurrentCtx() && "load_sgi_make_current_read() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        current_loader->MakeCurrentReadSGI = (Loader::PFNGLXMAKECURRENTREADSGIPROC) GetProcAddr("glXMakeCurrentReadSGI");
-        if (!current_loader->MakeCurrentReadSGI) is_loaded = false;
-        current_loader->GetCurrentReadDrawableSGI = (Loader::PFNGLXGETCURRENTREADDRAWABLESGIPROC) GetProcAddr("glXGetCurrentReadDrawableSGI");
-        if (!current_loader->GetCurrentReadDrawableSGI) is_loaded = false;
-        
-        return is_loaded;
-    }
-
-    bool has_sgi_make_current_read()
-    {
-        return IsExtensionSupported("GLX_SGI_make_current_read");
-    }
-
-
-    Bool glx_sgi_make_current_read::glXMakeCurrentReadSGI(Display* dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx)
-    {
-        return current_loader->MakeCurrentReadSGI(dpy, draw, read, ctx);
-    }
-
-    GLXDrawable glx_sgi_make_current_read::glXGetCurrentReadDrawableSGI()
-    {
-        return current_loader->GetCurrentReadDrawableSGI();
-    }
-
-#ifdef _VL_H
-    bool load_sgix_video_source()
-    {        
-        assert(GetCurrentCtx() && "load_sgix_video_source() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        current_loader->CreateGLXVideoSourceSGIX = (Loader::PFNGLXCREATEGLXVIDEOSOURCESGIXPROC) GetProcAddr("glXCreateGLXVideoSourceSGIX");
-        if (!current_loader->CreateGLXVideoSourceSGIX) is_loaded = false;
-        current_loader->DestroyGLXVideoSourceSGIX = (Loader::PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC) GetProcAddr("glXDestroyGLXVideoSourceSGIX");
-        if (!current_loader->DestroyGLXVideoSourceSGIX) is_loaded = false;
-        
-        return is_loaded;
-    }
-
-    bool has_sgix_video_source()
-    {
-        return IsExtensionSupported("GLX_SGIX_video_source");
-    }
-
-
-    GLXVideoSourceSGIX glx_sgix_video_source::glXCreateGLXVideoSourceSGIX(Display* display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode)
-    {
-        return current_loader->CreateGLXVideoSourceSGIX(display, screen, server, path, nodeClass, drainNode);
-    }
-
-    void glx_sgix_video_source::glXDestroyGLXVideoSourceSGIX(Display* dpy, GLXVideoSourceSGIX glxvideosource)
-    {
-        current_loader->DestroyGLXVideoSourceSGIX(dpy, glxvideosource);
-    }
-#endif /* _VL_H */
-
-    bool load_ext_visual_rating()
-    {        
-        assert(GetCurrentCtx() && "load_ext_visual_rating() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        
-        return is_loaded;
-    }
-
-    bool has_ext_visual_rating()
-    {
-        return IsExtensionSupported("GLX_EXT_visual_rating");
-    }
-
-
-
-    bool load_ext_import_context()
-    {        
-        assert(GetCurrentCtx() && "load_ext_import_context() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        current_loader->GetCurrentDisplayEXT = (Loader::PFNGLXGETCURRENTDISPLAYEXTPROC) GetProcAddr("glXGetCurrentDisplayEXT");
-        if (!current_loader->GetCurrentDisplayEXT) is_loaded = false;
-        current_loader->QueryContextInfoEXT = (Loader::PFNGLXQUERYCONTEXTINFOEXTPROC) GetProcAddr("glXQueryContextInfoEXT");
-        if (!current_loader->QueryContextInfoEXT) is_loaded = false;
-        current_loader->GetContextIDEXT = (Loader::PFNGLXGETCONTEXTIDEXTPROC) GetProcAddr("glXGetContextIDEXT");
-        if (!current_loader->GetContextIDEXT) is_loaded = false;
-        current_loader->ImportContextEXT = (Loader::PFNGLXIMPORTCONTEXTEXTPROC) GetProcAddr("glXImportContextEXT");
-        if (!current_loader->ImportContextEXT) is_loaded = false;
-        current_loader->FreeContextEXT = (Loader::PFNGLXFREECONTEXTEXTPROC) GetProcAddr("glXFreeContextEXT");
-        if (!current_loader->FreeContextEXT) is_loaded = false;
-        
-        return is_loaded;
-    }
-
-    bool has_ext_import_context()
-    {
-        return IsExtensionSupported("GLX_EXT_import_context");
-    }
-
-
-    Display * glx_ext_import_context::glXGetCurrentDisplayEXT()
-    {
-        return current_loader->GetCurrentDisplayEXT();
-    }
-
-    int glx_ext_import_context::glXQueryContextInfoEXT(Display* dpy, GLXContext context, int attribute, int* value)
-    {
-        return current_loader->QueryContextInfoEXT(dpy, context, attribute, value);
-    }
-
-    GLXContextID glx_ext_import_context::glXGetContextIDEXT(const GLXContext context)
-    {
-        return current_loader->GetContextIDEXT(context);
-    }
-
-    GLXContext glx_ext_import_context::glXImportContextEXT(Display* dpy, GLXContextID contextID)
-    {
-        return current_loader->ImportContextEXT(dpy, contextID);
-    }
-
-    void glx_ext_import_context::glXFreeContextEXT(Display* dpy, GLXContext context)
-    {
-        current_loader->FreeContextEXT(dpy, context);
-    }
-
-
-    bool load_sgix_fbconfig()
-    {        
-        assert(GetCurrentCtx() && "load_sgix_fbconfig() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        current_loader->GetFBConfigAttribSGIX = (Loader::PFNGLXGETFBCONFIGATTRIBSGIXPROC) GetProcAddr("glXGetFBConfigAttribSGIX");
-        if (!current_loader->GetFBConfigAttribSGIX) is_loaded = false;
-        current_loader->ChooseFBConfigSGIX = (Loader::PFNGLXCHOOSEFBCONFIGSGIXPROC) GetProcAddr("glXChooseFBConfigSGIX");
-        if (!current_loader->ChooseFBConfigSGIX) is_loaded = false;
-        current_loader->CreateGLXPixmapWithConfigSGIX = (Loader::PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) GetProcAddr("glXCreateGLXPixmapWithConfigSGIX");
-        if (!current_loader->CreateGLXPixmapWithConfigSGIX) is_loaded = false;
-        current_loader->CreateContextWithConfigSGIX = (Loader::PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) GetProcAddr("glXCreateContextWithConfigSGIX");
-        if (!current_loader->CreateContextWithConfigSGIX) is_loaded = false;
-        current_loader->GetVisualFromFBConfigSGIX = (Loader::PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) GetProcAddr("glXGetVisualFromFBConfigSGIX");
-        if (!current_loader->GetVisualFromFBConfigSGIX) is_loaded = false;
-        current_loader->GetFBConfigFromVisualSGIX = (Loader::PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) GetProcAddr("glXGetFBConfigFromVisualSGIX");
-        if (!current_loader->GetFBConfigFromVisualSGIX) is_loaded = false;
-        
-        return is_loaded;
-    }
-
-    bool has_sgix_fbconfig()
-    {
-        return IsExtensionSupported("GLX_SGIX_fbconfig");
-    }
-
-
-    int glx_sgix_fbconfig::glXGetFBConfigAttribSGIX(Display* dpy, GLXFBConfigSGIX config, int attribute, int* value)
-    {
-        return current_loader->GetFBConfigAttribSGIX(dpy, config, attribute, value);
-    }
-
-    GLXFBConfigSGIX * glx_sgix_fbconfig::glXChooseFBConfigSGIX(Display* dpy, int screen, int* attrib_list, int* nelements)
-    {
-        return current_loader->ChooseFBConfigSGIX(dpy, screen, attrib_list, nelements);
-    }
-
-    GLXPixmap glx_sgix_fbconfig::glXCreateGLXPixmapWithConfigSGIX(Display* dpy, GLXFBConfigSGIX config, Pixmap pixmap)
-    {
-        return current_loader->CreateGLXPixmapWithConfigSGIX(dpy, config, pixmap);
-    }
-
-    GLXContext glx_sgix_fbconfig::glXCreateContextWithConfigSGIX(Display* dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct)
-    {
-        return current_loader->CreateContextWithConfigSGIX(dpy, config, render_type, share_list, direct);
-    }
-
-    XVisualInfo * glx_sgix_fbconfig::glXGetVisualFromFBConfigSGIX(Display* dpy, GLXFBConfigSGIX config)
-    {
-        return current_loader->GetVisualFromFBConfigSGIX(dpy, config);
-    }
-
-    GLXFBConfigSGIX glx_sgix_fbconfig::glXGetFBConfigFromVisualSGIX(Display* dpy, XVisualInfo* vis)
-    {
-        return current_loader->GetFBConfigFromVisualSGIX(dpy, vis);
-    }
-
-
-    bool load_sgix_pbuffer()
-    {        
-        assert(GetCurrentCtx() && "load_sgix_pbuffer() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        current_loader->CreateGLXPbufferSGIX = (Loader::PFNGLXCREATEGLXPBUFFERSGIXPROC) GetProcAddr("glXCreateGLXPbufferSGIX");
-        if (!current_loader->CreateGLXPbufferSGIX) is_loaded = false;
-        current_loader->DestroyGLXPbufferSGIX = (Loader::PFNGLXDESTROYGLXPBUFFERSGIXPROC) GetProcAddr("glXDestroyGLXPbufferSGIX");
-        if (!current_loader->DestroyGLXPbufferSGIX) is_loaded = false;
-        current_loader->QueryGLXPbufferSGIX = (Loader::PFNGLXQUERYGLXPBUFFERSGIXPROC) GetProcAddr("glXQueryGLXPbufferSGIX");
-        if (!current_loader->QueryGLXPbufferSGIX) is_loaded = false;
-        current_loader->SelectEventSGIX = (Loader::PFNGLXSELECTEVENTSGIXPROC) GetProcAddr("glXSelectEventSGIX");
-        if (!current_loader->SelectEventSGIX) is_loaded = false;
-        current_loader->GetSelectedEventSGIX = (Loader::PFNGLXGETSELECTEDEVENTSGIXPROC) GetProcAddr("glXGetSelectedEventSGIX");
-        if (!current_loader->GetSelectedEventSGIX) is_loaded = false;
-        
-        return is_loaded;
-    }
-
-    bool has_sgix_pbuffer()
-    {
-        return IsExtensionSupported("GLX_SGIX_pbuffer");
-    }
-
-
-    GLXPbufferSGIX glx_sgix_pbuffer::glXCreateGLXPbufferSGIX(Display* dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int* attrib_list)
-    {
-        return current_loader->CreateGLXPbufferSGIX(dpy, config, width, height, attrib_list);
-    }
-
-    void glx_sgix_pbuffer::glXDestroyGLXPbufferSGIX(Display* dpy, GLXPbufferSGIX pbuf)
-    {
-        current_loader->DestroyGLXPbufferSGIX(dpy, pbuf);
-    }
-
-    int glx_sgix_pbuffer::glXQueryGLXPbufferSGIX(Display* dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int* value)
-    {
-        return current_loader->QueryGLXPbufferSGIX(dpy, pbuf, attribute, value);
-    }
-
-    void glx_sgix_pbuffer::glXSelectEventSGIX(Display* dpy, GLXDrawable drawable, unsigned long mask)
-    {
-        current_loader->SelectEventSGIX(dpy, drawable, mask);
-    }
-
-    void glx_sgix_pbuffer::glXGetSelectedEventSGIX(Display* dpy, GLXDrawable drawable, unsigned long* mask)
-    {
-        current_loader->GetSelectedEventSGIX(dpy, drawable, mask);
-    }
-
-
-    bool load_sgi_cushion()
-    {        
-        assert(GetCurrentCtx() && "load_sgi_cushion() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        current_loader->CushionSGI = (Loader::PFNGLXCUSHIONSGIPROC) GetProcAddr("glXCushionSGI");
-        if (!current_loader->CushionSGI) is_loaded = false;
-        
-        return is_loaded;
-    }
-
-    bool has_sgi_cushion()
-    {
-        return IsExtensionSupported("GLX_SGI_cushion");
-    }
-
-
-    void glx_sgi_cushion::glXCushionSGI(Display* dpy, Window window, float cushion)
-    {
-        current_loader->CushionSGI(dpy, window, cushion);
-    }
-
-
-    bool load_sgix_video_resize()
-    {        
-        assert(GetCurrentCtx() && "load_sgix_video_resize() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        current_loader->BindChannelToWindowSGIX = (Loader::PFNGLXBINDCHANNELTOWINDOWSGIXPROC) GetProcAddr("glXBindChannelToWindowSGIX");
-        if (!current_loader->BindChannelToWindowSGIX) is_loaded = false;
-        current_loader->ChannelRectSGIX = (Loader::PFNGLXCHANNELRECTSGIXPROC) GetProcAddr("glXChannelRectSGIX");
-        if (!current_loader->ChannelRectSGIX) is_loaded = false;
-        current_loader->QueryChannelRectSGIX = (Loader::PFNGLXQUERYCHANNELRECTSGIXPROC) GetProcAddr("glXQueryChannelRectSGIX");
-        if (!current_loader->QueryChannelRectSGIX) is_loaded = false;
-        current_loader->QueryChannelDeltasSGIX = (Loader::PFNGLXQUERYCHANNELDELTASSGIXPROC) GetProcAddr("glXQueryChannelDeltasSGIX");
-        if (!current_loader->QueryChannelDeltasSGIX) is_loaded = false;
-        current_loader->ChannelRectSyncSGIX = (Loader::PFNGLXCHANNELRECTSYNCSGIXPROC) GetProcAddr("glXChannelRectSyncSGIX");
-        if (!current_loader->ChannelRectSyncSGIX) is_loaded = false;
-        
-        return is_loaded;
-    }
-
-    bool has_sgix_video_resize()
-    {
-        return IsExtensionSupported("GLX_SGIX_video_resize");
-    }
-
-
-    int glx_sgix_video_resize::glXBindChannelToWindowSGIX(Display* display, int screen, int channel, Window window)
-    {
-        return 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 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 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 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 current_loader->ChannelRectSyncSGIX(display, screen, channel, synctype);
-    }
-
-#ifdef _DM_BUFFER_H_
-    bool load_sgix_dmbuffer()
-    {        
-        assert(GetCurrentCtx() && "load_sgix_dmbuffer() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        current_loader->AssociateDMPbufferSGIX = (Loader::PFNGLXASSOCIATEDMPBUFFERSGIXPROC) GetProcAddr("glXAssociateDMPbufferSGIX");
-        if (!current_loader->AssociateDMPbufferSGIX) is_loaded = false;
-        
-        return is_loaded;
-    }
-
-    bool has_sgix_dmbuffer()
-    {
-        return IsExtensionSupported("GLX_SGIX_dmbuffer");
-    }
-
-
-    Bool glx_sgix_dmbuffer::glXAssociateDMPbufferSGIX(Display* dpy, GLXPbufferSGIX pbuffer, DMparams* params, DMbuffer dmbuffer)
-    {
-        return current_loader->AssociateDMPbufferSGIX(dpy, pbuffer, params, dmbuffer);
-    }
-#endif /* _DM_BUFFER_H_ */
-
-    bool load_sgix_swap_group()
-    {        
-        assert(GetCurrentCtx() && "load_sgix_swap_group() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        current_loader->JoinSwapGroupSGIX = (Loader::PFNGLXJOINSWAPGROUPSGIXPROC) GetProcAddr("glXJoinSwapGroupSGIX");
-        if (!current_loader->JoinSwapGroupSGIX) is_loaded = false;
-        
-        return is_loaded;
-    }
-
-    bool has_sgix_swap_group()
-    {
-        return IsExtensionSupported("GLX_SGIX_swap_group");
-    }
-
-
-    void glx_sgix_swap_group::glXJoinSwapGroupSGIX(Display* dpy, GLXDrawable drawable, GLXDrawable member)
-    {
-        current_loader->JoinSwapGroupSGIX(dpy, drawable, member);
-    }
-
-
-    bool load_sgix_swap_barrier()
-    {        
-        assert(GetCurrentCtx() && "load_sgix_swap_barrier() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        current_loader->BindSwapBarrierSGIX = (Loader::PFNGLXBINDSWAPBARRIERSGIXPROC) GetProcAddr("glXBindSwapBarrierSGIX");
-        if (!current_loader->BindSwapBarrierSGIX) is_loaded = false;
-        current_loader->QueryMaxSwapBarriersSGIX = (Loader::PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) GetProcAddr("glXQueryMaxSwapBarriersSGIX");
-        if (!current_loader->QueryMaxSwapBarriersSGIX) is_loaded = false;
-        
-        return is_loaded;
-    }
-
-    bool has_sgix_swap_barrier()
-    {
-        return IsExtensionSupported("GLX_SGIX_swap_barrier");
-    }
-
-
-    void glx_sgix_swap_barrier::glXBindSwapBarrierSGIX(Display* dpy, GLXDrawable drawable, int barrier)
-    {
-        current_loader->BindSwapBarrierSGIX(dpy, drawable, barrier);
-    }
-
-    Bool glx_sgix_swap_barrier::glXQueryMaxSwapBarriersSGIX(Display* dpy, int screen, int* max)
-    {
-        return current_loader->QueryMaxSwapBarriersSGIX(dpy, screen, max);
-    }
-
-
-    bool load_sun_get_transparent_index()
-    {        
-        assert(GetCurrentCtx() && "load_sun_get_transparent_index() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        current_loader->GetTransparentIndexSUN = (Loader::PFNGLXGETTRANSPARENTINDEXSUNPROC) GetProcAddr("glXGetTransparentIndexSUN");
-        if (!current_loader->GetTransparentIndexSUN) is_loaded = false;
-        
-        return is_loaded;
-    }
-
-    bool has_sun_get_transparent_index()
-    {
-        return IsExtensionSupported("GLX_SUN_get_transparent_index");
-    }
-
-
-    Status glx_sun_get_transparent_index::glXGetTransparentIndexSUN(Display* dpy, Window overlay, Window underlay, long* pTransparentIndex)
-    {
-        return current_loader->GetTransparentIndexSUN(dpy, overlay, underlay, pTransparentIndex);
-    }
-
-
-    bool load_mesa_copy_sub_buffer()
-    {        
-        assert(GetCurrentCtx() && "load_mesa_copy_sub_buffer() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        current_loader->CopySubBufferMESA = (Loader::PFNGLXCOPYSUBBUFFERMESAPROC) GetProcAddr("glXCopySubBufferMESA");
-        if (!current_loader->CopySubBufferMESA) is_loaded = false;
-        
-        return is_loaded;
-    }
-
-    bool has_mesa_copy_sub_buffer()
-    {
-        return IsExtensionSupported("GLX_MESA_copy_sub_buffer");
-    }
-
-
-    void glx_mesa_copy_sub_buffer::glXCopySubBufferMESA(Display* dpy, GLXDrawable drawable, int x, int y, int width, int height)
-    {
-        current_loader->CopySubBufferMESA(dpy, drawable, x, y, width, height);
-    }
-
-
-    bool load_mesa_pixmap_colormap()
-    {        
-        assert(GetCurrentCtx() && "load_mesa_pixmap_colormap() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        current_loader->CreateGLXPixmapMESA = (Loader::PFNGLXCREATEGLXPIXMAPMESAPROC) GetProcAddr("glXCreateGLXPixmapMESA");
-        if (!current_loader->CreateGLXPixmapMESA) is_loaded = false;
-        
-        return is_loaded;
-    }
-
-    bool has_mesa_pixmap_colormap()
-    {
-        return IsExtensionSupported("GLX_MESA_pixmap_colormap");
-    }
-
-
-    GLXPixmap glx_mesa_pixmap_colormap::glXCreateGLXPixmapMESA(Display* dpy, XVisualInfo* visual, Pixmap pixmap, Colormap cmap)
-    {
-        return current_loader->CreateGLXPixmapMESA(dpy, visual, pixmap, cmap);
-    }
-
-
-    bool load_mesa_release_buffers()
-    {        
-        assert(GetCurrentCtx() && "load_mesa_release_buffers() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        current_loader->ReleaseBuffersMESA = (Loader::PFNGLXRELEASEBUFFERSMESAPROC) GetProcAddr("glXReleaseBuffersMESA");
-        if (!current_loader->ReleaseBuffersMESA) is_loaded = false;
-        
-        return is_loaded;
-    }
-
-    bool has_mesa_release_buffers()
-    {
-        return IsExtensionSupported("GLX_MESA_release_buffers");
-    }
-
-
-    Bool glx_mesa_release_buffers::glXReleaseBuffersMESA(Display* dpy, GLXDrawable drawable)
-    {
-        return current_loader->ReleaseBuffersMESA(dpy, drawable);
-    }
-
-
-    bool load_mesa_set_3dfx_mode()
-    {        
-        assert(GetCurrentCtx() && "load_mesa_set_3dfx_mode() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        current_loader->Set3DfxModeMESA = (Loader::PFNGLXSET3DFXMODEMESAPROC) GetProcAddr("glXSet3DfxModeMESA");
-        if (!current_loader->Set3DfxModeMESA) is_loaded = false;
-        
-        return is_loaded;
-    }
-
-    bool has_mesa_set_3dfx_mode()
-    {
-        return IsExtensionSupported("GLX_MESA_set_3dfx_mode");
-    }
-
-
-    Bool glx_mesa_set_3dfx_mode::glXSet3DfxModeMESA(int mode)
-    {
-        return current_loader->Set3DfxModeMESA(mode);
-    }
-
-
-    bool load_sgix_visual_select_group()
-    {        
-        assert(GetCurrentCtx() && "load_sgix_visual_select_group() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        
-        return is_loaded;
-    }
-
-    bool has_sgix_visual_select_group()
-    {
-        return IsExtensionSupported("GLX_SGIX_visual_select_group");
-    }
-
-
-
-    bool load_oml_swap_method()
-    {        
-        assert(GetCurrentCtx() && "load_oml_swap_method() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        
-        return is_loaded;
-    }
-
-    bool has_oml_swap_method()
-    {
-        return IsExtensionSupported("GLX_OML_swap_method");
-    }
-
-
-
-    bool load_oml_sync_control()
-    {        
-        assert(GetCurrentCtx() && "load_oml_sync_control() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        current_loader->GetSyncValuesOML = (Loader::PFNGLXGETSYNCVALUESOMLPROC) GetProcAddr("glXGetSyncValuesOML");
-        if (!current_loader->GetSyncValuesOML) is_loaded = false;
-        current_loader->GetMscRateOML = (Loader::PFNGLXGETMSCRATEOMLPROC) GetProcAddr("glXGetMscRateOML");
-        if (!current_loader->GetMscRateOML) is_loaded = false;
-        current_loader->SwapBuffersMscOML = (Loader::PFNGLXSWAPBUFFERSMSCOMLPROC) GetProcAddr("glXSwapBuffersMscOML");
-        if (!current_loader->SwapBuffersMscOML) is_loaded = false;
-        current_loader->WaitForMscOML = (Loader::PFNGLXWAITFORMSCOMLPROC) GetProcAddr("glXWaitForMscOML");
-        if (!current_loader->WaitForMscOML) is_loaded = false;
-        current_loader->WaitForSbcOML = (Loader::PFNGLXWAITFORSBCOMLPROC) GetProcAddr("glXWaitForSbcOML");
-        if (!current_loader->WaitForSbcOML) is_loaded = false;
-        
-        return is_loaded;
-    }
-
-    bool has_oml_sync_control()
-    {
-        return IsExtensionSupported("GLX_OML_sync_control");
-    }
-
-
-    Bool glx_oml_sync_control::glXGetSyncValuesOML(Display* dpy, GLXDrawable drawable, int64_t* ust, int64_t* msc, int64_t* sbc)
-    {
-        return 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 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 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 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 current_loader->WaitForSbcOML(dpy, drawable, target_sbc, ust, msc, sbc);
-    }
-
-
-    bool load_nv_float_buffer()
-    {        
-        assert(GetCurrentCtx() && "load_nv_float_buffer() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        
-        return is_loaded;
-    }
-
-    bool has_nv_float_buffer()
-    {
-        return IsExtensionSupported("GLX_NV_float_buffer");
-    }
-
-
-
-    bool load_sgix_hyperpipe()
-    {        
-        assert(GetCurrentCtx() && "load_sgix_hyperpipe() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        current_loader->QueryHyperpipeNetworkSGIX = (Loader::PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) GetProcAddr("glXQueryHyperpipeNetworkSGIX");
-        if (!current_loader->QueryHyperpipeNetworkSGIX) is_loaded = false;
-        current_loader->HyperpipeConfigSGIX = (Loader::PFNGLXHYPERPIPECONFIGSGIXPROC) GetProcAddr("glXHyperpipeConfigSGIX");
-        if (!current_loader->HyperpipeConfigSGIX) is_loaded = false;
-        current_loader->QueryHyperpipeConfigSGIX = (Loader::PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) GetProcAddr("glXQueryHyperpipeConfigSGIX");
-        if (!current_loader->QueryHyperpipeConfigSGIX) is_loaded = false;
-        current_loader->DestroyHyperpipeConfigSGIX = (Loader::PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) GetProcAddr("glXDestroyHyperpipeConfigSGIX");
-        if (!current_loader->DestroyHyperpipeConfigSGIX) is_loaded = false;
-        current_loader->BindHyperpipeSGIX = (Loader::PFNGLXBINDHYPERPIPESGIXPROC) GetProcAddr("glXBindHyperpipeSGIX");
-        if (!current_loader->BindHyperpipeSGIX) is_loaded = false;
-        current_loader->QueryHyperpipeBestAttribSGIX = (Loader::PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) GetProcAddr("glXQueryHyperpipeBestAttribSGIX");
-        if (!current_loader->QueryHyperpipeBestAttribSGIX) is_loaded = false;
-        current_loader->HyperpipeAttribSGIX = (Loader::PFNGLXHYPERPIPEATTRIBSGIXPROC) GetProcAddr("glXHyperpipeAttribSGIX");
-        if (!current_loader->HyperpipeAttribSGIX) is_loaded = false;
-        current_loader->QueryHyperpipeAttribSGIX = (Loader::PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) GetProcAddr("glXQueryHyperpipeAttribSGIX");
-        if (!current_loader->QueryHyperpipeAttribSGIX) is_loaded = false;
-        
-        return is_loaded;
-    }
-
-    bool has_sgix_hyperpipe()
-    {
-        return IsExtensionSupported("GLX_SGIX_hyperpipe");
-    }
-
-
-    GLXHyperpipeNetworkSGIX * glx_sgix_hyperpipe::glXQueryHyperpipeNetworkSGIX(Display* dpy, int* npipes)
-    {
-        return current_loader->QueryHyperpipeNetworkSGIX(dpy, npipes);
-    }
-
-    int glx_sgix_hyperpipe::glXHyperpipeConfigSGIX(Display* dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX* cfg, int* hpId)
-    {
-        return current_loader->HyperpipeConfigSGIX(dpy, networkId, npipes, cfg, hpId);
-    }
-
-    GLXHyperpipeConfigSGIX * glx_sgix_hyperpipe::glXQueryHyperpipeConfigSGIX(Display* dpy, int hpId, int* npipes)
-    {
-        return current_loader->QueryHyperpipeConfigSGIX(dpy, hpId, npipes);
-    }
-
-    int glx_sgix_hyperpipe::glXDestroyHyperpipeConfigSGIX(Display* dpy, int hpId)
-    {
-        return current_loader->DestroyHyperpipeConfigSGIX(dpy, hpId);
-    }
-
-    int glx_sgix_hyperpipe::glXBindHyperpipeSGIX(Display* dpy, int hpId)
-    {
-        return current_loader->BindHyperpipeSGIX(dpy, hpId);
-    }
-
-    int glx_sgix_hyperpipe::glXQueryHyperpipeBestAttribSGIX(Display* dpy, int timeSlice, int attrib, int size, void* attribList, void* returnAttribList)
-    {
-        return 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 current_loader->HyperpipeAttribSGIX(dpy, timeSlice, attrib, size, attribList);
-    }
-
-    int glx_sgix_hyperpipe::glXQueryHyperpipeAttribSGIX(Display* dpy, int timeSlice, int attrib, int size, void* returnAttribList)
-    {
-        return current_loader->QueryHyperpipeAttribSGIX(dpy, timeSlice, attrib, size, returnAttribList);
-    }
-
-
-    bool load_mesa_agp_offset()
-    {        
-        assert(GetCurrentCtx() && "load_mesa_agp_offset() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        current_loader->GetAGPOffsetMESA = (Loader::PFNGLXGETAGPOFFSETMESAPROC) GetProcAddr("glXGetAGPOffsetMESA");
-        if (!current_loader->GetAGPOffsetMESA) is_loaded = false;
-        
-        return is_loaded;
-    }
-
-    bool has_mesa_agp_offset()
-    {
-        return IsExtensionSupported("GLX_MESA_agp_offset");
-    }
-
-
-    unsigned int glx_mesa_agp_offset::glXGetAGPOffsetMESA(const void* pointer)
-    {
-        return current_loader->GetAGPOffsetMESA(pointer);
-    }
-
-
-    bool load_ext_fbconfig_packed_float()
-    {        
-        assert(GetCurrentCtx() && "load_ext_fbconfig_packed_float() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        
-        return is_loaded;
-    }
-
-    bool has_ext_fbconfig_packed_float()
-    {
-        return IsExtensionSupported("GLX_EXT_fbconfig_packed_float");
-    }
-
-
-
-    bool load_ext_framebuffer_srgb()
-    {        
-        assert(GetCurrentCtx() && "load_ext_framebuffer_srgb() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        
-        return is_loaded;
-    }
-
-    bool has_ext_framebuffer_srgb()
-    {
-        return IsExtensionSupported("GLX_EXT_framebuffer_sRGB");
-    }
-
-
-
-    bool load_ext_texture_from_pixmap()
-    {        
-        assert(GetCurrentCtx() && "load_ext_texture_from_pixmap() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        current_loader->BindTexImageEXT = (Loader::PFNGLXBINDTEXIMAGEEXTPROC) GetProcAddr("glXBindTexImageEXT");
-        if (!current_loader->BindTexImageEXT) is_loaded = false;
-        current_loader->ReleaseTexImageEXT = (Loader::PFNGLXRELEASETEXIMAGEEXTPROC) GetProcAddr("glXReleaseTexImageEXT");
-        if (!current_loader->ReleaseTexImageEXT) is_loaded = false;
-        
-        return is_loaded;
-    }
-
-    bool has_ext_texture_from_pixmap()
-    {
-        return IsExtensionSupported("GLX_EXT_texture_from_pixmap");
-    }
-
-
-    void glx_ext_texture_from_pixmap::glXBindTexImageEXT(Display* dpy, GLXDrawable drawable, int buffer, const int* attrib_list)
-    {
-        current_loader->BindTexImageEXT(dpy, drawable, buffer, attrib_list);
-    }
-
-    void glx_ext_texture_from_pixmap::glXReleaseTexImageEXT(Display* dpy, GLXDrawable drawable, int buffer)
-    {
-        current_loader->ReleaseTexImageEXT(dpy, drawable, buffer);
-    }
-
-
-    bool load_nv_present_video()
-    {        
-        assert(GetCurrentCtx() && "load_nv_present_video() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        current_loader->EnumerateVideoDevicesNV = (Loader::PFNGLXENUMERATEVIDEODEVICESNVPROC) GetProcAddr("glXEnumerateVideoDevicesNV");
-        if (!current_loader->EnumerateVideoDevicesNV) is_loaded = false;
-        current_loader->BindVideoDeviceNV = (Loader::PFNGLXBINDVIDEODEVICENVPROC) GetProcAddr("glXBindVideoDeviceNV");
-        if (!current_loader->BindVideoDeviceNV) is_loaded = false;
-        
-        return is_loaded;
-    }
-
-    bool has_nv_present_video()
-    {
-        return IsExtensionSupported("GLX_NV_present_video");
-    }
-
-
-    unsigned int * glx_nv_present_video::glXEnumerateVideoDevicesNV(Display* dpy, int screen, int* nelements)
-    {
-        return 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 current_loader->BindVideoDeviceNV(dpy, video_slot, video_device, attrib_list);
-    }
-
-
-    bool load_nv_video_output()
-    {        
-        assert(GetCurrentCtx() && "load_nv_video_output() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        current_loader->GetVideoDeviceNV = (Loader::PFNGLXGETVIDEODEVICENVPROC) GetProcAddr("glXGetVideoDeviceNV");
-        if (!current_loader->GetVideoDeviceNV) is_loaded = false;
-        current_loader->ReleaseVideoDeviceNV = (Loader::PFNGLXRELEASEVIDEODEVICENVPROC) GetProcAddr("glXReleaseVideoDeviceNV");
-        if (!current_loader->ReleaseVideoDeviceNV) is_loaded = false;
-        current_loader->BindVideoImageNV = (Loader::PFNGLXBINDVIDEOIMAGENVPROC) GetProcAddr("glXBindVideoImageNV");
-        if (!current_loader->BindVideoImageNV) is_loaded = false;
-        current_loader->ReleaseVideoImageNV = (Loader::PFNGLXRELEASEVIDEOIMAGENVPROC) GetProcAddr("glXReleaseVideoImageNV");
-        if (!current_loader->ReleaseVideoImageNV) is_loaded = false;
-        current_loader->SendPbufferToVideoNV = (Loader::PFNGLXSENDPBUFFERTOVIDEONVPROC) GetProcAddr("glXSendPbufferToVideoNV");
-        if (!current_loader->SendPbufferToVideoNV) is_loaded = false;
-        current_loader->GetVideoInfoNV = (Loader::PFNGLXGETVIDEOINFONVPROC) GetProcAddr("glXGetVideoInfoNV");
-        if (!current_loader->GetVideoInfoNV) is_loaded = false;
-        
-        return is_loaded;
-    }
-
-    bool has_nv_video_output()
-    {
-        return IsExtensionSupported("GLX_NV_video_output");
-    }
-
-
-    int glx_nv_video_output::glXGetVideoDeviceNV(Display* dpy, int screen, int numVideoDevices, GLXVideoDeviceNV* pVideoDevice)
-    {
-        return current_loader->GetVideoDeviceNV(dpy, screen, numVideoDevices, pVideoDevice);
-    }
-
-    int glx_nv_video_output::glXReleaseVideoDeviceNV(Display* dpy, int screen, GLXVideoDeviceNV VideoDevice)
-    {
-        return current_loader->ReleaseVideoDeviceNV(dpy, screen, VideoDevice);
-    }
-
-    int glx_nv_video_output::glXBindVideoImageNV(Display* dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer)
-    {
-        return current_loader->BindVideoImageNV(dpy, VideoDevice, pbuf, iVideoBuffer);
-    }
-
-    int glx_nv_video_output::glXReleaseVideoImageNV(Display* dpy, GLXPbuffer pbuf)
-    {
-        return current_loader->ReleaseVideoImageNV(dpy, pbuf);
-    }
-
-    int glx_nv_video_output::glXSendPbufferToVideoNV(Display* dpy, GLXPbuffer pbuf, int iBufferType, unsigned long* pulCounterPbuffer, GLboolean bBlock)
-    {
-        return 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 current_loader->GetVideoInfoNV(dpy, screen, VideoDevice, pulCounterOutputPbuffer, pulCounterOutputVideo);
-    }
-
-
-    bool load_nv_swap_group()
-    {        
-        assert(GetCurrentCtx() && "load_nv_swap_group() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        current_loader->JoinSwapGroupNV = (Loader::PFNGLXJOINSWAPGROUPNVPROC) GetProcAddr("glXJoinSwapGroupNV");
-        if (!current_loader->JoinSwapGroupNV) is_loaded = false;
-        current_loader->BindSwapBarrierNV = (Loader::PFNGLXBINDSWAPBARRIERNVPROC) GetProcAddr("glXBindSwapBarrierNV");
-        if (!current_loader->BindSwapBarrierNV) is_loaded = false;
-        current_loader->QuerySwapGroupNV = (Loader::PFNGLXQUERYSWAPGROUPNVPROC) GetProcAddr("glXQuerySwapGroupNV");
-        if (!current_loader->QuerySwapGroupNV) is_loaded = false;
-        current_loader->QueryMaxSwapGroupsNV = (Loader::PFNGLXQUERYMAXSWAPGROUPSNVPROC) GetProcAddr("glXQueryMaxSwapGroupsNV");
-        if (!current_loader->QueryMaxSwapGroupsNV) is_loaded = false;
-        current_loader->QueryFrameCountNV = (Loader::PFNGLXQUERYFRAMECOUNTNVPROC) GetProcAddr("glXQueryFrameCountNV");
-        if (!current_loader->QueryFrameCountNV) is_loaded = false;
-        current_loader->ResetFrameCountNV = (Loader::PFNGLXRESETFRAMECOUNTNVPROC) GetProcAddr("glXResetFrameCountNV");
-        if (!current_loader->ResetFrameCountNV) is_loaded = false;
-        
-        return is_loaded;
-    }
-
-    bool has_nv_swap_group()
-    {
-        return IsExtensionSupported("GLX_NV_swap_group");
-    }
-
-
-    Bool glx_nv_swap_group::glXJoinSwapGroupNV(Display* dpy, GLXDrawable drawable, GLuint group)
-    {
-        return current_loader->JoinSwapGroupNV(dpy, drawable, group);
-    }
-
-    Bool glx_nv_swap_group::glXBindSwapBarrierNV(Display* dpy, GLuint group, GLuint barrier)
-    {
-        return current_loader->BindSwapBarrierNV(dpy, group, barrier);
-    }
-
-    Bool glx_nv_swap_group::glXQuerySwapGroupNV(Display* dpy, GLXDrawable drawable, GLuint* group, GLuint* barrier)
-    {
-        return current_loader->QuerySwapGroupNV(dpy, drawable, group, barrier);
-    }
-
-    Bool glx_nv_swap_group::glXQueryMaxSwapGroupsNV(Display* dpy, int screen, GLuint* maxGroups, GLuint* maxBarriers)
-    {
-        return current_loader->QueryMaxSwapGroupsNV(dpy, screen, maxGroups, maxBarriers);
-    }
-
-    Bool glx_nv_swap_group::glXQueryFrameCountNV(Display* dpy, int screen, GLuint* count)
-    {
-        return current_loader->QueryFrameCountNV(dpy, screen, count);
-    }
-
-    Bool glx_nv_swap_group::glXResetFrameCountNV(Display* dpy, int screen)
-    {
-        return current_loader->ResetFrameCountNV(dpy, screen);
-    }
-
-
-    bool load_nv_video_capture()
-    {        
-        assert(GetCurrentCtx() && "load_nv_video_capture() called without a current context");
-        
-        if (current_loader == 0)
-        {
-            loaders.push_back(std::tr1::shared_ptr<Loader>(new Loader));
-            current_loader = loaders[0].get();
-        }
-        
-        bool is_loaded = true;
-
-        current_loader->BindVideoCaptureDeviceNV = (Loader::PFNGLXBINDVIDEOCAPTUREDEVICENVPROC) GetProcAddr("glXBindVideoCaptureDeviceNV");
-        if (!current_loader->BindVideoCaptureDeviceNV) is_loaded = false;
-        current_loader->EnumerateVideoCaptureDevicesNV = (Loader::PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC) GetProcAddr("glXEnumerateVideoCaptureDevicesNV");
-        if (!current_loader->EnumerateVideoCaptureDevicesNV) is_loaded = false;
-        current_loader->LockVideoCaptureDeviceNV = (Loader::PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC) GetProcAddr("glXLockVideoCaptureDeviceNV");
-        if (!current_loader->LockVideoCaptureDeviceNV) is_loaded = false;
-        current_loader->QueryVideoCaptureDeviceNV = (Loader::PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC) GetProcAddr("glXQueryVideoCaptureDeviceNV");
-        if (!current_loader->QueryVideoCaptureDeviceNV) is_loaded = false;
-        current_loader->ReleaseVideoCaptureDeviceNV = (Loader::PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC) GetProcAddr("glXReleaseVideoCaptureDeviceNV");
-        if (!current_loader->ReleaseVideoCaptureDeviceNV) is_loaded = false;
-        
-        return is_loaded;
-    }
-
-    bool has_nv_video_capture()
-    {
-        return IsExtensionSupported("GLX_NV_video_capture");
-    }
-
-
-    int glx_nv_video_capture::glXBindVideoCaptureDeviceNV(Display* dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device)
-    {
-        return current_loader->BindVideoCaptureDeviceNV(dpy, video_capture_slot, device);
-    }
-
-    GLXVideoCaptureDeviceNV * glx_nv_video_capture::glXEnumerateVideoCaptureDevicesNV(Display* dpy, int screen, int* nelements)
-    {
-        return current_loader->EnumerateVideoCaptureDevicesNV(dpy, screen, nelements);
-    }
-
-    void glx_nv_video_capture::glXLockVideoCaptureDeviceNV(Display* dpy, GLXVideoCaptureDeviceNV device)
-    {
-        current_loader->LockVideoCaptureDeviceNV(dpy, device);
-    }
-
-    int glx_nv_video_capture::glXQueryVideoCaptureDeviceNV(Display* dpy, GLXVideoCaptureDeviceNV device, int attribute, int* value)
-    {
-        return current_loader->QueryVideoCaptureDeviceNV(dpy, device, attribute, value);
-    }
-
-    void glx_nv_video_capture::glXReleaseVideoCaptureDeviceNV(Display* dpy, GLXVideoCaptureDeviceNV device)
-    {
-        current_loader->ReleaseVideoCaptureDeviceNV(dpy, device);
-    }
-
-