[OPENGL32_NEW]
authorJérôme Gardou <jerome.gardou@reactos.org>
Sun, 15 Sep 2013 20:54:01 +0000 (20:54 +0000)
committerJérôme Gardou <jerome.gardou@reactos.org>
Sun, 15 Sep 2013 20:54:01 +0000 (20:54 +0000)
Introduce a new opengl32 implementation, the 3D library with better perspectives (tm), featuring:
 - A new software rendering implementation on top of osmesa.
 - Rendering to bitmaps
 - Thread safety.
 - A try to be really compatible with ICD DLLs (WIP)
 - Other cool stuff, check log for details.
WIP, the SW implementation already works.

svn path=/trunk/; revision=60150

reactos/dll/opengl/opengl32_new/CMakeLists.txt [new file with mode: 0644]
reactos/dll/opengl/opengl32_new/apistubs.c [new file with mode: 0644]
reactos/dll/opengl/opengl32_new/dllmain.c [new file with mode: 0644]
reactos/dll/opengl/opengl32_new/glfuncs.h [new file with mode: 0644]
reactos/dll/opengl/opengl32_new/icd.h [new file with mode: 0644]
reactos/dll/opengl/opengl32_new/icdload.c [new file with mode: 0644]
reactos/dll/opengl/opengl32_new/opengl32.h [new file with mode: 0644]
reactos/dll/opengl/opengl32_new/opengl32.spec [new file with mode: 0644]
reactos/dll/opengl/opengl32_new/swimpl.c [new file with mode: 0644]
reactos/dll/opengl/opengl32_new/wgl.c [new file with mode: 0644]

diff --git a/reactos/dll/opengl/opengl32_new/CMakeLists.txt b/reactos/dll/opengl/opengl32_new/CMakeLists.txt
new file mode 100644 (file)
index 0000000..666a0be
--- /dev/null
@@ -0,0 +1,37 @@
+
+spec2def(opengl32.dll opengl32.spec ADD_IMPORTLIB)
+
+add_definitions(
+    -D_GDI32_ # prevent gl* being declared __declspec(dllimport) in MS headers
+    -DBUILD_GL32 # declare gl* as __declspec(dllexport) in Mesa headers
+)
+
+# useful to test under windows <> w2k3
+set(OPENGL32_USE_TLS TRUE)
+
+if(OPENGL32_USE_TLS)
+    add_definitions(-DOPENGL32_USE_TLS)
+endif()
+
+list(APPEND SOURCE
+    apistubs.c
+    dllmain.c
+    icdload.c
+    swimpl.c
+    wgl.c
+    ${CMAKE_CURRENT_BINARY_DIR}/opengl32_stubs.c
+    ${CMAKE_CURRENT_BINARY_DIR}/opengl32.def
+)
+
+if((ARCH STREQUAL "i386") AND (NOT OPENGL32_USE_TLS))
+    # Optimisation: use asm trampolines to ICD provided functions
+    list(APPEND SOURCE
+        glapi_x86.s
+    )
+endif()
+
+add_library(opengl32_new SHARED ${SOURCE})
+target_link_libraries(opengl32_new wine ${PSEH_LIB})
+set_module_type(opengl32_new win32dll)
+add_importlibs(opengl32_new gdi32 user32 advapi32 msvcrt kernel32 ntdll)
+add_cd_file(TARGET opengl32_new DESTINATION reactos/system32 FOR all)
\ No newline at end of file
diff --git a/reactos/dll/opengl/opengl32_new/apistubs.c b/reactos/dll/opengl/opengl32_new/apistubs.c
new file mode 100644 (file)
index 0000000..6b6feb8
--- /dev/null
@@ -0,0 +1,3713 @@
+/*
+ * COPYRIGHT:            See COPYING in the top level directory
+ * PROJECT:              ReactOS kernel
+ * FILE:                 lib/opengl32/apistubs.c
+ * PURPOSE:              OpenGL32 lib, glXXX functions
+ */
+
+#include "opengl32.h"
+
+static void GLAPIENTRY nop_NewList(GLuint list, GLenum mode)
+{
+    (void) list; (void) mode;
+}
+
+static void GLAPIENTRY nop_EndList(void)
+{
+}
+
+static void GLAPIENTRY nop_CallList(GLuint list)
+{
+    (void) list;
+}
+
+static void GLAPIENTRY nop_CallLists(GLsizei n, GLenum type, const GLvoid * lists)
+{
+    (void) n; (void) type; (void) lists;
+}
+
+static void GLAPIENTRY nop_DeleteLists(GLuint list, GLsizei range)
+{
+    (void) list; (void) range;
+}
+
+static GLuint GLAPIENTRY nop_GenLists(GLsizei range)
+{
+    (void) range;
+    return 0;
+}
+
+static void GLAPIENTRY nop_ListBase(GLuint base)
+{
+    (void) base;
+}
+
+static void GLAPIENTRY nop_Begin(GLenum mode)
+{
+    (void) mode;
+}
+
+static void GLAPIENTRY nop_Bitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte * bitmap)
+{
+    (void) width; (void) height; (void) xorig; (void) yorig; (void) xmove; (void) ymove; (void) bitmap;
+}
+
+static void GLAPIENTRY nop_Color3b(GLbyte red, GLbyte green, GLbyte blue)
+{
+    (void) red; (void) green; (void) blue;
+}
+
+static void GLAPIENTRY nop_Color3bv(const GLbyte * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_Color3d(GLdouble red, GLdouble green, GLdouble blue)
+{
+    (void) red; (void) green; (void) blue;
+}
+
+static void GLAPIENTRY nop_Color3dv(const GLdouble * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_Color3f(GLfloat red, GLfloat green, GLfloat blue)
+{
+    (void) red; (void) green; (void) blue;
+}
+
+static void GLAPIENTRY nop_Color3fv(const GLfloat * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_Color3i(GLint red, GLint green, GLint blue)
+{
+    (void) red; (void) green; (void) blue;
+}
+
+static void GLAPIENTRY nop_Color3iv(const GLint * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_Color3s(GLshort red, GLshort green, GLshort blue)
+{
+    (void) red; (void) green; (void) blue;
+}
+
+static void GLAPIENTRY nop_Color3sv(const GLshort * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_Color3ub(GLubyte red, GLubyte green, GLubyte blue)
+{
+    (void) red; (void) green; (void) blue;
+}
+
+static void GLAPIENTRY nop_Color3ubv(const GLubyte * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_Color3ui(GLuint red, GLuint green, GLuint blue)
+{
+    (void) red; (void) green; (void) blue;
+}
+
+static void GLAPIENTRY nop_Color3uiv(const GLuint * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_Color3us(GLushort red, GLushort green, GLushort blue)
+{
+    (void) red; (void) green; (void) blue;
+}
+
+static void GLAPIENTRY nop_Color3usv(const GLushort * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_Color4b(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha)
+{
+    (void) red; (void) green; (void) blue; (void) alpha;
+}
+
+static void GLAPIENTRY nop_Color4bv(const GLbyte * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_Color4d(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha)
+{
+    (void) red; (void) green; (void) blue; (void) alpha;
+}
+
+static void GLAPIENTRY nop_Color4dv(const GLdouble * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_Color4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
+{
+    (void) red; (void) green; (void) blue; (void) alpha;
+}
+
+static void GLAPIENTRY nop_Color4fv(const GLfloat * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_Color4i(GLint red, GLint green, GLint blue, GLint alpha)
+{
+    (void) red; (void) green; (void) blue; (void) alpha;
+}
+
+static void GLAPIENTRY nop_Color4iv(const GLint * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_Color4s(GLshort red, GLshort green, GLshort blue, GLshort alpha)
+{
+    (void) red; (void) green; (void) blue; (void) alpha;
+}
+
+static void GLAPIENTRY nop_Color4sv(const GLshort * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_Color4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
+{
+    (void) red; (void) green; (void) blue; (void) alpha;
+}
+
+static void GLAPIENTRY nop_Color4ubv(const GLubyte * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_Color4ui(GLuint red, GLuint green, GLuint blue, GLuint alpha)
+{
+    (void) red; (void) green; (void) blue; (void) alpha;
+}
+
+static void GLAPIENTRY nop_Color4uiv(const GLuint * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_Color4us(GLushort red, GLushort green, GLushort blue, GLushort alpha)
+{
+    (void) red; (void) green; (void) blue; (void) alpha;
+}
+
+static void GLAPIENTRY nop_Color4usv(const GLushort * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_EdgeFlag(GLboolean flag)
+{
+    (void) flag;
+}
+
+static void GLAPIENTRY nop_EdgeFlagv(const GLboolean * flag)
+{
+    (void) flag;
+}
+
+static void GLAPIENTRY nop_End(void)
+{
+}
+
+static void GLAPIENTRY nop_Indexd(GLdouble c)
+{
+    (void) c;
+}
+
+static void GLAPIENTRY nop_Indexdv(const GLdouble * c)
+{
+    (void) c;
+}
+
+static void GLAPIENTRY nop_Indexf(GLfloat c)
+{
+    (void) c;
+}
+
+static void GLAPIENTRY nop_Indexfv(const GLfloat * c)
+{
+    (void) c;
+}
+
+static void GLAPIENTRY nop_Indexi(GLint c)
+{
+    (void) c;
+}
+
+static void GLAPIENTRY nop_Indexiv(const GLint * c)
+{
+    (void) c;
+}
+
+static void GLAPIENTRY nop_Indexs(GLshort c)
+{
+    (void) c;
+}
+
+static void GLAPIENTRY nop_Indexsv(const GLshort * c)
+{
+    (void) c;
+}
+
+static void GLAPIENTRY nop_Normal3b(GLbyte nx, GLbyte ny, GLbyte nz)
+{
+    (void) nx; (void) ny; (void) nz;
+}
+
+static void GLAPIENTRY nop_Normal3bv(const GLbyte * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_Normal3d(GLdouble nx, GLdouble ny, GLdouble nz)
+{
+    (void) nx; (void) ny; (void) nz;
+}
+
+static void GLAPIENTRY nop_Normal3dv(const GLdouble * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_Normal3f(GLfloat nx, GLfloat ny, GLfloat nz)
+{
+    (void) nx; (void) ny; (void) nz;
+}
+
+static void GLAPIENTRY nop_Normal3fv(const GLfloat * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_Normal3i(GLint nx, GLint ny, GLint nz)
+{
+    (void) nx; (void) ny; (void) nz;
+}
+
+static void GLAPIENTRY nop_Normal3iv(const GLint * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_Normal3s(GLshort nx, GLshort ny, GLshort nz)
+{
+    (void) nx; (void) ny; (void) nz;
+}
+
+static void GLAPIENTRY nop_Normal3sv(const GLshort * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_RasterPos2d(GLdouble x, GLdouble y)
+{
+    (void) x; (void) y;
+}
+
+static void GLAPIENTRY nop_RasterPos2dv(const GLdouble * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_RasterPos2f(GLfloat x, GLfloat y)
+{
+    (void) x; (void) y;
+}
+
+static void GLAPIENTRY nop_RasterPos2fv(const GLfloat * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_RasterPos2i(GLint x, GLint y)
+{
+    (void) x; (void) y;
+}
+
+static void GLAPIENTRY nop_RasterPos2iv(const GLint * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_RasterPos2s(GLshort x, GLshort y)
+{
+    (void) x; (void) y;
+}
+
+static void GLAPIENTRY nop_RasterPos2sv(const GLshort * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_RasterPos3d(GLdouble x, GLdouble y, GLdouble z)
+{
+    (void) x; (void) y; (void) z;
+}
+
+static void GLAPIENTRY nop_RasterPos3dv(const GLdouble * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_RasterPos3f(GLfloat x, GLfloat y, GLfloat z)
+{
+    (void) x; (void) y; (void) z;
+}
+
+static void GLAPIENTRY nop_RasterPos3fv(const GLfloat * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_RasterPos3i(GLint x, GLint y, GLint z)
+{
+    (void) x; (void) y; (void) z;
+}
+
+static void GLAPIENTRY nop_RasterPos3iv(const GLint * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_RasterPos3s(GLshort x, GLshort y, GLshort z)
+{
+    (void) x; (void) y; (void) z;
+}
+
+static void GLAPIENTRY nop_RasterPos3sv(const GLshort * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+    (void) x; (void) y; (void) z; (void) w;
+}
+
+static void GLAPIENTRY nop_RasterPos4dv(const GLdouble * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_RasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+    (void) x; (void) y; (void) z; (void) w;
+}
+
+static void GLAPIENTRY nop_RasterPos4fv(const GLfloat * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_RasterPos4i(GLint x, GLint y, GLint z, GLint w)
+{
+    (void) x; (void) y; (void) z; (void) w;
+}
+
+static void GLAPIENTRY nop_RasterPos4iv(const GLint * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w)
+{
+    (void) x; (void) y; (void) z; (void) w;
+}
+
+static void GLAPIENTRY nop_RasterPos4sv(const GLshort * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_Rectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2)
+{
+    (void) x1; (void) y1; (void) x2; (void) y2;
+}
+
+static void GLAPIENTRY nop_Rectdv(const GLdouble * v1, const GLdouble * v2)
+{
+    (void) v1; (void) v2;
+}
+
+static void GLAPIENTRY nop_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
+{
+    (void) x1; (void) y1; (void) x2; (void) y2;
+}
+
+static void GLAPIENTRY nop_Rectfv(const GLfloat * v1, const GLfloat * v2)
+{
+    (void) v1; (void) v2;
+}
+
+static void GLAPIENTRY nop_Recti(GLint x1, GLint y1, GLint x2, GLint y2)
+{
+    (void) x1; (void) y1; (void) x2; (void) y2;
+}
+
+static void GLAPIENTRY nop_Rectiv(const GLint * v1, const GLint * v2)
+{
+    (void) v1; (void) v2;
+}
+
+static void GLAPIENTRY nop_Rects(GLshort x1, GLshort y1, GLshort x2, GLshort y2)
+{
+    (void) x1; (void) y1; (void) x2; (void) y2;
+}
+
+static void GLAPIENTRY nop_Rectsv(const GLshort * v1, const GLshort * v2)
+{
+    (void) v1; (void) v2;
+}
+
+static void GLAPIENTRY nop_TexCoord1d(GLdouble s)
+{
+    (void) s;
+}
+
+static void GLAPIENTRY nop_TexCoord1dv(const GLdouble * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_TexCoord1f(GLfloat s)
+{
+    (void) s;
+}
+
+static void GLAPIENTRY nop_TexCoord1fv(const GLfloat * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_TexCoord1i(GLint s)
+{
+    (void) s;
+}
+
+static void GLAPIENTRY nop_TexCoord1iv(const GLint * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_TexCoord1s(GLshort s)
+{
+    (void) s;
+}
+
+static void GLAPIENTRY nop_TexCoord1sv(const GLshort * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_TexCoord2d(GLdouble s, GLdouble t)
+{
+    (void) s; (void) t;
+}
+
+static void GLAPIENTRY nop_TexCoord2dv(const GLdouble * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_TexCoord2f(GLfloat s, GLfloat t)
+{
+    (void) s; (void) t;
+}
+
+static void GLAPIENTRY nop_TexCoord2fv(const GLfloat * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_TexCoord2i(GLint s, GLint t)
+{
+    (void) s; (void) t;
+}
+
+static void GLAPIENTRY nop_TexCoord2iv(const GLint * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_TexCoord2s(GLshort s, GLshort t)
+{
+    (void) s; (void) t;
+}
+
+static void GLAPIENTRY nop_TexCoord2sv(const GLshort * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_TexCoord3d(GLdouble s, GLdouble t, GLdouble r)
+{
+    (void) s; (void) t; (void) r;
+}
+
+static void GLAPIENTRY nop_TexCoord3dv(const GLdouble * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_TexCoord3f(GLfloat s, GLfloat t, GLfloat r)
+{
+    (void) s; (void) t; (void) r;
+}
+
+static void GLAPIENTRY nop_TexCoord3fv(const GLfloat * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_TexCoord3i(GLint s, GLint t, GLint r)
+{
+    (void) s; (void) t; (void) r;
+}
+
+static void GLAPIENTRY nop_TexCoord3iv(const GLint * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_TexCoord3s(GLshort s, GLshort t, GLshort r)
+{
+    (void) s; (void) t; (void) r;
+}
+
+static void GLAPIENTRY nop_TexCoord3sv(const GLshort * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_TexCoord4d(GLdouble s, GLdouble t, GLdouble r, GLdouble q)
+{
+    (void) s; (void) t; (void) r; (void) q;
+}
+
+static void GLAPIENTRY nop_TexCoord4dv(const GLdouble * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_TexCoord4f(GLfloat s, GLfloat t, GLfloat r, GLfloat q)
+{
+    (void) s; (void) t; (void) r; (void) q;
+}
+
+static void GLAPIENTRY nop_TexCoord4fv(const GLfloat * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_TexCoord4i(GLint s, GLint t, GLint r, GLint q)
+{
+    (void) s; (void) t; (void) r; (void) q;
+}
+
+static void GLAPIENTRY nop_TexCoord4iv(const GLint * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_TexCoord4s(GLshort s, GLshort t, GLshort r, GLshort q)
+{
+    (void) s; (void) t; (void) r; (void) q;
+}
+
+static void GLAPIENTRY nop_TexCoord4sv(const GLshort * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_Vertex2d(GLdouble x, GLdouble y)
+{
+    (void) x; (void) y;
+}
+
+static void GLAPIENTRY nop_Vertex2dv(const GLdouble * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_Vertex2f(GLfloat x, GLfloat y)
+{
+    (void) x; (void) y;
+}
+
+static void GLAPIENTRY nop_Vertex2fv(const GLfloat * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_Vertex2i(GLint x, GLint y)
+{
+    (void) x; (void) y;
+}
+
+static void GLAPIENTRY nop_Vertex2iv(const GLint * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_Vertex2s(GLshort x, GLshort y)
+{
+    (void) x; (void) y;
+}
+
+static void GLAPIENTRY nop_Vertex2sv(const GLshort * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_Vertex3d(GLdouble x, GLdouble y, GLdouble z)
+{
+    (void) x; (void) y; (void) z;
+}
+
+static void GLAPIENTRY nop_Vertex3dv(const GLdouble * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_Vertex3f(GLfloat x, GLfloat y, GLfloat z)
+{
+    (void) x; (void) y; (void) z;
+}
+
+static void GLAPIENTRY nop_Vertex3fv(const GLfloat * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_Vertex3i(GLint x, GLint y, GLint z)
+{
+    (void) x; (void) y; (void) z;
+}
+
+static void GLAPIENTRY nop_Vertex3iv(const GLint * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_Vertex3s(GLshort x, GLshort y, GLshort z)
+{
+    (void) x; (void) y; (void) z;
+}
+
+static void GLAPIENTRY nop_Vertex3sv(const GLshort * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_Vertex4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+    (void) x; (void) y; (void) z; (void) w;
+}
+
+static void GLAPIENTRY nop_Vertex4dv(const GLdouble * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_Vertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+    (void) x; (void) y; (void) z; (void) w;
+}
+
+static void GLAPIENTRY nop_Vertex4fv(const GLfloat * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_Vertex4i(GLint x, GLint y, GLint z, GLint w)
+{
+    (void) x; (void) y; (void) z; (void) w;
+}
+
+static void GLAPIENTRY nop_Vertex4iv(const GLint * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_Vertex4s(GLshort x, GLshort y, GLshort z, GLshort w)
+{
+    (void) x; (void) y; (void) z; (void) w;
+}
+
+static void GLAPIENTRY nop_Vertex4sv(const GLshort * v)
+{
+    (void) v;
+}
+
+static void GLAPIENTRY nop_ClipPlane(GLenum plane, const GLdouble * equation)
+{
+    (void) plane; (void) equation;
+}
+
+static void GLAPIENTRY nop_ColorMaterial(GLenum face, GLenum mode)
+{
+    (void) face; (void) mode;
+}
+
+static void GLAPIENTRY nop_CullFace(GLenum mode)
+{
+    (void) mode;
+}
+
+static void GLAPIENTRY nop_Fogf(GLenum pname, GLfloat param)
+{
+    (void) pname; (void) param;
+}
+
+static void GLAPIENTRY nop_Fogfv(GLenum pname, const GLfloat * params)
+{
+    (void) pname; (void) params;
+}
+
+static void GLAPIENTRY nop_Fogi(GLenum pname, GLint param)
+{
+    (void) pname; (void) param;
+}
+
+static void GLAPIENTRY nop_Fogiv(GLenum pname, const GLint * params)
+{
+    (void) pname; (void) params;
+}
+
+static void GLAPIENTRY nop_FrontFace(GLenum mode)
+{
+    (void) mode;
+}
+
+static void GLAPIENTRY nop_Hint(GLenum target, GLenum mode)
+{
+    (void) target; (void) mode;
+}
+
+static void GLAPIENTRY nop_Lightf(GLenum light, GLenum pname, GLfloat param)
+{
+    (void) light; (void) pname; (void) param;
+}
+
+static void GLAPIENTRY nop_Lightfv(GLenum light, GLenum pname, const GLfloat * params)
+{
+    (void) light; (void) pname; (void) params;
+}
+
+static void GLAPIENTRY nop_Lighti(GLenum light, GLenum pname, GLint param)
+{
+    (void) light; (void) pname; (void) param;
+}
+
+static void GLAPIENTRY nop_Lightiv(GLenum light, GLenum pname, const GLint * params)
+{
+    (void) light; (void) pname; (void) params;
+}
+
+static void GLAPIENTRY nop_LightModelf(GLenum pname, GLfloat param)
+{
+    (void) pname; (void) param;
+}
+
+static void GLAPIENTRY nop_LightModelfv(GLenum pname, const GLfloat * params)
+{
+    (void) pname; (void) params;
+}
+
+static void GLAPIENTRY nop_LightModeli(GLenum pname, GLint param)
+{
+    (void) pname; (void) param;
+}
+
+static void GLAPIENTRY nop_LightModeliv(GLenum pname, const GLint * params)
+{
+    (void) pname; (void) params;
+}
+
+static void GLAPIENTRY nop_LineStipple(GLint factor, GLushort pattern)
+{
+    (void) factor; (void) pattern;
+}
+
+static void GLAPIENTRY nop_LineWidth(GLfloat width)
+{
+    (void) width;
+}
+
+static void GLAPIENTRY nop_Materialf(GLenum face, GLenum pname, GLfloat param)
+{
+    (void) face; (void) pname; (void) param;
+}
+
+static void GLAPIENTRY nop_Materialfv(GLenum face, GLenum pname, const GLfloat * params)
+{
+    (void) face; (void) pname; (void) params;
+}
+
+static void GLAPIENTRY nop_Materiali(GLenum face, GLenum pname, GLint param)
+{
+    (void) face; (void) pname; (void) param;
+}
+
+static void GLAPIENTRY nop_Materialiv(GLenum face, GLenum pname, const GLint * params)
+{
+    (void) face; (void) pname; (void) params;
+}
+
+static void GLAPIENTRY nop_PointSize(GLfloat size)
+{
+    (void) size;
+}
+
+static void GLAPIENTRY nop_PolygonMode(GLenum face, GLenum mode)
+{
+    (void) face; (void) mode;
+}
+
+static void GLAPIENTRY nop_PolygonStipple(const GLubyte * mask)
+{
+    (void) mask;
+}
+
+static void GLAPIENTRY nop_Scissor(GLint x, GLint y, GLsizei width, GLsizei height)
+{
+    (void) x; (void) y; (void) width; (void) height;
+}
+
+static void GLAPIENTRY nop_ShadeModel(GLenum mode)
+{
+    (void) mode;
+}
+
+static void GLAPIENTRY nop_TexParameterf(GLenum target, GLenum pname, GLfloat param)
+{
+    (void) target; (void) pname; (void) param;
+}
+
+static void GLAPIENTRY nop_TexParameterfv(GLenum target, GLenum pname, const GLfloat * params)
+{
+    (void) target; (void) pname; (void) params;
+}
+
+static void GLAPIENTRY nop_TexParameteri(GLenum target, GLenum pname, GLint param)
+{
+    (void) target; (void) pname; (void) param;
+}
+
+static void GLAPIENTRY nop_TexParameteriv(GLenum target, GLenum pname, const GLint * params)
+{
+    (void) target; (void) pname; (void) params;
+}
+
+static void GLAPIENTRY nop_TexImage1D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels)
+{
+    (void) target; (void) level; (void) internalformat; (void) width; (void) border; (void) format; (void) type; (void) pixels;
+}
+
+static void GLAPIENTRY nop_TexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels)
+{
+    (void) target; (void) level; (void) internalformat; (void) width; (void) height; (void) border; (void) format; (void) type; (void) pixels;
+}
+
+static void GLAPIENTRY nop_TexEnvf(GLenum target, GLenum pname, GLfloat param)
+{
+    (void) target; (void) pname; (void) param;
+}
+
+static void GLAPIENTRY nop_TexEnvfv(GLenum target, GLenum pname, const GLfloat * params)
+{
+    (void) target; (void) pname; (void) params;
+}
+
+static void GLAPIENTRY nop_TexEnvi(GLenum target, GLenum pname, GLint param)
+{
+    (void) target; (void) pname; (void) param;
+}
+
+static void GLAPIENTRY nop_TexEnviv(GLenum target, GLenum pname, const GLint * params)
+{
+    (void) target; (void) pname; (void) params;
+}
+
+static void GLAPIENTRY nop_TexGend(GLenum coord, GLenum pname, GLdouble param)
+{
+    (void) coord; (void) pname; (void) param;
+}
+
+static void GLAPIENTRY nop_TexGendv(GLenum coord, GLenum pname, const GLdouble * params)
+{
+    (void) coord; (void) pname; (void) params;
+}
+
+static void GLAPIENTRY nop_TexGenf(GLenum coord, GLenum pname, GLfloat param)
+{
+    (void) coord; (void) pname; (void) param;
+}
+
+static void GLAPIENTRY nop_TexGenfv(GLenum coord, GLenum pname, const GLfloat * params)
+{
+    (void) coord; (void) pname; (void) params;
+}
+
+static void GLAPIENTRY nop_TexGeni(GLenum coord, GLenum pname, GLint param)
+{
+    (void) coord; (void) pname; (void) param;
+}
+
+static void GLAPIENTRY nop_TexGeniv(GLenum coord, GLenum pname, const GLint * params)
+{
+    (void) coord; (void) pname; (void) params;
+}
+
+static void GLAPIENTRY nop_FeedbackBuffer(GLsizei size, GLenum type, GLfloat * buffer)
+{
+    (void) size; (void) type; (void) buffer;
+}
+
+static void GLAPIENTRY nop_SelectBuffer(GLsizei size, GLuint * buffer)
+{
+    (void) size; (void) buffer;
+}
+
+static GLint GLAPIENTRY nop_RenderMode(GLenum mode)
+{
+    (void) mode;
+    return 0;
+}
+
+static void GLAPIENTRY nop_InitNames(void)
+{
+}
+
+static void GLAPIENTRY nop_LoadName(GLuint name)
+{
+    (void) name;
+}
+
+static void GLAPIENTRY nop_PassThrough(GLfloat token)
+{
+    (void) token;
+}
+
+static void GLAPIENTRY nop_PopName(void)
+{
+}
+
+static void GLAPIENTRY nop_PushName(GLuint name)
+{
+    (void) name;
+}
+
+static void GLAPIENTRY nop_DrawBuffer(GLenum mode)
+{
+    (void) mode;
+}
+
+static void GLAPIENTRY nop_Clear(GLbitfield mask)
+{
+    (void) mask;
+}
+
+static void GLAPIENTRY nop_ClearAccum(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
+{
+    (void) red; (void) green; (void) blue; (void) alpha;
+}
+
+static void GLAPIENTRY nop_ClearIndex(GLfloat c)
+{
+    (void) c;
+}
+
+static void GLAPIENTRY nop_ClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
+{
+    (void) red; (void) green; (void) blue; (void) alpha;
+}
+
+static void GLAPIENTRY nop_ClearStencil(GLint s)
+{
+    (void) s;
+}
+
+static void GLAPIENTRY nop_ClearDepth(GLclampd depth)
+{
+    (void) depth;
+}
+
+static void GLAPIENTRY nop_StencilMask(GLuint mask)
+{
+    (void) mask;
+}
+
+static void GLAPIENTRY nop_ColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
+{
+    (void) red; (void) green; (void) blue; (void) alpha;
+}
+
+static void GLAPIENTRY nop_DepthMask(GLboolean flag)
+{
+    (void) flag;
+}
+
+static void GLAPIENTRY nop_IndexMask(GLuint mask)
+{
+    (void) mask;
+}
+
+static void GLAPIENTRY nop_Accum(GLenum op, GLfloat value)
+{
+    (void) op; (void) value;
+}
+
+static void GLAPIENTRY nop_Disable(GLenum cap)
+{
+    (void) cap;
+}
+
+static void GLAPIENTRY nop_Enable(GLenum cap)
+{
+    (void) cap;
+}
+
+static void GLAPIENTRY nop_Finish(void)
+{
+}
+
+static void GLAPIENTRY nop_Flush(void)
+{
+}
+
+static void GLAPIENTRY nop_PopAttrib(void)
+{
+}
+
+static void GLAPIENTRY nop_PushAttrib(GLbitfield mask)
+{
+    (void) mask;
+}
+
+static void GLAPIENTRY nop_Map1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble * points)
+{
+    (void) target; (void) u1; (void) u2; (void) stride; (void) order; (void) points;
+}
+
+static void GLAPIENTRY nop_Map1f(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat * points)
+{
+    (void) target; (void) u1; (void) u2; (void) stride; (void) order; (void) points;
+}
+
+static void GLAPIENTRY nop_Map2d(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble * points)
+{
+    (void) target; (void) u1; (void) u2; (void) ustride; (void) uorder; (void) v1; (void) v2; (void) vstride; (void) vorder; (void) points;
+}
+
+static void GLAPIENTRY nop_Map2f(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat * points)
+{
+    (void) target; (void) u1; (void) u2; (void) ustride; (void) uorder; (void) v1; (void) v2; (void) vstride; (void) vorder; (void) points;
+}
+
+static void GLAPIENTRY nop_MapGrid1d(GLint un, GLdouble u1, GLdouble u2)
+{
+    (void) un; (void) u1; (void) u2;
+}
+
+static void GLAPIENTRY nop_MapGrid1f(GLint un, GLfloat u1, GLfloat u2)
+{
+    (void) un; (void) u1; (void) u2;
+}
+
+static void GLAPIENTRY nop_MapGrid2d(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2)
+{
+    (void) un; (void) u1; (void) u2; (void) vn; (void) v1; (void) v2;
+}
+
+static void GLAPIENTRY nop_MapGrid2f(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2)
+{
+    (void) un; (void) u1; (void) u2; (void) vn; (void) v1; (void) v2;
+}
+
+static void GLAPIENTRY nop_EvalCoord1d(GLdouble u)
+{
+    (void) u;
+}
+
+static void GLAPIENTRY nop_EvalCoord1dv(const GLdouble * u)
+{
+    (void) u;
+}
+
+static void GLAPIENTRY nop_EvalCoord1f(GLfloat u)
+{
+    (void) u;
+}
+
+static void GLAPIENTRY nop_EvalCoord1fv(const GLfloat * u)
+{
+    (void) u;
+}
+
+static void GLAPIENTRY nop_EvalCoord2d(GLdouble u, GLdouble v)
+{
+    (void) u; (void) v;
+}
+
+static void GLAPIENTRY nop_EvalCoord2dv(const GLdouble * u)
+{
+    (void) u;
+}
+
+static void GLAPIENTRY nop_EvalCoord2f(GLfloat u, GLfloat v)
+{
+    (void) u; (void) v;
+}
+
+static void GLAPIENTRY nop_EvalCoord2fv(const GLfloat * u)
+{
+    (void) u;
+}
+
+static void GLAPIENTRY nop_EvalMesh1(GLenum mode, GLint i1, GLint i2)
+{
+    (void) mode; (void) i1; (void) i2;
+}
+
+static void GLAPIENTRY nop_EvalPoint1(GLint i)
+{
+    (void) i;
+}
+
+static void GLAPIENTRY nop_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
+{
+    (void) mode; (void) i1; (void) i2; (void) j1; (void) j2;
+}
+
+static void GLAPIENTRY nop_EvalPoint2(GLint i, GLint j)
+{
+    (void) i; (void) j;
+}
+
+static void GLAPIENTRY nop_AlphaFunc(GLenum func, GLclampf ref)
+{
+    (void) func; (void) ref;
+}
+
+static void GLAPIENTRY nop_BlendFunc(GLenum sfactor, GLenum dfactor)
+{
+    (void) sfactor; (void) dfactor;
+}
+
+static void GLAPIENTRY nop_LogicOp(GLenum opcode)
+{
+    (void) opcode;
+}
+
+static void GLAPIENTRY nop_StencilFunc(GLenum func, GLint ref, GLuint mask)
+{
+    (void) func; (void) ref; (void) mask;
+}
+
+static void GLAPIENTRY nop_StencilOp(GLenum fail, GLenum zfail, GLenum zpass)
+{
+    (void) fail; (void) zfail; (void) zpass;
+}
+
+static void GLAPIENTRY nop_DepthFunc(GLenum func)
+{
+    (void) func;
+}
+
+static void GLAPIENTRY nop_PixelZoom(GLfloat xfactor, GLfloat yfactor)
+{
+    (void) xfactor; (void) yfactor;
+}
+
+static void GLAPIENTRY nop_PixelTransferf(GLenum pname, GLfloat param)
+{
+    (void) pname; (void) param;
+}
+
+static void GLAPIENTRY nop_PixelTransferi(GLenum pname, GLint param)
+{
+    (void) pname; (void) param;
+}
+
+static void GLAPIENTRY nop_PixelStoref(GLenum pname, GLfloat param)
+{
+    (void) pname; (void) param;
+}
+
+static void GLAPIENTRY nop_PixelStorei(GLenum pname, GLint param)
+{
+    (void) pname; (void) param;
+}
+
+static void GLAPIENTRY nop_PixelMapfv(GLenum map, GLsizei mapsize, const GLfloat * values)
+{
+    (void) map; (void) mapsize; (void) values;
+}
+
+static void GLAPIENTRY nop_PixelMapuiv(GLenum map, GLsizei mapsize, const GLuint * values)
+{
+    (void) map; (void) mapsize; (void) values;
+}
+
+static void GLAPIENTRY nop_PixelMapusv(GLenum map, GLsizei mapsize, const GLushort * values)
+{
+    (void) map; (void) mapsize; (void) values;
+}
+
+static void GLAPIENTRY nop_ReadBuffer(GLenum mode)
+{
+    (void) mode;
+}
+
+static void GLAPIENTRY nop_CopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type)
+{
+    (void) x; (void) y; (void) width; (void) height; (void) type;
+}
+
+static void GLAPIENTRY nop_ReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * pixels)
+{
+    (void) x; (void) y; (void) width; (void) height; (void) format; (void) type; (void) pixels;
+}
+
+static void GLAPIENTRY nop_DrawPixels(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels)
+{
+    (void) width; (void) height; (void) format; (void) type; (void) pixels;
+}
+
+static void GLAPIENTRY nop_GetBooleanv(GLenum pname, GLboolean * params)
+{
+    (void) pname; (void) params;
+}
+
+static void GLAPIENTRY nop_GetClipPlane(GLenum plane, GLdouble * equation)
+{
+    (void) plane; (void) equation;
+}
+
+static void GLAPIENTRY nop_GetDoublev(GLenum pname, GLdouble * params)
+{
+    (void) pname; (void) params;
+}
+
+static GLenum GLAPIENTRY nop_GetError(void)
+{
+    return 0;
+}
+
+static void GLAPIENTRY nop_GetFloatv(GLenum pname, GLfloat * params)
+{
+    (void) pname; (void) params;
+}
+
+static void GLAPIENTRY nop_GetIntegerv(GLenum pname, GLint * params)
+{
+    (void) pname; (void) params;
+}
+
+static void GLAPIENTRY nop_GetLightfv(GLenum light, GLenum pname, GLfloat * params)
+{
+    (void) light; (void) pname; (void) params;
+}
+
+static void GLAPIENTRY nop_GetLightiv(GLenum light, GLenum pname, GLint * params)
+{
+    (void) light; (void) pname; (void) params;
+}
+
+static void GLAPIENTRY nop_GetMapdv(GLenum target, GLenum query, GLdouble * v)
+{
+    (void) target; (void) query; (void) v;
+}
+
+static void GLAPIENTRY nop_GetMapfv(GLenum target, GLenum query, GLfloat * v)
+{
+    (void) target; (void) query; (void) v;
+}
+
+static void GLAPIENTRY nop_GetMapiv(GLenum target, GLenum query, GLint * v)
+{
+    (void) target; (void) query; (void) v;
+}
+
+static void GLAPIENTRY nop_GetMaterialfv(GLenum face, GLenum pname, GLfloat * params)
+{
+    (void) face; (void) pname; (void) params;
+}
+
+static void GLAPIENTRY nop_GetMaterialiv(GLenum face, GLenum pname, GLint * params)
+{
+    (void) face; (void) pname; (void) params;
+}
+
+static void GLAPIENTRY nop_GetPixelMapfv(GLenum map, GLfloat * values)
+{
+    (void) map; (void) values;
+}
+
+static void GLAPIENTRY nop_GetPixelMapuiv(GLenum map, GLuint * values)
+{
+    (void) map; (void) values;
+}
+
+static void GLAPIENTRY nop_GetPixelMapusv(GLenum map, GLushort * values)
+{
+    (void) map; (void) values;
+}
+
+static void GLAPIENTRY nop_GetPolygonStipple(GLubyte * mask)
+{
+    (void) mask;
+}
+
+static const GLubyte * GLAPIENTRY nop_GetString(GLenum name)
+{
+    (void) name;
+    return (const GLubyte*)"";
+}
+
+static void GLAPIENTRY nop_GetTexEnvfv(GLenum target, GLenum pname, GLfloat * params)
+{
+    (void) target; (void) pname; (void) params;
+}
+
+static void GLAPIENTRY nop_GetTexEnviv(GLenum target, GLenum pname, GLint * params)
+{
+    (void) target; (void) pname; (void) params;
+}
+
+static void GLAPIENTRY nop_GetTexGendv(GLenum coord, GLenum pname, GLdouble * params)
+{
+    (void) coord; (void) pname; (void) params;
+}
+
+static void GLAPIENTRY nop_GetTexGenfv(GLenum coord, GLenum pname, GLfloat * params)
+{
+    (void) coord; (void) pname; (void) params;
+}
+
+static void GLAPIENTRY nop_GetTexGeniv(GLenum coord, GLenum pname, GLint * params)
+{
+    (void) coord; (void) pname; (void) params;
+}
+
+static void GLAPIENTRY nop_GetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels)
+{
+    (void) target; (void) level; (void) format; (void) type; (void) pixels;
+}
+
+static void GLAPIENTRY nop_GetTexParameterfv(GLenum target, GLenum pname, GLfloat * params)
+{
+    (void) target; (void) pname; (void) params;
+}
+
+static void GLAPIENTRY nop_GetTexParameteriv(GLenum target, GLenum pname, GLint * params)
+{
+    (void) target; (void) pname; (void) params;
+}
+
+static void GLAPIENTRY nop_GetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat * params)
+{
+    (void) target; (void) level; (void) pname; (void) params;
+}
+
+static void GLAPIENTRY nop_GetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint * params)
+{
+    (void) target; (void) level; (void) pname; (void) params;
+}
+
+static GLboolean GLAPIENTRY nop_IsEnabled(GLenum cap)
+{
+    (void) cap;
+    return 0;
+}
+
+static GLboolean GLAPIENTRY nop_IsList(GLuint list)
+{
+    (void) list;
+    return 0;
+}
+
+static void GLAPIENTRY nop_DepthRange(GLclampd zNear, GLclampd zFar)
+{
+    (void) zNear; (void) zFar;
+}
+
+static void GLAPIENTRY nop_Frustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)
+{
+    (void) left; (void) right; (void) bottom; (void) top; (void) zNear; (void) zFar;
+}
+
+static void GLAPIENTRY nop_LoadIdentity(void)
+{
+}
+
+static void GLAPIENTRY nop_LoadMatrixf(const GLfloat * m)
+{
+    (void) m;
+}
+
+static void GLAPIENTRY nop_LoadMatrixd(const GLdouble * m)
+{
+    (void) m;
+}
+
+static void GLAPIENTRY nop_MatrixMode(GLenum mode)
+{
+    (void) mode;
+}
+
+static void GLAPIENTRY nop_MultMatrixf(const GLfloat * m)
+{
+    (void) m;
+}
+
+static void GLAPIENTRY nop_MultMatrixd(const GLdouble * m)
+{
+    (void) m;
+}
+
+static void GLAPIENTRY nop_Ortho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)
+{
+    (void) left; (void) right; (void) bottom; (void) top; (void) zNear; (void) zFar;
+}
+
+static void GLAPIENTRY nop_PopMatrix(void)
+{
+}
+
+static void GLAPIENTRY nop_PushMatrix(void)
+{
+}
+
+static void GLAPIENTRY nop_Rotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
+{
+    (void) angle; (void) x; (void) y; (void) z;
+}
+
+static void GLAPIENTRY nop_Rotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
+{
+    (void) angle; (void) x; (void) y; (void) z;
+}
+
+static void GLAPIENTRY nop_Scaled(GLdouble x, GLdouble y, GLdouble z)
+{
+    (void) x; (void) y; (void) z;
+}
+
+static void GLAPIENTRY nop_Scalef(GLfloat x, GLfloat y, GLfloat z)
+{
+    (void) x; (void) y; (void) z;
+}
+
+static void GLAPIENTRY nop_Translated(GLdouble x, GLdouble y, GLdouble z)
+{
+    (void) x; (void) y; (void) z;
+}
+
+static void GLAPIENTRY nop_Translatef(GLfloat x, GLfloat y, GLfloat z)
+{
+    (void) x; (void) y; (void) z;
+}
+
+static void GLAPIENTRY nop_Viewport(GLint x, GLint y, GLsizei width, GLsizei height)
+{
+    (void) x; (void) y; (void) width; (void) height;
+}
+
+static void GLAPIENTRY nop_ArrayElement(GLint i)
+{
+    (void) i;
+}
+
+static void GLAPIENTRY nop_BindTexture(GLenum target, GLuint texture)
+{
+    (void) target; (void) texture;
+}
+
+static void GLAPIENTRY nop_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
+{
+    (void) size; (void) type; (void) stride; (void) pointer;
+}
+
+static void GLAPIENTRY nop_DisableClientState(GLenum array)
+{
+    (void) array;
+}
+
+static void GLAPIENTRY nop_DrawArrays(GLenum mode, GLint first, GLsizei count)
+{
+    (void) mode; (void) first; (void) count;
+}
+
+static void GLAPIENTRY nop_DrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices)
+{
+    (void) mode; (void) count; (void) type; (void) indices;
+}
+
+static void GLAPIENTRY nop_EdgeFlagPointer(GLsizei stride, const GLvoid * pointer)
+{
+    (void) stride; (void) pointer;
+}
+
+static void GLAPIENTRY nop_EnableClientState(GLenum array)
+{
+    (void) array;
+}
+
+static void GLAPIENTRY nop_IndexPointer(GLenum type, GLsizei stride, const GLvoid * pointer)
+{
+    (void) type; (void) stride; (void) pointer;
+}
+
+static void GLAPIENTRY nop_Indexub(GLubyte c)
+{
+    (void) c;
+}
+
+static void GLAPIENTRY nop_Indexubv(const GLubyte * c)
+{
+    (void) c;
+}
+
+static void GLAPIENTRY nop_InterleavedArrays(GLenum format, GLsizei stride, const GLvoid * pointer)
+{
+    (void) format; (void) stride; (void) pointer;
+}
+
+static void GLAPIENTRY nop_NormalPointer(GLenum type, GLsizei stride, const GLvoid * pointer)
+{
+    (void) type; (void) stride; (void) pointer;
+}
+
+static void GLAPIENTRY nop_PolygonOffset(GLfloat factor, GLfloat units)
+{
+    (void) factor; (void) units;
+}
+
+static void GLAPIENTRY nop_TexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
+{
+    (void) size; (void) type; (void) stride; (void) pointer;
+}
+
+static void GLAPIENTRY nop_VertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
+{
+    (void) size; (void) type; (void) stride; (void) pointer;
+}
+
+static GLboolean GLAPIENTRY nop_AreTexturesResident(GLsizei n, const GLuint * textures, GLboolean * residences)
+{
+    (void) n; (void) textures; (void) residences;
+    return 0;
+}
+
+static void GLAPIENTRY nop_CopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border)
+{
+    (void) target; (void) level; (void) internalformat; (void) x; (void) y; (void) width; (void) border;
+}
+
+static void GLAPIENTRY nop_CopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
+{
+    (void) target; (void) level; (void) internalformat; (void) x; (void) y; (void) width; (void) height; (void) border;
+}
+
+static void GLAPIENTRY nop_CopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)
+{
+    (void) target; (void) level; (void) xoffset; (void) x; (void) y; (void) width;
+}
+
+static void GLAPIENTRY nop_CopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+    (void) target; (void) level; (void) xoffset; (void) yoffset; (void) x; (void) y; (void) width; (void) height;
+}
+
+static void GLAPIENTRY nop_DeleteTextures(GLsizei n, const GLuint * textures)
+{
+    (void) n; (void) textures;
+}
+
+static void GLAPIENTRY nop_GenTextures(GLsizei n, GLuint * textures)
+{
+    (void) n; (void) textures;
+}
+
+static void GLAPIENTRY nop_GetPointerv(GLenum pname, GLvoid ** params)
+{
+    (void) pname; (void) params;
+}
+
+static GLboolean GLAPIENTRY nop_IsTexture(GLuint texture)
+{
+    (void) texture;
+    return 0;
+}
+
+static void GLAPIENTRY nop_PrioritizeTextures(GLsizei n, const GLuint * textures, const GLclampf * priorities)
+{
+    (void) n; (void) textures; (void) priorities;
+}
+
+static void GLAPIENTRY nop_TexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels)
+{
+    (void) target; (void) level; (void) xoffset; (void) width; (void) format; (void) type; (void) pixels;
+}
+
+static void GLAPIENTRY nop_TexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels)
+{
+    (void) target; (void) level; (void) xoffset; (void) yoffset; (void) width; (void) height; (void) format; (void) type; (void) pixels;
+}
+
+static void GLAPIENTRY nop_PopClientAttrib(void)
+{
+}
+
+static void GLAPIENTRY nop_PushClientAttrib(GLbitfield mask)
+{
+    (void) mask;
+}
+
+const GLCLTPROCTABLE StubTable =
+{
+    OPENGL_VERSION_110_ENTRIES,
+    {
+        nop_NewList,
+        nop_EndList,
+        nop_CallList,
+        nop_CallLists,
+        nop_DeleteLists,
+        nop_GenLists,
+        nop_ListBase,
+        nop_Begin,
+        nop_Bitmap,
+        nop_Color3b,
+        nop_Color3bv,
+        nop_Color3d,
+        nop_Color3dv,
+        nop_Color3f,
+        nop_Color3fv,
+        nop_Color3i,
+        nop_Color3iv,
+        nop_Color3s,
+        nop_Color3sv,
+        nop_Color3ub,
+        nop_Color3ubv,
+        nop_Color3ui,
+        nop_Color3uiv,
+        nop_Color3us,
+        nop_Color3usv,
+        nop_Color4b,
+        nop_Color4bv,
+        nop_Color4d,
+        nop_Color4dv,
+        nop_Color4f,
+        nop_Color4fv,
+        nop_Color4i,
+        nop_Color4iv,
+        nop_Color4s,
+        nop_Color4sv,
+        nop_Color4ub,
+        nop_Color4ubv,
+        nop_Color4ui,
+        nop_Color4uiv,
+        nop_Color4us,
+        nop_Color4usv,
+        nop_EdgeFlag,
+        nop_EdgeFlagv,
+        nop_End,
+        nop_Indexd,
+        nop_Indexdv,
+        nop_Indexf,
+        nop_Indexfv,
+        nop_Indexi,
+        nop_Indexiv,
+        nop_Indexs,
+        nop_Indexsv,
+        nop_Normal3b,
+        nop_Normal3bv,
+        nop_Normal3d,
+        nop_Normal3dv,
+        nop_Normal3f,
+        nop_Normal3fv,
+        nop_Normal3i,
+        nop_Normal3iv,
+        nop_Normal3s,
+        nop_Normal3sv,
+        nop_RasterPos2d,
+        nop_RasterPos2dv,
+        nop_RasterPos2f,
+        nop_RasterPos2fv,
+        nop_RasterPos2i,
+        nop_RasterPos2iv,
+        nop_RasterPos2s,
+        nop_RasterPos2sv,
+        nop_RasterPos3d,
+        nop_RasterPos3dv,
+        nop_RasterPos3f,
+        nop_RasterPos3fv,
+        nop_RasterPos3i,
+        nop_RasterPos3iv,
+        nop_RasterPos3s,
+        nop_RasterPos3sv,
+        nop_RasterPos4d,
+        nop_RasterPos4dv,
+        nop_RasterPos4f,
+        nop_RasterPos4fv,
+        nop_RasterPos4i,
+        nop_RasterPos4iv,
+        nop_RasterPos4s,
+        nop_RasterPos4sv,
+        nop_Rectd,
+        nop_Rectdv,
+        nop_Rectf,
+        nop_Rectfv,
+        nop_Recti,
+        nop_Rectiv,
+        nop_Rects,
+        nop_Rectsv,
+        nop_TexCoord1d,
+        nop_TexCoord1dv,
+        nop_TexCoord1f,
+        nop_TexCoord1fv,
+        nop_TexCoord1i,
+        nop_TexCoord1iv,
+        nop_TexCoord1s,
+        nop_TexCoord1sv,
+        nop_TexCoord2d,
+        nop_TexCoord2dv,
+        nop_TexCoord2f,
+        nop_TexCoord2fv,
+        nop_TexCoord2i,
+        nop_TexCoord2iv,
+        nop_TexCoord2s,
+        nop_TexCoord2sv,
+        nop_TexCoord3d,
+        nop_TexCoord3dv,
+        nop_TexCoord3f,
+        nop_TexCoord3fv,
+        nop_TexCoord3i,
+        nop_TexCoord3iv,
+        nop_TexCoord3s,
+        nop_TexCoord3sv,
+        nop_TexCoord4d,
+        nop_TexCoord4dv,
+        nop_TexCoord4f,
+        nop_TexCoord4fv,
+        nop_TexCoord4i,
+        nop_TexCoord4iv,
+        nop_TexCoord4s,
+        nop_TexCoord4sv,
+        nop_Vertex2d,
+        nop_Vertex2dv,
+        nop_Vertex2f,
+        nop_Vertex2fv,
+        nop_Vertex2i,
+        nop_Vertex2iv,
+        nop_Vertex2s,
+        nop_Vertex2sv,
+        nop_Vertex3d,
+        nop_Vertex3dv,
+        nop_Vertex3f,
+        nop_Vertex3fv,
+        nop_Vertex3i,
+        nop_Vertex3iv,
+        nop_Vertex3s,
+        nop_Vertex3sv,
+        nop_Vertex4d,
+        nop_Vertex4dv,
+        nop_Vertex4f,
+        nop_Vertex4fv,
+        nop_Vertex4i,
+        nop_Vertex4iv,
+        nop_Vertex4s,
+        nop_Vertex4sv,
+        nop_ClipPlane,
+        nop_ColorMaterial,
+        nop_CullFace,
+        nop_Fogf,
+        nop_Fogfv,
+        nop_Fogi,
+        nop_Fogiv,
+        nop_FrontFace,
+        nop_Hint,
+        nop_Lightf,
+        nop_Lightfv,
+        nop_Lighti,
+        nop_Lightiv,
+        nop_LightModelf,
+        nop_LightModelfv,
+        nop_LightModeli,
+        nop_LightModeliv,
+        nop_LineStipple,
+        nop_LineWidth,
+        nop_Materialf,
+        nop_Materialfv,
+        nop_Materiali,
+        nop_Materialiv,
+        nop_PointSize,
+        nop_PolygonMode,
+        nop_PolygonStipple,
+        nop_Scissor,
+        nop_ShadeModel,
+        nop_TexParameterf,
+        nop_TexParameterfv,
+        nop_TexParameteri,
+        nop_TexParameteriv,
+        nop_TexImage1D,
+        nop_TexImage2D,
+        nop_TexEnvf,
+        nop_TexEnvfv,
+        nop_TexEnvi,
+        nop_TexEnviv,
+        nop_TexGend,
+        nop_TexGendv,
+        nop_TexGenf,
+        nop_TexGenfv,
+        nop_TexGeni,
+        nop_TexGeniv,
+        nop_FeedbackBuffer,
+        nop_SelectBuffer,
+        nop_RenderMode,
+        nop_InitNames,
+        nop_LoadName,
+        nop_PassThrough,
+        nop_PopName,
+        nop_PushName,
+        nop_DrawBuffer,
+        nop_Clear,
+        nop_ClearAccum,
+        nop_ClearIndex,
+        nop_ClearColor,
+        nop_ClearStencil,
+        nop_ClearDepth,
+        nop_StencilMask,
+        nop_ColorMask,
+        nop_DepthMask,
+        nop_IndexMask,
+        nop_Accum,
+        nop_Disable,
+        nop_Enable,
+        nop_Finish,
+        nop_Flush,
+        nop_PopAttrib,
+        nop_PushAttrib,
+        nop_Map1d,
+        nop_Map1f,
+        nop_Map2d,
+        nop_Map2f,
+        nop_MapGrid1d,
+        nop_MapGrid1f,
+        nop_MapGrid2d,
+        nop_MapGrid2f,
+        nop_EvalCoord1d,
+        nop_EvalCoord1dv,
+        nop_EvalCoord1f,
+        nop_EvalCoord1fv,
+        nop_EvalCoord2d,
+        nop_EvalCoord2dv,
+        nop_EvalCoord2f,
+        nop_EvalCoord2fv,
+        nop_EvalMesh1,
+        nop_EvalPoint1,
+        nop_EvalMesh2,
+        nop_EvalPoint2,
+        nop_AlphaFunc,
+        nop_BlendFunc,
+        nop_LogicOp,
+        nop_StencilFunc,
+        nop_StencilOp,
+        nop_DepthFunc,
+        nop_PixelZoom,
+        nop_PixelTransferf,
+        nop_PixelTransferi,
+        nop_PixelStoref,
+        nop_PixelStorei,
+        nop_PixelMapfv,
+        nop_PixelMapuiv,
+        nop_PixelMapusv,
+        nop_ReadBuffer,
+        nop_CopyPixels,
+        nop_ReadPixels,
+        nop_DrawPixels,
+        nop_GetBooleanv,
+        nop_GetClipPlane,
+        nop_GetDoublev,
+        nop_GetError,
+        nop_GetFloatv,
+        nop_GetIntegerv,
+        nop_GetLightfv,
+        nop_GetLightiv,
+        nop_GetMapdv,
+        nop_GetMapfv,
+        nop_GetMapiv,
+        nop_GetMaterialfv,
+        nop_GetMaterialiv,
+        nop_GetPixelMapfv,
+        nop_GetPixelMapuiv,
+        nop_GetPixelMapusv,
+        nop_GetPolygonStipple,
+        nop_GetString,
+        nop_GetTexEnvfv,
+        nop_GetTexEnviv,
+        nop_GetTexGendv,
+        nop_GetTexGenfv,
+        nop_GetTexGeniv,
+        nop_GetTexImage,
+        nop_GetTexParameterfv,
+        nop_GetTexParameteriv,
+        nop_GetTexLevelParameterfv,
+        nop_GetTexLevelParameteriv,
+        nop_IsEnabled,
+        nop_IsList,
+        nop_DepthRange,
+        nop_Frustum,
+        nop_LoadIdentity,
+        nop_LoadMatrixf,
+        nop_LoadMatrixd,
+        nop_MatrixMode,
+        nop_MultMatrixf,
+        nop_MultMatrixd,
+        nop_Ortho,
+        nop_PopMatrix,
+        nop_PushMatrix,
+        nop_Rotated,
+        nop_Rotatef,
+        nop_Scaled,
+        nop_Scalef,
+        nop_Translated,
+        nop_Translatef,
+        nop_Viewport,
+        nop_ArrayElement,
+        nop_BindTexture,
+        nop_ColorPointer,
+        nop_DisableClientState,
+        nop_DrawArrays,
+        nop_DrawElements,
+        nop_EdgeFlagPointer,
+        nop_EnableClientState,
+        nop_IndexPointer,
+        nop_Indexub,
+        nop_Indexubv,
+        nop_InterleavedArrays,
+        nop_NormalPointer,
+        nop_PolygonOffset,
+        nop_TexCoordPointer,
+        nop_VertexPointer,
+        nop_AreTexturesResident,
+        nop_CopyTexImage1D,
+        nop_CopyTexImage2D,
+        nop_CopyTexSubImage1D,
+        nop_CopyTexSubImage2D,
+        nop_DeleteTextures,
+        nop_GenTextures,
+        nop_GetPointerv,
+        nop_IsTexture,
+        nop_PrioritizeTextures,
+        nop_TexSubImage1D,
+        nop_TexSubImage2D,
+        nop_PopClientAttrib,
+        nop_PushClientAttrib
+    }
+};
+
+void GLAPIENTRY glNewList(GLuint list, GLenum mode)
+{
+    IntGetCurrentDispatchTable()->NewList(list, mode);
+}
+
+void GLAPIENTRY glEndList(void)
+{
+    IntGetCurrentDispatchTable()->EndList();
+}
+
+void GLAPIENTRY glCallList(GLuint list)
+{
+    IntGetCurrentDispatchTable()->CallList(list);
+}
+
+void GLAPIENTRY glCallLists(GLsizei n, GLenum type, const GLvoid * lists)
+{
+    IntGetCurrentDispatchTable()->CallLists(n, type, lists);
+}
+
+void GLAPIENTRY glDeleteLists(GLuint list, GLsizei range)
+{
+    IntGetCurrentDispatchTable()->DeleteLists(list, range);
+}
+
+GLuint GLAPIENTRY glGenLists(GLsizei range)
+{
+    return IntGetCurrentDispatchTable()->GenLists(range);
+}
+
+void GLAPIENTRY glListBase(GLuint base)
+{
+    IntGetCurrentDispatchTable()->ListBase(base);
+}
+
+void GLAPIENTRY glBegin(GLenum mode)
+{
+    IntGetCurrentDispatchTable()->Begin(mode);
+}
+
+void GLAPIENTRY glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte * bitmap)
+{
+    IntGetCurrentDispatchTable()->Bitmap(width, height, xorig, yorig, xmove, ymove, bitmap);
+}
+
+void GLAPIENTRY glColor3b(GLbyte red, GLbyte green, GLbyte blue)
+{
+    IntGetCurrentDispatchTable()->Color3b(red, green, blue);
+}
+
+void GLAPIENTRY glColor3bv(const GLbyte * v)
+{
+    IntGetCurrentDispatchTable()->Color3bv(v);
+}
+
+void GLAPIENTRY glColor3d(GLdouble red, GLdouble green, GLdouble blue)
+{
+    IntGetCurrentDispatchTable()->Color3d(red, green, blue);
+}
+
+void GLAPIENTRY glColor3dv(const GLdouble * v)
+{
+    IntGetCurrentDispatchTable()->Color3dv(v);
+}
+
+void GLAPIENTRY glColor3f(GLfloat red, GLfloat green, GLfloat blue)
+{
+    IntGetCurrentDispatchTable()->Color3f(red, green, blue);
+}
+
+void GLAPIENTRY glColor3fv(const GLfloat * v)
+{
+    IntGetCurrentDispatchTable()->Color3fv(v);
+}
+
+void GLAPIENTRY glColor3i(GLint red, GLint green, GLint blue)
+{
+    IntGetCurrentDispatchTable()->Color3i(red, green, blue);
+}
+
+void GLAPIENTRY glColor3iv(const GLint * v)
+{
+    IntGetCurrentDispatchTable()->Color3iv(v);
+}
+
+void GLAPIENTRY glColor3s(GLshort red, GLshort green, GLshort blue)
+{
+    IntGetCurrentDispatchTable()->Color3s(red, green, blue);
+}
+
+void GLAPIENTRY glColor3sv(const GLshort * v)
+{
+    IntGetCurrentDispatchTable()->Color3sv(v);
+}
+
+void GLAPIENTRY glColor3ub(GLubyte red, GLubyte green, GLubyte blue)
+{
+    IntGetCurrentDispatchTable()->Color3ub(red, green, blue);
+}
+
+void GLAPIENTRY glColor3ubv(const GLubyte * v)
+{
+    IntGetCurrentDispatchTable()->Color3ubv(v);
+}
+
+void GLAPIENTRY glColor3ui(GLuint red, GLuint green, GLuint blue)
+{
+    IntGetCurrentDispatchTable()->Color3ui(red, green, blue);
+}
+
+void GLAPIENTRY glColor3uiv(const GLuint * v)
+{
+    IntGetCurrentDispatchTable()->Color3uiv(v);
+}
+
+void GLAPIENTRY glColor3us(GLushort red, GLushort green, GLushort blue)
+{
+    IntGetCurrentDispatchTable()->Color3us(red, green, blue);
+}
+
+void GLAPIENTRY glColor3usv(const GLushort * v)
+{
+    IntGetCurrentDispatchTable()->Color3usv(v);
+}
+
+void GLAPIENTRY glColor4b(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha)
+{
+    IntGetCurrentDispatchTable()->Color4b(red, green, blue, alpha);
+}
+
+void GLAPIENTRY glColor4bv(const GLbyte * v)
+{
+    IntGetCurrentDispatchTable()->Color4bv(v);
+}
+
+void GLAPIENTRY glColor4d(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha)
+{
+    IntGetCurrentDispatchTable()->Color4d(red, green, blue, alpha);
+}
+
+void GLAPIENTRY glColor4dv(const GLdouble * v)
+{
+    IntGetCurrentDispatchTable()->Color4dv(v);
+}
+
+void GLAPIENTRY glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
+{
+    IntGetCurrentDispatchTable()->Color4f(red, green, blue, alpha);
+}
+
+void GLAPIENTRY glColor4fv(const GLfloat * v)
+{
+    IntGetCurrentDispatchTable()->Color4fv(v);
+}
+
+void GLAPIENTRY glColor4i(GLint red, GLint green, GLint blue, GLint alpha)
+{
+    IntGetCurrentDispatchTable()->Color4i(red, green, blue, alpha);
+}
+
+void GLAPIENTRY glColor4iv(const GLint * v)
+{
+    IntGetCurrentDispatchTable()->Color4iv(v);
+}
+
+void GLAPIENTRY glColor4s(GLshort red, GLshort green, GLshort blue, GLshort alpha)
+{
+    IntGetCurrentDispatchTable()->Color4s(red, green, blue, alpha);
+}
+
+void GLAPIENTRY glColor4sv(const GLshort * v)
+{
+    IntGetCurrentDispatchTable()->Color4sv(v);
+}
+
+void GLAPIENTRY glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
+{
+    IntGetCurrentDispatchTable()->Color4ub(red, green, blue, alpha);
+}
+
+void GLAPIENTRY glColor4ubv(const GLubyte * v)
+{
+    IntGetCurrentDispatchTable()->Color4ubv(v);
+}
+
+void GLAPIENTRY glColor4ui(GLuint red, GLuint green, GLuint blue, GLuint alpha)
+{
+    IntGetCurrentDispatchTable()->Color4ui(red, green, blue, alpha);
+}
+
+void GLAPIENTRY glColor4uiv(const GLuint * v)
+{
+    IntGetCurrentDispatchTable()->Color4uiv(v);
+}
+
+void GLAPIENTRY glColor4us(GLushort red, GLushort green, GLushort blue, GLushort alpha)
+{
+    IntGetCurrentDispatchTable()->Color4us(red, green, blue, alpha);
+}
+
+void GLAPIENTRY glColor4usv(const GLushort * v)
+{
+    IntGetCurrentDispatchTable()->Color4usv(v);
+}
+
+void GLAPIENTRY glEdgeFlag(GLboolean flag)
+{
+    IntGetCurrentDispatchTable()->EdgeFlag(flag);
+}
+
+void GLAPIENTRY glEdgeFlagv(const GLboolean * flag)
+{
+    IntGetCurrentDispatchTable()->EdgeFlagv(flag);
+}
+
+void GLAPIENTRY glEnd(void)
+{
+    IntGetCurrentDispatchTable()->End();
+}
+
+void GLAPIENTRY glIndexd(GLdouble c)
+{
+    IntGetCurrentDispatchTable()->Indexd(c);
+}
+
+void GLAPIENTRY glIndexdv(const GLdouble * c)
+{
+    IntGetCurrentDispatchTable()->Indexdv(c);
+}
+
+void GLAPIENTRY glIndexf(GLfloat c)
+{
+    IntGetCurrentDispatchTable()->Indexf(c);
+}
+
+void GLAPIENTRY glIndexfv(const GLfloat * c)
+{
+    IntGetCurrentDispatchTable()->Indexfv(c);
+}
+
+void GLAPIENTRY glIndexi(GLint c)
+{
+    IntGetCurrentDispatchTable()->Indexi(c);
+}
+
+void GLAPIENTRY glIndexiv(const GLint * c)
+{
+    IntGetCurrentDispatchTable()->Indexiv(c);
+}
+
+void GLAPIENTRY glIndexs(GLshort c)
+{
+    IntGetCurrentDispatchTable()->Indexs(c);
+}
+
+void GLAPIENTRY glIndexsv(const GLshort * c)
+{
+    IntGetCurrentDispatchTable()->Indexsv(c);
+}
+
+void GLAPIENTRY glNormal3b(GLbyte nx, GLbyte ny, GLbyte nz)
+{
+    IntGetCurrentDispatchTable()->Normal3b(nx, ny, nz);
+}
+
+void GLAPIENTRY glNormal3bv(const GLbyte * v)
+{
+    IntGetCurrentDispatchTable()->Normal3bv(v);
+}
+
+void GLAPIENTRY glNormal3d(GLdouble nx, GLdouble ny, GLdouble nz)
+{
+    IntGetCurrentDispatchTable()->Normal3d(nx, ny, nz);
+}
+
+void GLAPIENTRY glNormal3dv(const GLdouble * v)
+{
+    IntGetCurrentDispatchTable()->Normal3dv(v);
+}
+
+void GLAPIENTRY glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz)
+{
+    IntGetCurrentDispatchTable()->Normal3f(nx, ny, nz);
+}
+
+void GLAPIENTRY glNormal3fv(const GLfloat * v)
+{
+    IntGetCurrentDispatchTable()->Normal3fv(v);
+}
+
+void GLAPIENTRY glNormal3i(GLint nx, GLint ny, GLint nz)
+{
+    IntGetCurrentDispatchTable()->Normal3i(nx, ny, nz);
+}
+
+void GLAPIENTRY glNormal3iv(const GLint * v)
+{
+    IntGetCurrentDispatchTable()->Normal3iv(v);
+}
+
+void GLAPIENTRY glNormal3s(GLshort nx, GLshort ny, GLshort nz)
+{
+    IntGetCurrentDispatchTable()->Normal3s(nx, ny, nz);
+}
+
+void GLAPIENTRY glNormal3sv(const GLshort * v)
+{
+    IntGetCurrentDispatchTable()->Normal3sv(v);
+}
+
+void GLAPIENTRY glRasterPos2d(GLdouble x, GLdouble y)
+{
+    IntGetCurrentDispatchTable()->RasterPos2d(x, y);
+}
+
+void GLAPIENTRY glRasterPos2dv(const GLdouble * v)
+{
+    IntGetCurrentDispatchTable()->RasterPos2dv(v);
+}
+
+void GLAPIENTRY glRasterPos2f(GLfloat x, GLfloat y)
+{
+    IntGetCurrentDispatchTable()->RasterPos2f(x, y);
+}
+
+void GLAPIENTRY glRasterPos2fv(const GLfloat * v)
+{
+    IntGetCurrentDispatchTable()->RasterPos2fv(v);
+}
+
+void GLAPIENTRY glRasterPos2i(GLint x, GLint y)
+{
+    IntGetCurrentDispatchTable()->RasterPos2i(x, y);
+}
+
+void GLAPIENTRY glRasterPos2iv(const GLint * v)
+{
+    IntGetCurrentDispatchTable()->RasterPos2iv(v);
+}
+
+void GLAPIENTRY glRasterPos2s(GLshort x, GLshort y)
+{
+    IntGetCurrentDispatchTable()->RasterPos2s(x, y);
+}
+
+void GLAPIENTRY glRasterPos2sv(const GLshort * v)
+{
+    IntGetCurrentDispatchTable()->RasterPos2sv(v);
+}
+
+void GLAPIENTRY glRasterPos3d(GLdouble x, GLdouble y, GLdouble z)
+{
+    IntGetCurrentDispatchTable()->RasterPos3d(x, y, z);
+}
+
+void GLAPIENTRY glRasterPos3dv(const GLdouble * v)
+{
+    IntGetCurrentDispatchTable()->RasterPos3dv(v);
+}
+
+void GLAPIENTRY glRasterPos3f(GLfloat x, GLfloat y, GLfloat z)
+{
+    IntGetCurrentDispatchTable()->RasterPos3f(x, y, z);
+}
+
+void GLAPIENTRY glRasterPos3fv(const GLfloat * v)
+{
+    IntGetCurrentDispatchTable()->RasterPos3fv(v);
+}
+
+void GLAPIENTRY glRasterPos3i(GLint x, GLint y, GLint z)
+{
+    IntGetCurrentDispatchTable()->RasterPos3i(x, y, z);
+}
+
+void GLAPIENTRY glRasterPos3iv(const GLint * v)
+{
+    IntGetCurrentDispatchTable()->RasterPos3iv(v);
+}
+
+void GLAPIENTRY glRasterPos3s(GLshort x, GLshort y, GLshort z)
+{
+    IntGetCurrentDispatchTable()->RasterPos3s(x, y, z);
+}
+
+void GLAPIENTRY glRasterPos3sv(const GLshort * v)
+{
+    IntGetCurrentDispatchTable()->RasterPos3sv(v);
+}
+
+void GLAPIENTRY glRasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+    IntGetCurrentDispatchTable()->RasterPos4d(x, y, z, w);
+}
+
+void GLAPIENTRY glRasterPos4dv(const GLdouble * v)
+{
+    IntGetCurrentDispatchTable()->RasterPos4dv(v);
+}
+
+void GLAPIENTRY glRasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+    IntGetCurrentDispatchTable()->RasterPos4f(x, y, z, w);
+}
+
+void GLAPIENTRY glRasterPos4fv(const GLfloat * v)
+{
+    IntGetCurrentDispatchTable()->RasterPos4fv(v);
+}
+
+void GLAPIENTRY glRasterPos4i(GLint x, GLint y, GLint z, GLint w)
+{
+    IntGetCurrentDispatchTable()->RasterPos4i(x, y, z, w);
+}
+
+void GLAPIENTRY glRasterPos4iv(const GLint * v)
+{
+    IntGetCurrentDispatchTable()->RasterPos4iv(v);
+}
+
+void GLAPIENTRY glRasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w)
+{
+    IntGetCurrentDispatchTable()->RasterPos4s(x, y, z, w);
+}
+
+void GLAPIENTRY glRasterPos4sv(const GLshort * v)
+{
+    IntGetCurrentDispatchTable()->RasterPos4sv(v);
+}
+
+void GLAPIENTRY glRectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2)
+{
+    IntGetCurrentDispatchTable()->Rectd(x1, y1, x2, y2);
+}
+
+void GLAPIENTRY glRectdv(const GLdouble * v1, const GLdouble * v2)
+{
+    IntGetCurrentDispatchTable()->Rectdv(v1, v2);
+}
+
+void GLAPIENTRY glRectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
+{
+    IntGetCurrentDispatchTable()->Rectf(x1, y1, x2, y2);
+}
+
+void GLAPIENTRY glRectfv(const GLfloat * v1, const GLfloat * v2)
+{
+    IntGetCurrentDispatchTable()->Rectfv(v1, v2);
+}
+
+void GLAPIENTRY glRecti(GLint x1, GLint y1, GLint x2, GLint y2)
+{
+    IntGetCurrentDispatchTable()->Recti(x1, y1, x2, y2);
+}
+
+void GLAPIENTRY glRectiv(const GLint * v1, const GLint * v2)
+{
+    IntGetCurrentDispatchTable()->Rectiv(v1, v2);
+}
+
+void GLAPIENTRY glRects(GLshort x1, GLshort y1, GLshort x2, GLshort y2)
+{
+    IntGetCurrentDispatchTable()->Rects(x1, y1, x2, y2);
+}
+
+void GLAPIENTRY glRectsv(const GLshort * v1, const GLshort * v2)
+{
+    IntGetCurrentDispatchTable()->Rectsv(v1, v2);
+}
+
+void GLAPIENTRY glTexCoord1d(GLdouble s)
+{
+    IntGetCurrentDispatchTable()->TexCoord1d(s);
+}
+
+void GLAPIENTRY glTexCoord1dv(const GLdouble * v)
+{
+    IntGetCurrentDispatchTable()->TexCoord1dv(v);
+}
+
+void GLAPIENTRY glTexCoord1f(GLfloat s)
+{
+    IntGetCurrentDispatchTable()->TexCoord1f(s);
+}
+
+void GLAPIENTRY glTexCoord1fv(const GLfloat * v)
+{
+    IntGetCurrentDispatchTable()->TexCoord1fv(v);
+}
+
+void GLAPIENTRY glTexCoord1i(GLint s)
+{
+    IntGetCurrentDispatchTable()->TexCoord1i(s);
+}
+
+void GLAPIENTRY glTexCoord1iv(const GLint * v)
+{
+    IntGetCurrentDispatchTable()->TexCoord1iv(v);
+}
+
+void GLAPIENTRY glTexCoord1s(GLshort s)
+{
+    IntGetCurrentDispatchTable()->TexCoord1s(s);
+}
+
+void GLAPIENTRY glTexCoord1sv(const GLshort * v)
+{
+    IntGetCurrentDispatchTable()->TexCoord1sv(v);
+}
+
+void GLAPIENTRY glTexCoord2d(GLdouble s, GLdouble t)
+{
+    IntGetCurrentDispatchTable()->TexCoord2d(s, t);
+}
+
+void GLAPIENTRY glTexCoord2dv(const GLdouble * v)
+{
+    IntGetCurrentDispatchTable()->TexCoord2dv(v);
+}
+
+void GLAPIENTRY glTexCoord2f(GLfloat s, GLfloat t)
+{
+    IntGetCurrentDispatchTable()->TexCoord2f(s, t);
+}
+
+void GLAPIENTRY glTexCoord2fv(const GLfloat * v)
+{
+    IntGetCurrentDispatchTable()->TexCoord2fv(v);
+}
+
+void GLAPIENTRY glTexCoord2i(GLint s, GLint t)
+{
+    IntGetCurrentDispatchTable()->TexCoord2i(s, t);
+}
+
+void GLAPIENTRY glTexCoord2iv(const GLint * v)
+{
+    IntGetCurrentDispatchTable()->TexCoord2iv(v);
+}
+
+void GLAPIENTRY glTexCoord2s(GLshort s, GLshort t)
+{
+    IntGetCurrentDispatchTable()->TexCoord2s(s, t);
+}
+
+void GLAPIENTRY glTexCoord2sv(const GLshort * v)
+{
+    IntGetCurrentDispatchTable()->TexCoord2sv(v);
+}
+
+void GLAPIENTRY glTexCoord3d(GLdouble s, GLdouble t, GLdouble r)
+{
+    IntGetCurrentDispatchTable()->TexCoord3d(s, t, r);
+}
+
+void GLAPIENTRY glTexCoord3dv(const GLdouble * v)
+{
+    IntGetCurrentDispatchTable()->TexCoord3dv(v);
+}
+
+void GLAPIENTRY glTexCoord3f(GLfloat s, GLfloat t, GLfloat r)
+{
+    IntGetCurrentDispatchTable()->TexCoord3f(s, t, r);
+}
+
+void GLAPIENTRY glTexCoord3fv(const GLfloat * v)
+{
+    IntGetCurrentDispatchTable()->TexCoord3fv(v);
+}
+
+void GLAPIENTRY glTexCoord3i(GLint s, GLint t, GLint r)
+{
+    IntGetCurrentDispatchTable()->TexCoord3i(s, t, r);
+}
+
+void GLAPIENTRY glTexCoord3iv(const GLint * v)
+{
+    IntGetCurrentDispatchTable()->TexCoord3iv(v);
+}
+
+void GLAPIENTRY glTexCoord3s(GLshort s, GLshort t, GLshort r)
+{
+    IntGetCurrentDispatchTable()->TexCoord3s(s, t, r);
+}
+
+void GLAPIENTRY glTexCoord3sv(const GLshort * v)
+{
+    IntGetCurrentDispatchTable()->TexCoord3sv(v);
+}
+
+void GLAPIENTRY glTexCoord4d(GLdouble s, GLdouble t, GLdouble r, GLdouble q)
+{
+    IntGetCurrentDispatchTable()->TexCoord4d(s, t, r, q);
+}
+
+void GLAPIENTRY glTexCoord4dv(const GLdouble * v)
+{
+    IntGetCurrentDispatchTable()->TexCoord4dv(v);
+}
+
+void GLAPIENTRY glTexCoord4f(GLfloat s, GLfloat t, GLfloat r, GLfloat q)
+{
+    IntGetCurrentDispatchTable()->TexCoord4f(s, t, r, q);
+}
+
+void GLAPIENTRY glTexCoord4fv(const GLfloat * v)
+{
+    IntGetCurrentDispatchTable()->TexCoord4fv(v);
+}
+
+void GLAPIENTRY glTexCoord4i(GLint s, GLint t, GLint r, GLint q)
+{
+    IntGetCurrentDispatchTable()->TexCoord4i(s, t, r, q);
+}
+
+void GLAPIENTRY glTexCoord4iv(const GLint * v)
+{
+    IntGetCurrentDispatchTable()->TexCoord4iv(v);
+}
+
+void GLAPIENTRY glTexCoord4s(GLshort s, GLshort t, GLshort r, GLshort q)
+{
+    IntGetCurrentDispatchTable()->TexCoord4s(s, t, r, q);
+}
+
+void GLAPIENTRY glTexCoord4sv(const GLshort * v)
+{
+    IntGetCurrentDispatchTable()->TexCoord4sv(v);
+}
+
+void GLAPIENTRY glVertex2d(GLdouble x, GLdouble y)
+{
+    IntGetCurrentDispatchTable()->Vertex2d(x, y);
+}
+
+void GLAPIENTRY glVertex2dv(const GLdouble * v)
+{
+    IntGetCurrentDispatchTable()->Vertex2dv(v);
+}
+
+void GLAPIENTRY glVertex2f(GLfloat x, GLfloat y)
+{
+    IntGetCurrentDispatchTable()->Vertex2f(x, y);
+}
+
+void GLAPIENTRY glVertex2fv(const GLfloat * v)
+{
+    IntGetCurrentDispatchTable()->Vertex2fv(v);
+}
+
+void GLAPIENTRY glVertex2i(GLint x, GLint y)
+{
+    IntGetCurrentDispatchTable()->Vertex2i(x, y);
+}
+
+void GLAPIENTRY glVertex2iv(const GLint * v)
+{
+    IntGetCurrentDispatchTable()->Vertex2iv(v);
+}
+
+void GLAPIENTRY glVertex2s(GLshort x, GLshort y)
+{
+    IntGetCurrentDispatchTable()->Vertex2s(x, y);
+}
+
+void GLAPIENTRY glVertex2sv(const GLshort * v)
+{
+    IntGetCurrentDispatchTable()->Vertex2sv(v);
+}
+
+void GLAPIENTRY glVertex3d(GLdouble x, GLdouble y, GLdouble z)
+{
+    IntGetCurrentDispatchTable()->Vertex3d(x, y, z);
+}
+
+void GLAPIENTRY glVertex3dv(const GLdouble * v)
+{
+    IntGetCurrentDispatchTable()->Vertex3dv(v);
+}
+
+void GLAPIENTRY glVertex3f(GLfloat x, GLfloat y, GLfloat z)
+{
+    IntGetCurrentDispatchTable()->Vertex3f(x, y, z);
+}
+
+void GLAPIENTRY glVertex3fv(const GLfloat * v)
+{
+    IntGetCurrentDispatchTable()->Vertex3fv(v);
+}
+
+void GLAPIENTRY glVertex3i(GLint x, GLint y, GLint z)
+{
+    IntGetCurrentDispatchTable()->Vertex3i(x, y, z);
+}
+
+void GLAPIENTRY glVertex3iv(const GLint * v)
+{
+    IntGetCurrentDispatchTable()->Vertex3iv(v);
+}
+
+void GLAPIENTRY glVertex3s(GLshort x, GLshort y, GLshort z)
+{
+    IntGetCurrentDispatchTable()->Vertex3s(x, y, z);
+}
+
+void GLAPIENTRY glVertex3sv(const GLshort * v)
+{
+    IntGetCurrentDispatchTable()->Vertex3sv(v);
+}
+
+void GLAPIENTRY glVertex4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+    IntGetCurrentDispatchTable()->Vertex4d(x, y, z, w);
+}
+
+void GLAPIENTRY glVertex4dv(const GLdouble * v)
+{
+    IntGetCurrentDispatchTable()->Vertex4dv(v);
+}
+
+void GLAPIENTRY glVertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+    IntGetCurrentDispatchTable()->Vertex4f(x, y, z, w);
+}
+
+void GLAPIENTRY glVertex4fv(const GLfloat * v)
+{
+    IntGetCurrentDispatchTable()->Vertex4fv(v);
+}
+
+void GLAPIENTRY glVertex4i(GLint x, GLint y, GLint z, GLint w)
+{
+    IntGetCurrentDispatchTable()->Vertex4i(x, y, z, w);
+}
+
+void GLAPIENTRY glVertex4iv(const GLint * v)
+{
+    IntGetCurrentDispatchTable()->Vertex4iv(v);
+}
+
+void GLAPIENTRY glVertex4s(GLshort x, GLshort y, GLshort z, GLshort w)
+{
+    IntGetCurrentDispatchTable()->Vertex4s(x, y, z, w);
+}
+
+void GLAPIENTRY glVertex4sv(const GLshort * v)
+{
+    IntGetCurrentDispatchTable()->Vertex4sv(v);
+}
+
+void GLAPIENTRY glClipPlane(GLenum plane, const GLdouble * equation)
+{
+    IntGetCurrentDispatchTable()->ClipPlane(plane, equation);
+}
+
+void GLAPIENTRY glColorMaterial(GLenum face, GLenum mode)
+{
+    IntGetCurrentDispatchTable()->ColorMaterial(face, mode);
+}
+
+void GLAPIENTRY glCullFace(GLenum mode)
+{
+    IntGetCurrentDispatchTable()->CullFace(mode);
+}
+
+void GLAPIENTRY glFogf(GLenum pname, GLfloat param)
+{
+    IntGetCurrentDispatchTable()->Fogf(pname, param);
+}
+
+void GLAPIENTRY glFogfv(GLenum pname, const GLfloat * params)
+{
+    IntGetCurrentDispatchTable()->Fogfv(pname, params);
+}
+
+void GLAPIENTRY glFogi(GLenum pname, GLint param)
+{
+    IntGetCurrentDispatchTable()->Fogi(pname, param);
+}
+
+void GLAPIENTRY glFogiv(GLenum pname, const GLint * params)
+{
+    IntGetCurrentDispatchTable()->Fogiv(pname, params);
+}
+
+void GLAPIENTRY glFrontFace(GLenum mode)
+{
+    IntGetCurrentDispatchTable()->FrontFace(mode);
+}
+
+void GLAPIENTRY glHint(GLenum target, GLenum mode)
+{
+    IntGetCurrentDispatchTable()->Hint(target, mode);
+}
+
+void GLAPIENTRY glLightf(GLenum light, GLenum pname, GLfloat param)
+{
+    IntGetCurrentDispatchTable()->Lightf(light, pname, param);
+}
+
+void GLAPIENTRY glLightfv(GLenum light, GLenum pname, const GLfloat * params)
+{
+    IntGetCurrentDispatchTable()->Lightfv(light, pname, params);
+}
+
+void GLAPIENTRY glLighti(GLenum light, GLenum pname, GLint param)
+{
+    IntGetCurrentDispatchTable()->Lighti(light, pname, param);
+}
+
+void GLAPIENTRY glLightiv(GLenum light, GLenum pname, const GLint * params)
+{
+    IntGetCurrentDispatchTable()->Lightiv(light, pname, params);
+}
+
+void GLAPIENTRY glLightModelf(GLenum pname, GLfloat param)
+{
+    IntGetCurrentDispatchTable()->LightModelf(pname, param);
+}
+
+void GLAPIENTRY glLightModelfv(GLenum pname, const GLfloat * params)
+{
+    IntGetCurrentDispatchTable()->LightModelfv(pname, params);
+}
+
+void GLAPIENTRY glLightModeli(GLenum pname, GLint param)
+{
+    IntGetCurrentDispatchTable()->LightModeli(pname, param);
+}
+
+void GLAPIENTRY glLightModeliv(GLenum pname, const GLint * params)
+{
+    IntGetCurrentDispatchTable()->LightModeliv(pname, params);
+}
+
+void GLAPIENTRY glLineStipple(GLint factor, GLushort pattern)
+{
+    IntGetCurrentDispatchTable()->LineStipple(factor, pattern);
+}
+
+void GLAPIENTRY glLineWidth(GLfloat width)
+{
+    IntGetCurrentDispatchTable()->LineWidth(width);
+}
+
+void GLAPIENTRY glMaterialf(GLenum face, GLenum pname, GLfloat param)
+{
+    IntGetCurrentDispatchTable()->Materialf(face, pname, param);
+}
+
+void GLAPIENTRY glMaterialfv(GLenum face, GLenum pname, const GLfloat * params)
+{
+    IntGetCurrentDispatchTable()->Materialfv(face, pname, params);
+}
+
+void GLAPIENTRY glMateriali(GLenum face, GLenum pname, GLint param)
+{
+    IntGetCurrentDispatchTable()->Materiali(face, pname, param);
+}
+
+void GLAPIENTRY glMaterialiv(GLenum face, GLenum pname, const GLint * params)
+{
+    IntGetCurrentDispatchTable()->Materialiv(face, pname, params);
+}
+
+void GLAPIENTRY glPointSize(GLfloat size)
+{
+    IntGetCurrentDispatchTable()->PointSize(size);
+}
+
+void GLAPIENTRY glPolygonMode(GLenum face, GLenum mode)
+{
+    IntGetCurrentDispatchTable()->PolygonMode(face, mode);
+}
+
+void GLAPIENTRY glPolygonStipple(const GLubyte * mask)
+{
+    IntGetCurrentDispatchTable()->PolygonStipple(mask);
+}
+
+void GLAPIENTRY glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
+{
+    IntGetCurrentDispatchTable()->Scissor(x, y, width, height);
+}
+
+void GLAPIENTRY glShadeModel(GLenum mode)
+{
+    IntGetCurrentDispatchTable()->ShadeModel(mode);
+}
+
+void GLAPIENTRY glTexParameterf(GLenum target, GLenum pname, GLfloat param)
+{
+    IntGetCurrentDispatchTable()->TexParameterf(target, pname, param);
+}
+
+void GLAPIENTRY glTexParameterfv(GLenum target, GLenum pname, const GLfloat * params)
+{
+    IntGetCurrentDispatchTable()->TexParameterfv(target, pname, params);
+}
+
+void GLAPIENTRY glTexParameteri(GLenum target, GLenum pname, GLint param)
+{
+    IntGetCurrentDispatchTable()->TexParameteri(target, pname, param);
+}
+
+void GLAPIENTRY glTexParameteriv(GLenum target, GLenum pname, const GLint * params)
+{
+    IntGetCurrentDispatchTable()->TexParameteriv(target, pname, params);
+}
+
+void GLAPIENTRY glTexImage1D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels)
+{
+    IntGetCurrentDispatchTable()->TexImage1D(target, level, internalformat, width, border, format, type, pixels);
+}
+
+void GLAPIENTRY glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels)
+{
+    IntGetCurrentDispatchTable()->TexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
+}
+
+void GLAPIENTRY glTexEnvf(GLenum target, GLenum pname, GLfloat param)
+{
+    IntGetCurrentDispatchTable()->TexEnvf(target, pname, param);
+}
+
+void GLAPIENTRY glTexEnvfv(GLenum target, GLenum pname, const GLfloat * params)
+{
+    IntGetCurrentDispatchTable()->TexEnvfv(target, pname, params);
+}
+
+void GLAPIENTRY glTexEnvi(GLenum target, GLenum pname, GLint param)
+{
+    IntGetCurrentDispatchTable()->TexEnvi(target, pname, param);
+}
+
+void GLAPIENTRY glTexEnviv(GLenum target, GLenum pname, const GLint * params)
+{
+    IntGetCurrentDispatchTable()->TexEnviv(target, pname, params);
+}
+
+void GLAPIENTRY glTexGend(GLenum coord, GLenum pname, GLdouble param)
+{
+    IntGetCurrentDispatchTable()->TexGend(coord, pname, param);
+}
+
+void GLAPIENTRY glTexGendv(GLenum coord, GLenum pname, const GLdouble * params)
+{
+    IntGetCurrentDispatchTable()->TexGendv(coord, pname, params);
+}
+
+void GLAPIENTRY glTexGenf(GLenum coord, GLenum pname, GLfloat param)
+{
+    IntGetCurrentDispatchTable()->TexGenf(coord, pname, param);
+}
+
+void GLAPIENTRY glTexGenfv(GLenum coord, GLenum pname, const GLfloat * params)
+{
+    IntGetCurrentDispatchTable()->TexGenfv(coord, pname, params);
+}
+
+void GLAPIENTRY glTexGeni(GLenum coord, GLenum pname, GLint param)
+{
+    IntGetCurrentDispatchTable()->TexGeni(coord, pname, param);
+}
+
+void GLAPIENTRY glTexGeniv(GLenum coord, GLenum pname, const GLint * params)
+{
+    IntGetCurrentDispatchTable()->TexGeniv(coord, pname, params);
+}
+
+void GLAPIENTRY glFeedbackBuffer(GLsizei size, GLenum type, GLfloat * buffer)
+{
+    IntGetCurrentDispatchTable()->FeedbackBuffer(size, type, buffer);
+}
+
+void GLAPIENTRY glSelectBuffer(GLsizei size, GLuint * buffer)
+{
+    IntGetCurrentDispatchTable()->SelectBuffer(size, buffer);
+}
+
+GLint GLAPIENTRY glRenderMode(GLenum mode)
+{
+    return IntGetCurrentDispatchTable()->RenderMode(mode);
+}
+
+void GLAPIENTRY glInitNames(void)
+{
+    IntGetCurrentDispatchTable()->InitNames();
+}
+
+void GLAPIENTRY glLoadName(GLuint name)
+{
+    IntGetCurrentDispatchTable()->LoadName(name);
+}
+
+void GLAPIENTRY glPassThrough(GLfloat token)
+{
+    IntGetCurrentDispatchTable()->PassThrough(token);
+}
+
+void GLAPIENTRY glPopName(void)
+{
+    IntGetCurrentDispatchTable()->PopName();
+}
+
+void GLAPIENTRY glPushName(GLuint name)
+{
+    IntGetCurrentDispatchTable()->PushName(name);
+}
+
+void GLAPIENTRY glDrawBuffer(GLenum mode)
+{
+    IntGetCurrentDispatchTable()->DrawBuffer(mode);
+}
+
+void GLAPIENTRY glClear(GLbitfield mask)
+{
+    IntGetCurrentDispatchTable()->Clear(mask);
+}
+
+void GLAPIENTRY glClearAccum(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
+{
+    IntGetCurrentDispatchTable()->ClearAccum(red, green, blue, alpha);
+}
+
+void GLAPIENTRY glClearIndex(GLfloat c)
+{
+    IntGetCurrentDispatchTable()->ClearIndex(c);
+}
+
+void GLAPIENTRY glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
+{
+    IntGetCurrentDispatchTable()->ClearColor(red, green, blue, alpha);
+}
+
+void GLAPIENTRY glClearStencil(GLint s)
+{
+    IntGetCurrentDispatchTable()->ClearStencil(s);
+}
+
+void GLAPIENTRY glClearDepth(GLclampd depth)
+{
+    IntGetCurrentDispatchTable()->ClearDepth(depth);
+}
+
+void GLAPIENTRY glStencilMask(GLuint mask)
+{
+    IntGetCurrentDispatchTable()->StencilMask(mask);
+}
+
+void GLAPIENTRY glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
+{
+    IntGetCurrentDispatchTable()->ColorMask(red, green, blue, alpha);
+}
+
+void GLAPIENTRY glDepthMask(GLboolean flag)
+{
+    IntGetCurrentDispatchTable()->DepthMask(flag);
+}
+
+void GLAPIENTRY glIndexMask(GLuint mask)
+{
+    IntGetCurrentDispatchTable()->IndexMask(mask);
+}
+
+void GLAPIENTRY glAccum(GLenum op, GLfloat value)
+{
+    IntGetCurrentDispatchTable()->Accum(op, value);
+}
+
+void GLAPIENTRY glDisable(GLenum cap)
+{
+    IntGetCurrentDispatchTable()->Disable(cap);
+}
+
+void GLAPIENTRY glEnable(GLenum cap)
+{
+    IntGetCurrentDispatchTable()->Enable(cap);
+}
+
+void GLAPIENTRY glFinish(void)
+{
+    IntGetCurrentDispatchTable()->Finish();
+}
+
+void GLAPIENTRY glFlush(void)
+{
+    IntGetCurrentDispatchTable()->Flush();
+}
+
+void GLAPIENTRY glPopAttrib(void)
+{
+    IntGetCurrentDispatchTable()->PopAttrib();
+}
+
+void GLAPIENTRY glPushAttrib(GLbitfield mask)
+{
+    IntGetCurrentDispatchTable()->PushAttrib(mask);
+}
+
+void GLAPIENTRY glMap1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble * points)
+{
+    IntGetCurrentDispatchTable()->Map1d(target, u1, u2, stride, order, points);
+}
+
+void GLAPIENTRY glMap1f(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat * points)
+{
+    IntGetCurrentDispatchTable()->Map1f(target, u1, u2, stride, order, points);
+}
+
+void GLAPIENTRY glMap2d(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble * points)
+{
+    IntGetCurrentDispatchTable()->Map2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
+}
+
+void GLAPIENTRY glMap2f(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat * points)
+{
+    IntGetCurrentDispatchTable()->Map2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
+}
+
+void GLAPIENTRY glMapGrid1d(GLint un, GLdouble u1, GLdouble u2)
+{
+    IntGetCurrentDispatchTable()->MapGrid1d(un, u1, u2);
+}
+
+void GLAPIENTRY glMapGrid1f(GLint un, GLfloat u1, GLfloat u2)
+{
+    IntGetCurrentDispatchTable()->MapGrid1f(un, u1, u2);
+}
+
+void GLAPIENTRY glMapGrid2d(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2)
+{
+    IntGetCurrentDispatchTable()->MapGrid2d(un, u1, u2, vn, v1, v2);
+}
+
+void GLAPIENTRY glMapGrid2f(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2)
+{
+    IntGetCurrentDispatchTable()->MapGrid2f(un, u1, u2, vn, v1, v2);
+}
+
+void GLAPIENTRY glEvalCoord1d(GLdouble u)
+{
+    IntGetCurrentDispatchTable()->EvalCoord1d(u);
+}
+
+void GLAPIENTRY glEvalCoord1dv(const GLdouble * u)
+{
+    IntGetCurrentDispatchTable()->EvalCoord1dv(u);
+}
+
+void GLAPIENTRY glEvalCoord1f(GLfloat u)
+{
+    IntGetCurrentDispatchTable()->EvalCoord1f(u);
+}
+
+void GLAPIENTRY glEvalCoord1fv(const GLfloat * u)
+{
+    IntGetCurrentDispatchTable()->EvalCoord1fv(u);
+}
+
+void GLAPIENTRY glEvalCoord2d(GLdouble u, GLdouble v)
+{
+    IntGetCurrentDispatchTable()->EvalCoord2d(u, v);
+}
+
+void GLAPIENTRY glEvalCoord2dv(const GLdouble * u)
+{
+    IntGetCurrentDispatchTable()->EvalCoord2dv(u);
+}
+
+void GLAPIENTRY glEvalCoord2f(GLfloat u, GLfloat v)
+{
+    IntGetCurrentDispatchTable()->EvalCoord2f(u, v);
+}
+
+void GLAPIENTRY glEvalCoord2fv(const GLfloat * u)
+{
+    IntGetCurrentDispatchTable()->EvalCoord2fv(u);
+}
+
+void GLAPIENTRY glEvalMesh1(GLenum mode, GLint i1, GLint i2)
+{
+    IntGetCurrentDispatchTable()->EvalMesh1(mode, i1, i2);
+}
+
+void GLAPIENTRY glEvalPoint1(GLint i)
+{
+    IntGetCurrentDispatchTable()->EvalPoint1(i);
+}
+
+void GLAPIENTRY glEvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
+{
+    IntGetCurrentDispatchTable()->EvalMesh2(mode, i1, i2, j1, j2);
+}
+
+void GLAPIENTRY glEvalPoint2(GLint i, GLint j)
+{
+    IntGetCurrentDispatchTable()->EvalPoint2(i, j);
+}
+
+void GLAPIENTRY glAlphaFunc(GLenum func, GLclampf ref)
+{
+    IntGetCurrentDispatchTable()->AlphaFunc(func, ref);
+}
+
+void GLAPIENTRY glBlendFunc(GLenum sfactor, GLenum dfactor)
+{
+    IntGetCurrentDispatchTable()->BlendFunc(sfactor, dfactor);
+}
+
+void GLAPIENTRY glLogicOp(GLenum opcode)
+{
+    IntGetCurrentDispatchTable()->LogicOp(opcode);
+}
+
+void GLAPIENTRY glStencilFunc(GLenum func, GLint ref, GLuint mask)
+{
+    IntGetCurrentDispatchTable()->StencilFunc(func, ref, mask);
+}
+
+void GLAPIENTRY glStencilOp(GLenum fail, GLenum zfail, GLenum zpass)
+{
+    IntGetCurrentDispatchTable()->StencilOp(fail, zfail, zpass);
+}
+
+void GLAPIENTRY glDepthFunc(GLenum func)
+{
+    IntGetCurrentDispatchTable()->DepthFunc(func);
+}
+
+void GLAPIENTRY glPixelZoom(GLfloat xfactor, GLfloat yfactor)
+{
+    IntGetCurrentDispatchTable()->PixelZoom(xfactor, yfactor);
+}
+
+void GLAPIENTRY glPixelTransferf(GLenum pname, GLfloat param)
+{
+    IntGetCurrentDispatchTable()->PixelTransferf(pname, param);
+}
+
+void GLAPIENTRY glPixelTransferi(GLenum pname, GLint param)
+{
+    IntGetCurrentDispatchTable()->PixelTransferi(pname, param);
+}
+
+void GLAPIENTRY glPixelStoref(GLenum pname, GLfloat param)
+{
+    IntGetCurrentDispatchTable()->PixelStoref(pname, param);
+}
+
+void GLAPIENTRY glPixelStorei(GLenum pname, GLint param)
+{
+    IntGetCurrentDispatchTable()->PixelStorei(pname, param);
+}
+
+void GLAPIENTRY glPixelMapfv(GLenum map, GLsizei mapsize, const GLfloat * values)
+{
+    IntGetCurrentDispatchTable()->PixelMapfv(map, mapsize, values);
+}
+
+void GLAPIENTRY glPixelMapuiv(GLenum map, GLsizei mapsize, const GLuint * values)
+{
+    IntGetCurrentDispatchTable()->PixelMapuiv(map, mapsize, values);
+}
+
+void GLAPIENTRY glPixelMapusv(GLenum map, GLsizei mapsize, const GLushort * values)
+{
+    IntGetCurrentDispatchTable()->PixelMapusv(map, mapsize, values);
+}
+
+void GLAPIENTRY glReadBuffer(GLenum mode)
+{
+    IntGetCurrentDispatchTable()->ReadBuffer(mode);
+}
+
+void GLAPIENTRY glCopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type)
+{
+    IntGetCurrentDispatchTable()->CopyPixels(x, y, width, height, type);
+}
+
+void GLAPIENTRY glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * pixels)
+{
+    IntGetCurrentDispatchTable()->ReadPixels(x, y, width, height, format, type, pixels);
+}
+
+void GLAPIENTRY glDrawPixels(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels)
+{
+    IntGetCurrentDispatchTable()->DrawPixels(width, height, format, type, pixels);
+}
+
+void GLAPIENTRY glGetBooleanv(GLenum pname, GLboolean * params)
+{
+    IntGetCurrentDispatchTable()->GetBooleanv(pname, params);
+}
+
+void GLAPIENTRY glGetClipPlane(GLenum plane, GLdouble * equation)
+{
+    IntGetCurrentDispatchTable()->GetClipPlane(plane, equation);
+}
+
+void GLAPIENTRY glGetDoublev(GLenum pname, GLdouble * params)
+{
+    IntGetCurrentDispatchTable()->GetDoublev(pname, params);
+}
+
+GLenum GLAPIENTRY glGetError(void)
+{
+    return IntGetCurrentDispatchTable()->GetError();
+}
+
+void GLAPIENTRY glGetFloatv(GLenum pname, GLfloat * params)
+{
+    IntGetCurrentDispatchTable()->GetFloatv(pname, params);
+}
+
+void GLAPIENTRY glGetIntegerv(GLenum pname, GLint * params)
+{
+    IntGetCurrentDispatchTable()->GetIntegerv(pname, params);
+}
+
+void GLAPIENTRY glGetLightfv(GLenum light, GLenum pname, GLfloat * params)
+{
+    IntGetCurrentDispatchTable()->GetLightfv(light, pname, params);
+}
+
+void GLAPIENTRY glGetLightiv(GLenum light, GLenum pname, GLint * params)
+{
+    IntGetCurrentDispatchTable()->GetLightiv(light, pname, params);
+}
+
+void GLAPIENTRY glGetMapdv(GLenum target, GLenum query, GLdouble * v)
+{
+    IntGetCurrentDispatchTable()->GetMapdv(target, query, v);
+}
+
+void GLAPIENTRY glGetMapfv(GLenum target, GLenum query, GLfloat * v)
+{
+    IntGetCurrentDispatchTable()->GetMapfv(target, query, v);
+}
+
+void GLAPIENTRY glGetMapiv(GLenum target, GLenum query, GLint * v)
+{
+    IntGetCurrentDispatchTable()->GetMapiv(target, query, v);
+}
+
+void GLAPIENTRY glGetMaterialfv(GLenum face, GLenum pname, GLfloat * params)
+{
+    IntGetCurrentDispatchTable()->GetMaterialfv(face, pname, params);
+}
+
+void GLAPIENTRY glGetMaterialiv(GLenum face, GLenum pname, GLint * params)
+{
+    IntGetCurrentDispatchTable()->GetMaterialiv(face, pname, params);
+}
+
+void GLAPIENTRY glGetPixelMapfv(GLenum map, GLfloat * values)
+{
+    IntGetCurrentDispatchTable()->GetPixelMapfv(map, values);
+}
+
+void GLAPIENTRY glGetPixelMapuiv(GLenum map, GLuint * values)
+{
+    IntGetCurrentDispatchTable()->GetPixelMapuiv(map, values);
+}
+
+void GLAPIENTRY glGetPixelMapusv(GLenum map, GLushort * values)
+{
+    IntGetCurrentDispatchTable()->GetPixelMapusv(map, values);
+}
+
+void GLAPIENTRY glGetPolygonStipple(GLubyte * mask)
+{
+    IntGetCurrentDispatchTable()->GetPolygonStipple(mask);
+}
+
+const GLubyte * GLAPIENTRY glGetString(GLenum name)
+{
+    return IntGetCurrentDispatchTable()->GetString(name);
+}
+
+void GLAPIENTRY glGetTexEnvfv(GLenum target, GLenum pname, GLfloat * params)
+{
+    IntGetCurrentDispatchTable()->GetTexEnvfv(target, pname, params);
+}
+
+void GLAPIENTRY glGetTexEnviv(GLenum target, GLenum pname, GLint * params)
+{
+    IntGetCurrentDispatchTable()->GetTexEnviv(target, pname, params);
+}
+
+void GLAPIENTRY glGetTexGendv(GLenum coord, GLenum pname, GLdouble * params)
+{
+    IntGetCurrentDispatchTable()->GetTexGendv(coord, pname, params);
+}
+
+void GLAPIENTRY glGetTexGenfv(GLenum coord, GLenum pname, GLfloat * params)
+{
+    IntGetCurrentDispatchTable()->GetTexGenfv(coord, pname, params);
+}
+
+void GLAPIENTRY glGetTexGeniv(GLenum coord, GLenum pname, GLint * params)
+{
+    IntGetCurrentDispatchTable()->GetTexGeniv(coord, pname, params);
+}
+
+void GLAPIENTRY glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels)
+{
+    IntGetCurrentDispatchTable()->GetTexImage(target, level, format, type, pixels);
+}
+
+void GLAPIENTRY glGetTexParameterfv(GLenum target, GLenum pname, GLfloat * params)
+{
+    IntGetCurrentDispatchTable()->GetTexParameterfv(target, pname, params);
+}
+
+void GLAPIENTRY glGetTexParameteriv(GLenum target, GLenum pname, GLint * params)
+{
+    IntGetCurrentDispatchTable()->GetTexParameteriv(target, pname, params);
+}
+
+void GLAPIENTRY glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat * params)
+{
+    IntGetCurrentDispatchTable()->GetTexLevelParameterfv(target, level, pname, params);
+}
+
+void GLAPIENTRY glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint * params)
+{
+    IntGetCurrentDispatchTable()->GetTexLevelParameteriv(target, level, pname, params);
+}
+
+GLboolean GLAPIENTRY glIsEnabled(GLenum cap)
+{
+    return IntGetCurrentDispatchTable()->IsEnabled(cap);
+}
+
+GLboolean GLAPIENTRY glIsList(GLuint list)
+{
+    return IntGetCurrentDispatchTable()->IsList(list);
+}
+
+void GLAPIENTRY glDepthRange(GLclampd zNear, GLclampd zFar)
+{
+    IntGetCurrentDispatchTable()->DepthRange(zNear, zFar);
+}
+
+void GLAPIENTRY glFrustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)
+{
+    IntGetCurrentDispatchTable()->Frustum(left, right, bottom, top, zNear, zFar);
+}
+
+void GLAPIENTRY glLoadIdentity(void)
+{
+    IntGetCurrentDispatchTable()->LoadIdentity();
+}
+
+void GLAPIENTRY glLoadMatrixf(const GLfloat * m)
+{
+    IntGetCurrentDispatchTable()->LoadMatrixf(m);
+}
+
+void GLAPIENTRY glLoadMatrixd(const GLdouble * m)
+{
+    IntGetCurrentDispatchTable()->LoadMatrixd(m);
+}
+
+void GLAPIENTRY glMatrixMode(GLenum mode)
+{
+    IntGetCurrentDispatchTable()->MatrixMode(mode);
+}
+
+void GLAPIENTRY glMultMatrixf(const GLfloat * m)
+{
+    IntGetCurrentDispatchTable()->MultMatrixf(m);
+}
+
+void GLAPIENTRY glMultMatrixd(const GLdouble * m)
+{
+    IntGetCurrentDispatchTable()->MultMatrixd(m);
+}
+
+void GLAPIENTRY glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)
+{
+    IntGetCurrentDispatchTable()->Ortho(left, right, bottom, top, zNear, zFar);
+}
+
+void GLAPIENTRY glPopMatrix(void)
+{
+    IntGetCurrentDispatchTable()->PopMatrix();
+}
+
+void GLAPIENTRY glPushMatrix(void)
+{
+    IntGetCurrentDispatchTable()->PushMatrix();
+}
+
+void GLAPIENTRY glRotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
+{
+    IntGetCurrentDispatchTable()->Rotated(angle, x, y, z);
+}
+
+void GLAPIENTRY glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
+{
+    IntGetCurrentDispatchTable()->Rotatef(angle, x, y, z);
+}
+
+void GLAPIENTRY glScaled(GLdouble x, GLdouble y, GLdouble z)
+{
+    IntGetCurrentDispatchTable()->Scaled(x, y, z);
+}
+
+void GLAPIENTRY glScalef(GLfloat x, GLfloat y, GLfloat z)
+{
+    IntGetCurrentDispatchTable()->Scalef(x, y, z);
+}
+
+void GLAPIENTRY glTranslated(GLdouble x, GLdouble y, GLdouble z)
+{
+    IntGetCurrentDispatchTable()->Translated(x, y, z);
+}
+
+void GLAPIENTRY glTranslatef(GLfloat x, GLfloat y, GLfloat z)
+{
+    IntGetCurrentDispatchTable()->Translatef(x, y, z);
+}
+
+void GLAPIENTRY glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
+{
+    IntGetCurrentDispatchTable()->Viewport(x, y, width, height);
+}
+
+void GLAPIENTRY glArrayElement(GLint i)
+{
+    IntGetCurrentDispatchTable()->ArrayElement(i);
+}
+
+void GLAPIENTRY glBindTexture(GLenum target, GLuint texture)
+{
+    IntGetCurrentDispatchTable()->BindTexture(target, texture);
+}
+
+void GLAPIENTRY glColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
+{
+    IntGetCurrentDispatchTable()->ColorPointer(size, type, stride, pointer);
+}
+
+void GLAPIENTRY glDisableClientState(GLenum array)
+{
+    IntGetCurrentDispatchTable()->DisableClientState(array);
+}
+
+void GLAPIENTRY glDrawArrays(GLenum mode, GLint first, GLsizei count)
+{
+    IntGetCurrentDispatchTable()->DrawArrays(mode, first, count);
+}
+
+void GLAPIENTRY glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices)
+{
+    IntGetCurrentDispatchTable()->DrawElements(mode, count, type, indices);
+}
+
+void GLAPIENTRY glEdgeFlagPointer(GLsizei stride, const GLvoid * pointer)
+{
+    IntGetCurrentDispatchTable()->EdgeFlagPointer(stride, pointer);
+}
+
+void GLAPIENTRY glEnableClientState(GLenum array)
+{
+    IntGetCurrentDispatchTable()->EnableClientState(array);
+}
+
+void GLAPIENTRY glIndexPointer(GLenum type, GLsizei stride, const GLvoid * pointer)
+{
+    IntGetCurrentDispatchTable()->IndexPointer(type, stride, pointer);
+}
+
+void GLAPIENTRY glIndexub(GLubyte c)
+{
+    IntGetCurrentDispatchTable()->Indexub(c);
+}
+
+void GLAPIENTRY glIndexubv(const GLubyte * c)
+{
+    IntGetCurrentDispatchTable()->Indexubv(c);
+}
+
+void GLAPIENTRY glInterleavedArrays(GLenum format, GLsizei stride, const GLvoid * pointer)
+{
+    IntGetCurrentDispatchTable()->InterleavedArrays(format, stride, pointer);
+}
+
+void GLAPIENTRY glNormalPointer(GLenum type, GLsizei stride, const GLvoid * pointer)
+{
+    IntGetCurrentDispatchTable()->NormalPointer(type, stride, pointer);
+}
+
+void GLAPIENTRY glPolygonOffset(GLfloat factor, GLfloat units)
+{
+    IntGetCurrentDispatchTable()->PolygonOffset(factor, units);
+}
+
+void GLAPIENTRY glTexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
+{
+    IntGetCurrentDispatchTable()->TexCoordPointer(size, type, stride, pointer);
+}
+
+void GLAPIENTRY glVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
+{
+    IntGetCurrentDispatchTable()->VertexPointer(size, type, stride, pointer);
+}
+
+GLboolean GLAPIENTRY glAreTexturesResident(GLsizei n, const GLuint * textures, GLboolean * residences)
+{
+    return IntGetCurrentDispatchTable()->AreTexturesResident(n, textures, residences);
+}
+
+void GLAPIENTRY glCopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border)
+{
+    IntGetCurrentDispatchTable()->CopyTexImage1D(target, level, internalformat, x, y, width, border);
+}
+
+void GLAPIENTRY glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
+{
+    IntGetCurrentDispatchTable()->CopyTexImage2D(target, level, internalformat, x, y, width, height, border);
+}
+
+void GLAPIENTRY glCopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)
+{
+    IntGetCurrentDispatchTable()->CopyTexSubImage1D(target, level, xoffset, x, y, width);
+}
+
+void GLAPIENTRY glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+    IntGetCurrentDispatchTable()->CopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
+}
+
+void GLAPIENTRY glDeleteTextures(GLsizei n, const GLuint * textures)
+{
+    IntGetCurrentDispatchTable()->DeleteTextures(n, textures);
+}
+
+void GLAPIENTRY glGenTextures(GLsizei n, GLuint * textures)
+{
+    IntGetCurrentDispatchTable()->GenTextures(n, textures);
+}
+
+void GLAPIENTRY glGetPointerv(GLenum pname, GLvoid ** params)
+{
+    IntGetCurrentDispatchTable()->GetPointerv(pname, params);
+}
+
+GLboolean GLAPIENTRY glIsTexture(GLuint texture)
+{
+    return IntGetCurrentDispatchTable()->IsTexture(texture);
+}
+
+void GLAPIENTRY glPrioritizeTextures(GLsizei n, const GLuint * textures, const GLclampf * priorities)
+{
+    IntGetCurrentDispatchTable()->PrioritizeTextures(n, textures, priorities);
+}
+
+void GLAPIENTRY glTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels)
+{
+    IntGetCurrentDispatchTable()->TexSubImage1D(target, level, xoffset, width, format, type, pixels);
+}
+
+void GLAPIENTRY glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels)
+{
+    IntGetCurrentDispatchTable()->TexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
+}
+
+void GLAPIENTRY glPopClientAttrib(void)
+{
+    IntGetCurrentDispatchTable()->PopClientAttrib();
+}
+
+void GLAPIENTRY glPushClientAttrib(GLbitfield mask)
+{
+    IntGetCurrentDispatchTable()->PushClientAttrib(mask);
+}
+
+/* Unknown debug function */
+GLint GLAPIENTRY glDebugEntry(GLint unknown1, GLint unknown2)
+{
+    return 0;
+}
diff --git a/reactos/dll/opengl/opengl32_new/dllmain.c b/reactos/dll/opengl/opengl32_new/dllmain.c
new file mode 100644 (file)
index 0000000..6865640
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * COPYRIGHT:            See COPYING in the top level directory
+ * PROJECT:              ReactOS
+ * FILE:                 dll/opengl/opengl32/dllmain.c
+ * PURPOSE:              OpenGL32 DLL
+ */
+
+#include "opengl32.h"
+
+#ifdef OPENGL32_USE_TLS
+DWORD OglTlsIndex = 0xFFFFFFFF;
+#endif
+
+BOOL WINAPI
+DllMain(HINSTANCE hInstance, DWORD Reason, LPVOID Reserved)
+{
+#ifdef OPENGL32_USE_TLS
+    struct Opengl32_ThreadData* ThreadData;
+#endif
+    switch ( Reason )
+    {
+        /* The DLL is loading due to process
+         * initialization or a call to LoadLibrary.
+         */
+        case DLL_PROCESS_ATTACH:
+#ifdef OPENGL32_USE_TLS
+            OglTlsIndex = TlsAlloc();
+            if(OglTlsIndex == TLS_OUT_OF_INDEXES)
+                return FALSE;
+#endif
+        /* Fall through */
+        case DLL_THREAD_ATTACH:
+#ifdef OPENGL32_USE_TLS
+            ThreadData = HeapAlloc(GetProcessHeap(), 0, sizeof(*ThreadData));
+            if(!ThreadData)
+                return FALSE;
+            TlsSetValue(OglTlsIndex, ThreadData);
+            ThreadData->ProcTable = &StubTable;
+            ThreadData->hglrc = NULL;
+            ThreadData->hdc = NULL;
+            ThreadData->dc_data = NULL;
+#else
+            NtCurrentTeb()->glTable = &StubTable.glDispatchTable;
+#endif // defined(OPENGL32_USE_TLS)
+            break;
+
+        case DLL_THREAD_DETACH:
+            /* Clean up */
+#ifdef OPENGL32_USE_TLS
+            ThreadData = TlsGetValue(OglTlsIndex);
+            if(ThreadData)
+                HeapFree(GetProcessHeap(), 0, ThreadData);
+#else
+            NtCurrentTeb->glTable = NULL;
+#endif // defined(OPENGL32_USE_TLS)
+            break;
+        
+        case DLL_PROCESS_DETACH:
+            /* Clean up */
+#ifdef OPENGL32_USE_TLS
+            ThreadData = TlsGetValue(OglTlsIndex);
+            if(ThreadData)
+                HeapFree(GetProcessHeap(), 0, ThreadData);
+            TlsFree(OglTlsIndex);
+#else
+            NtCurrentTeb->glTable = NULL;
+#endif // defined(OPENGL32_USE_TLS)
+            break;
+    }
+
+    return TRUE;
+}
\ No newline at end of file
diff --git a/reactos/dll/opengl/opengl32_new/glfuncs.h b/reactos/dll/opengl/opengl32_new/glfuncs.h
new file mode 100644 (file)
index 0000000..9277920
--- /dev/null
@@ -0,0 +1,338 @@
+/* List of all GL functions exported by opengl32.dll */
+
+USE_GL_FUNC(Accum)
+USE_GL_FUNC(AlphaFunc)
+USE_GL_FUNC(AreTexturesResident)
+USE_GL_FUNC(ArrayElement)
+USE_GL_FUNC(Begin)
+USE_GL_FUNC(BindTexture)
+USE_GL_FUNC(Bitmap)
+USE_GL_FUNC(BlendFunc)
+USE_GL_FUNC(CallList)
+USE_GL_FUNC(CallLists)
+USE_GL_FUNC(Clear)
+USE_GL_FUNC(ClearAccum)
+USE_GL_FUNC(ClearColor)
+USE_GL_FUNC(ClearDepth)
+USE_GL_FUNC(ClearIndex)
+USE_GL_FUNC(ClearStencil)
+USE_GL_FUNC(ClipPlane)
+USE_GL_FUNC(Color3b)
+USE_GL_FUNC(Color3bv)
+USE_GL_FUNC(Color3d)
+USE_GL_FUNC(Color3dv)
+USE_GL_FUNC(Color3f)
+USE_GL_FUNC(Color3fv)
+USE_GL_FUNC(Color3i)
+USE_GL_FUNC(Color3iv)
+USE_GL_FUNC(Color3s)
+USE_GL_FUNC(Color3sv)
+USE_GL_FUNC(Color3ub)
+USE_GL_FUNC(Color3ubv)
+USE_GL_FUNC(Color3ui)
+USE_GL_FUNC(Color3uiv)
+USE_GL_FUNC(Color3us)
+USE_GL_FUNC(Color3usv)
+USE_GL_FUNC(Color4b)
+USE_GL_FUNC(Color4bv)
+USE_GL_FUNC(Color4d)
+USE_GL_FUNC(Color4dv)
+USE_GL_FUNC(Color4f)
+USE_GL_FUNC(Color4fv)
+USE_GL_FUNC(Color4i)
+USE_GL_FUNC(Color4iv)
+USE_GL_FUNC(Color4s)
+USE_GL_FUNC(Color4sv)
+USE_GL_FUNC(Color4ub)
+USE_GL_FUNC(Color4ubv)
+USE_GL_FUNC(Color4ui)
+USE_GL_FUNC(Color4uiv)
+USE_GL_FUNC(Color4us)
+USE_GL_FUNC(Color4usv)
+USE_GL_FUNC(ColorMask)
+USE_GL_FUNC(ColorMaterial)
+USE_GL_FUNC(ColorPointer)
+USE_GL_FUNC(CopyPixels)
+USE_GL_FUNC(CopyTexImage1D)
+USE_GL_FUNC(CopyTexImage2D)
+USE_GL_FUNC(CopyTexSubImage1D)
+USE_GL_FUNC(CopyTexSubImage2D)
+USE_GL_FUNC(CullFace)
+USE_GL_FUNC(DeleteLists)
+USE_GL_FUNC(DeleteTextures)
+USE_GL_FUNC(DepthFunc)
+USE_GL_FUNC(DepthMask)
+USE_GL_FUNC(DepthRange)
+USE_GL_FUNC(Disable)
+USE_GL_FUNC(DisableClientState)
+USE_GL_FUNC(DrawArrays)
+USE_GL_FUNC(DrawBuffer)
+USE_GL_FUNC(DrawElements)
+USE_GL_FUNC(DrawPixels)
+USE_GL_FUNC(EdgeFlag)
+USE_GL_FUNC(EdgeFlagPointer)
+USE_GL_FUNC(EdgeFlagv)
+USE_GL_FUNC(Enable)
+USE_GL_FUNC(EnableClientState)
+USE_GL_FUNC(End)
+USE_GL_FUNC(EndList)
+USE_GL_FUNC(EvalCoord1d)
+USE_GL_FUNC(EvalCoord1dv)
+USE_GL_FUNC(EvalCoord1f)
+USE_GL_FUNC(EvalCoord1fv)
+USE_GL_FUNC(EvalCoord2d)
+USE_GL_FUNC(EvalCoord2dv)
+USE_GL_FUNC(EvalCoord2f)
+USE_GL_FUNC(EvalCoord2fv)
+USE_GL_FUNC(EvalMesh1)
+USE_GL_FUNC(EvalMesh2)
+USE_GL_FUNC(EvalPoint1)
+USE_GL_FUNC(EvalPoint2)
+USE_GL_FUNC(FeedbackBuffer)
+USE_GL_FUNC(Finish)
+USE_GL_FUNC(Flush)
+USE_GL_FUNC(Fogf)
+USE_GL_FUNC(Fogfv)
+USE_GL_FUNC(Fogi)
+USE_GL_FUNC(Fogiv)
+USE_GL_FUNC(FrontFace)
+USE_GL_FUNC(Frustum)
+USE_GL_FUNC(GenLists)
+USE_GL_FUNC(GenTextures)
+USE_GL_FUNC(GetBooleanv)
+USE_GL_FUNC(GetClipPlane)
+USE_GL_FUNC(GetDoublev)
+USE_GL_FUNC(GetError)
+USE_GL_FUNC(GetFloatv)
+USE_GL_FUNC(GetIntegerv)
+USE_GL_FUNC(GetLightfv)
+USE_GL_FUNC(GetLightiv)
+USE_GL_FUNC(GetMapdv)
+USE_GL_FUNC(GetMapfv)
+USE_GL_FUNC(GetMapiv)
+USE_GL_FUNC(GetMaterialfv)
+USE_GL_FUNC(GetMaterialiv)
+USE_GL_FUNC(GetPixelMapfv)
+USE_GL_FUNC(GetPixelMapuiv)
+USE_GL_FUNC(GetPixelMapusv)
+USE_GL_FUNC(GetPointerv)
+USE_GL_FUNC(GetPolygonStipple)
+USE_GL_FUNC(GetString)
+USE_GL_FUNC(GetTexEnvfv)
+USE_GL_FUNC(GetTexEnviv)
+USE_GL_FUNC(GetTexGendv)
+USE_GL_FUNC(GetTexGenfv)
+USE_GL_FUNC(GetTexGeniv)
+USE_GL_FUNC(GetTexImage)
+USE_GL_FUNC(GetTexLevelParameterfv)
+USE_GL_FUNC(GetTexLevelParameteriv)
+USE_GL_FUNC(GetTexParameterfv)
+USE_GL_FUNC(GetTexParameteriv)
+USE_GL_FUNC(Hint)
+USE_GL_FUNC(IndexMask)
+USE_GL_FUNC(IndexPointer)
+USE_GL_FUNC(Indexd)
+USE_GL_FUNC(Indexdv)
+USE_GL_FUNC(Indexf)
+USE_GL_FUNC(Indexfv)
+USE_GL_FUNC(Indexi)
+USE_GL_FUNC(Indexiv)
+USE_GL_FUNC(Indexs)
+USE_GL_FUNC(Indexsv)
+USE_GL_FUNC(Indexub)
+USE_GL_FUNC(Indexubv)
+USE_GL_FUNC(InitNames)
+USE_GL_FUNC(InterleavedArrays)
+USE_GL_FUNC(IsEnabled)
+USE_GL_FUNC(IsList)
+USE_GL_FUNC(IsTexture)
+USE_GL_FUNC(LightModelf)
+USE_GL_FUNC(LightModelfv)
+USE_GL_FUNC(LightModeli)
+USE_GL_FUNC(LightModeliv)
+USE_GL_FUNC(Lightf)
+USE_GL_FUNC(Lightfv)
+USE_GL_FUNC(Lighti)
+USE_GL_FUNC(Lightiv)
+USE_GL_FUNC(LineStipple)
+USE_GL_FUNC(LineWidth)
+USE_GL_FUNC(ListBase)
+USE_GL_FUNC(LoadIdentity)
+USE_GL_FUNC(LoadMatrixd)
+USE_GL_FUNC(LoadMatrixf)
+USE_GL_FUNC(LoadName)
+USE_GL_FUNC(LogicOp)
+USE_GL_FUNC(Map1d)
+USE_GL_FUNC(Map1f)
+USE_GL_FUNC(Map2d)
+USE_GL_FUNC(Map2f)
+USE_GL_FUNC(MapGrid1d)
+USE_GL_FUNC(MapGrid1f)
+USE_GL_FUNC(MapGrid2d)
+USE_GL_FUNC(MapGrid2f)
+USE_GL_FUNC(Materialf)
+USE_GL_FUNC(Materialfv)
+USE_GL_FUNC(Materiali)
+USE_GL_FUNC(Materialiv)
+USE_GL_FUNC(MatrixMode)
+USE_GL_FUNC(MultMatrixd)
+USE_GL_FUNC(MultMatrixf)
+USE_GL_FUNC(NewList)
+USE_GL_FUNC(Normal3b)
+USE_GL_FUNC(Normal3bv)
+USE_GL_FUNC(Normal3d)
+USE_GL_FUNC(Normal3dv)
+USE_GL_FUNC(Normal3f)
+USE_GL_FUNC(Normal3fv)
+USE_GL_FUNC(Normal3i)
+USE_GL_FUNC(Normal3iv)
+USE_GL_FUNC(Normal3s)
+USE_GL_FUNC(Normal3sv)
+USE_GL_FUNC(NormalPointer)
+USE_GL_FUNC(Ortho)
+USE_GL_FUNC(PassThrough)
+USE_GL_FUNC(PixelMapfv)
+USE_GL_FUNC(PixelMapuiv)
+USE_GL_FUNC(PixelMapusv)
+USE_GL_FUNC(PixelStoref)
+USE_GL_FUNC(PixelStorei)
+USE_GL_FUNC(PixelTransferf)
+USE_GL_FUNC(PixelTransferi)
+USE_GL_FUNC(PixelZoom)
+USE_GL_FUNC(PointSize)
+USE_GL_FUNC(PolygonMode)
+USE_GL_FUNC(PolygonOffset)
+USE_GL_FUNC(PolygonStipple)
+USE_GL_FUNC(PopAttrib)
+USE_GL_FUNC(PopClientAttrib)
+USE_GL_FUNC(PopMatrix)
+USE_GL_FUNC(PopName)
+USE_GL_FUNC(PrioritizeTextures)
+USE_GL_FUNC(PushAttrib)
+USE_GL_FUNC(PushClientAttrib)
+USE_GL_FUNC(PushMatrix)
+USE_GL_FUNC(PushName)
+USE_GL_FUNC(RasterPos2d)
+USE_GL_FUNC(RasterPos2dv)
+USE_GL_FUNC(RasterPos2f)
+USE_GL_FUNC(RasterPos2fv)
+USE_GL_FUNC(RasterPos2i)
+USE_GL_FUNC(RasterPos2iv)
+USE_GL_FUNC(RasterPos2s)
+USE_GL_FUNC(RasterPos2sv)
+USE_GL_FUNC(RasterPos3d)
+USE_GL_FUNC(RasterPos3dv)
+USE_GL_FUNC(RasterPos3f)
+USE_GL_FUNC(RasterPos3fv)
+USE_GL_FUNC(RasterPos3i)
+USE_GL_FUNC(RasterPos3iv)
+USE_GL_FUNC(RasterPos3s)
+USE_GL_FUNC(RasterPos3sv)
+USE_GL_FUNC(RasterPos4d)
+USE_GL_FUNC(RasterPos4dv)
+USE_GL_FUNC(RasterPos4f)
+USE_GL_FUNC(RasterPos4fv)
+USE_GL_FUNC(RasterPos4i)
+USE_GL_FUNC(RasterPos4iv)
+USE_GL_FUNC(RasterPos4s)
+USE_GL_FUNC(RasterPos4sv)
+USE_GL_FUNC(ReadBuffer)
+USE_GL_FUNC(ReadPixels)
+USE_GL_FUNC(Rectd)
+USE_GL_FUNC(Rectdv)
+USE_GL_FUNC(Rectf)
+USE_GL_FUNC(Rectfv)
+USE_GL_FUNC(Recti)
+USE_GL_FUNC(Rectiv)
+USE_GL_FUNC(Rects)
+USE_GL_FUNC(Rectsv)
+USE_GL_FUNC(RenderMode)
+USE_GL_FUNC(Rotated)
+USE_GL_FUNC(Rotatef)
+USE_GL_FUNC(Scaled)
+USE_GL_FUNC(Scalef)
+USE_GL_FUNC(Scissor)
+USE_GL_FUNC(SelectBuffer)
+USE_GL_FUNC(ShadeModel)
+USE_GL_FUNC(StencilFunc)
+USE_GL_FUNC(StencilMask)
+USE_GL_FUNC(StencilOp)
+USE_GL_FUNC(TexCoord1d)
+USE_GL_FUNC(TexCoord1dv)
+USE_GL_FUNC(TexCoord1f)
+USE_GL_FUNC(TexCoord1fv)
+USE_GL_FUNC(TexCoord1i)
+USE_GL_FUNC(TexCoord1iv)
+USE_GL_FUNC(TexCoord1s)
+USE_GL_FUNC(TexCoord1sv)
+USE_GL_FUNC(TexCoord2d)
+USE_GL_FUNC(TexCoord2dv)
+USE_GL_FUNC(TexCoord2f)
+USE_GL_FUNC(TexCoord2fv)
+USE_GL_FUNC(TexCoord2i)
+USE_GL_FUNC(TexCoord2iv)
+USE_GL_FUNC(TexCoord2s)
+USE_GL_FUNC(TexCoord2sv)
+USE_GL_FUNC(TexCoord3d)
+USE_GL_FUNC(TexCoord3dv)
+USE_GL_FUNC(TexCoord3f)
+USE_GL_FUNC(TexCoord3fv)
+USE_GL_FUNC(TexCoord3i)
+USE_GL_FUNC(TexCoord3iv)
+USE_GL_FUNC(TexCoord3s)
+USE_GL_FUNC(TexCoord3sv)
+USE_GL_FUNC(TexCoord4d)
+USE_GL_FUNC(TexCoord4dv)
+USE_GL_FUNC(TexCoord4f)
+USE_GL_FUNC(TexCoord4fv)
+USE_GL_FUNC(TexCoord4i)
+USE_GL_FUNC(TexCoord4iv)
+USE_GL_FUNC(TexCoord4s)
+USE_GL_FUNC(TexCoord4sv)
+USE_GL_FUNC(TexCoordPointer)
+USE_GL_FUNC(TexEnvf)
+USE_GL_FUNC(TexEnvfv)
+USE_GL_FUNC(TexEnvi)
+USE_GL_FUNC(TexEnviv)
+USE_GL_FUNC(TexGend)
+USE_GL_FUNC(TexGendv)
+USE_GL_FUNC(TexGenf)
+USE_GL_FUNC(TexGenfv)
+USE_GL_FUNC(TexGeni)
+USE_GL_FUNC(TexGeniv)
+USE_GL_FUNC(TexImage1D)
+USE_GL_FUNC(TexImage2D)
+USE_GL_FUNC(TexParameterf)
+USE_GL_FUNC(TexParameterfv)
+USE_GL_FUNC(TexParameteri)
+USE_GL_FUNC(TexParameteriv)
+USE_GL_FUNC(TexSubImage1D)
+USE_GL_FUNC(TexSubImage2D)
+USE_GL_FUNC(Translated)
+USE_GL_FUNC(Translatef)
+USE_GL_FUNC(Vertex2d)
+USE_GL_FUNC(Vertex2dv)
+USE_GL_FUNC(Vertex2f)
+USE_GL_FUNC(Vertex2fv)
+USE_GL_FUNC(Vertex2i)
+USE_GL_FUNC(Vertex2iv)
+USE_GL_FUNC(Vertex2s)
+USE_GL_FUNC(Vertex2sv)
+USE_GL_FUNC(Vertex3d)
+USE_GL_FUNC(Vertex3dv)
+USE_GL_FUNC(Vertex3f)
+USE_GL_FUNC(Vertex3fv)
+USE_GL_FUNC(Vertex3i)
+USE_GL_FUNC(Vertex3iv)
+USE_GL_FUNC(Vertex3s)
+USE_GL_FUNC(Vertex3sv)
+USE_GL_FUNC(Vertex4d)
+USE_GL_FUNC(Vertex4dv)
+USE_GL_FUNC(Vertex4f)
+USE_GL_FUNC(Vertex4fv)
+USE_GL_FUNC(Vertex4i)
+USE_GL_FUNC(Vertex4iv)
+USE_GL_FUNC(Vertex4s)
+USE_GL_FUNC(Vertex4sv)
+USE_GL_FUNC(VertexPointer)
+USE_GL_FUNC(Viewport)
\ No newline at end of file
diff --git a/reactos/dll/opengl/opengl32_new/icd.h b/reactos/dll/opengl/opengl32_new/icd.h
new file mode 100644 (file)
index 0000000..cc7c2e4
--- /dev/null
@@ -0,0 +1,398 @@
+/*
+ * COPYRIGHT:            See COPYING in the top level directory
+ * PROJECT:              ReactOS kernel
+ * FILE:                 lib/opengl32/icd.h
+ * PURPOSE:              OpenGL32 lib, ICD specific definitions
+ */
+
+#pragma once
+
+#define OPENGL_VERSION_110_ENTRIES  336
+
+struct __GLdispatchTableRec
+{
+   void (GLAPIENTRY * NewList)(GLuint, GLenum);
+   void (GLAPIENTRY * EndList)(void);
+   void (GLAPIENTRY * CallList)(GLuint);
+   void (GLAPIENTRY * CallLists)(GLsizei, GLenum, const GLvoid *);
+   void (GLAPIENTRY * DeleteLists)(GLuint, GLsizei);
+   GLuint (GLAPIENTRY * GenLists)(GLsizei);
+   void (GLAPIENTRY * ListBase)(GLuint);
+   void (GLAPIENTRY * Begin)(GLenum);
+   void (GLAPIENTRY * Bitmap)(GLsizei, GLsizei, GLfloat, GLfloat, GLfloat, GLfloat, const GLubyte *);
+   void (GLAPIENTRY * Color3b)(GLbyte, GLbyte, GLbyte);
+   void (GLAPIENTRY * Color3bv)(const GLbyte *);
+   void (GLAPIENTRY * Color3d)(GLdouble, GLdouble, GLdouble);
+   void (GLAPIENTRY * Color3dv)(const GLdouble *);
+   void (GLAPIENTRY * Color3f)(GLfloat, GLfloat, GLfloat);
+   void (GLAPIENTRY * Color3fv)(const GLfloat *);
+   void (GLAPIENTRY * Color3i)(GLint, GLint, GLint);
+   void (GLAPIENTRY * Color3iv)(const GLint *);
+   void (GLAPIENTRY * Color3s)(GLshort, GLshort, GLshort);
+   void (GLAPIENTRY * Color3sv)(const GLshort *);
+   void (GLAPIENTRY * Color3ub)(GLubyte, GLubyte, GLubyte);
+   void (GLAPIENTRY * Color3ubv)(const GLubyte *);
+   void (GLAPIENTRY * Color3ui)(GLuint, GLuint, GLuint);
+   void (GLAPIENTRY * Color3uiv)(const GLuint *);
+   void (GLAPIENTRY * Color3us)(GLushort, GLushort, GLushort);
+   void (GLAPIENTRY * Color3usv)(const GLushort *);
+   void (GLAPIENTRY * Color4b)(GLbyte, GLbyte, GLbyte, GLbyte);
+   void (GLAPIENTRY * Color4bv)(const GLbyte *);
+   void (GLAPIENTRY * Color4d)(GLdouble, GLdouble, GLdouble, GLdouble);
+   void (GLAPIENTRY * Color4dv)(const GLdouble *);
+   void (GLAPIENTRY * Color4f)(GLfloat, GLfloat, GLfloat, GLfloat);
+   void (GLAPIENTRY * Color4fv)(const GLfloat *);
+   void (GLAPIENTRY * Color4i)(GLint, GLint, GLint, GLint);
+   void (GLAPIENTRY * Color4iv)(const GLint *);
+   void (GLAPIENTRY * Color4s)(GLshort, GLshort, GLshort, GLshort);
+   void (GLAPIENTRY * Color4sv)(const GLshort *);
+   void (GLAPIENTRY * Color4ub)(GLubyte, GLubyte, GLubyte, GLubyte);
+   void (GLAPIENTRY * Color4ubv)(const GLubyte *);
+   void (GLAPIENTRY * Color4ui)(GLuint, GLuint, GLuint, GLuint);
+   void (GLAPIENTRY * Color4uiv)(const GLuint *);
+   void (GLAPIENTRY * Color4us)(GLushort, GLushort, GLushort, GLushort);
+   void (GLAPIENTRY * Color4usv)(const GLushort *);
+   void (GLAPIENTRY * EdgeFlag)(GLboolean);
+   void (GLAPIENTRY * EdgeFlagv)(const GLboolean *);
+   void (GLAPIENTRY * End)(void);
+   void (GLAPIENTRY * Indexd)(GLdouble);
+   void (GLAPIENTRY * Indexdv)(const GLdouble *);
+   void (GLAPIENTRY * Indexf)(GLfloat);
+   void (GLAPIENTRY * Indexfv)(const GLfloat *);
+   void (GLAPIENTRY * Indexi)(GLint);
+   void (GLAPIENTRY * Indexiv)(const GLint *);
+   void (GLAPIENTRY * Indexs)(GLshort);
+   void (GLAPIENTRY * Indexsv)(const GLshort *);
+   void (GLAPIENTRY * Normal3b)(GLbyte, GLbyte, GLbyte);
+   void (GLAPIENTRY * Normal3bv)(const GLbyte *);
+   void (GLAPIENTRY * Normal3d)(GLdouble, GLdouble, GLdouble);
+   void (GLAPIENTRY * Normal3dv)(const GLdouble *);
+   void (GLAPIENTRY * Normal3f)(GLfloat, GLfloat, GLfloat);
+   void (GLAPIENTRY * Normal3fv)(const GLfloat *);
+   void (GLAPIENTRY * Normal3i)(GLint, GLint, GLint);
+   void (GLAPIENTRY * Normal3iv)(const GLint *);
+   void (GLAPIENTRY * Normal3s)(GLshort, GLshort, GLshort);
+   void (GLAPIENTRY * Normal3sv)(const GLshort *);
+   void (GLAPIENTRY * RasterPos2d)(GLdouble, GLdouble);
+   void (GLAPIENTRY * RasterPos2dv)(const GLdouble *);
+   void (GLAPIENTRY * RasterPos2f)(GLfloat, GLfloat);
+   void (GLAPIENTRY * RasterPos2fv)(const GLfloat *);
+   void (GLAPIENTRY * RasterPos2i)(GLint, GLint);
+   void (GLAPIENTRY * RasterPos2iv)(const GLint *);
+   void (GLAPIENTRY * RasterPos2s)(GLshort, GLshort);
+   void (GLAPIENTRY * RasterPos2sv)(const GLshort *);
+   void (GLAPIENTRY * RasterPos3d)(GLdouble, GLdouble, GLdouble);
+   void (GLAPIENTRY * RasterPos3dv)(const GLdouble *);
+   void (GLAPIENTRY * RasterPos3f)(GLfloat, GLfloat, GLfloat);
+   void (GLAPIENTRY * RasterPos3fv)(const GLfloat *);
+   void (GLAPIENTRY * RasterPos3i)(GLint, GLint, GLint);
+   void (GLAPIENTRY * RasterPos3iv)(const GLint *);
+   void (GLAPIENTRY * RasterPos3s)(GLshort, GLshort, GLshort);
+   void (GLAPIENTRY * RasterPos3sv)(const GLshort *);
+   void (GLAPIENTRY * RasterPos4d)(GLdouble, GLdouble, GLdouble, GLdouble);
+   void (GLAPIENTRY * RasterPos4dv)(const GLdouble *);
+   void (GLAPIENTRY * RasterPos4f)(GLfloat, GLfloat, GLfloat, GLfloat);
+   void (GLAPIENTRY * RasterPos4fv)(const GLfloat *);
+   void (GLAPIENTRY * RasterPos4i)(GLint, GLint, GLint, GLint);
+   void (GLAPIENTRY * RasterPos4iv)(const GLint *);
+   void (GLAPIENTRY * RasterPos4s)(GLshort, GLshort, GLshort, GLshort);
+   void (GLAPIENTRY * RasterPos4sv)(const GLshort *);
+   void (GLAPIENTRY * Rectd)(GLdouble, GLdouble, GLdouble, GLdouble);
+   void (GLAPIENTRY * Rectdv)(const GLdouble *, const GLdouble *);
+   void (GLAPIENTRY * Rectf)(GLfloat, GLfloat, GLfloat, GLfloat);
+   void (GLAPIENTRY * Rectfv)(const GLfloat *, const GLfloat *);
+   void (GLAPIENTRY * Recti)(GLint, GLint, GLint, GLint);
+   void (GLAPIENTRY * Rectiv)(const GLint *, const GLint *);
+   void (GLAPIENTRY * Rects)(GLshort, GLshort, GLshort, GLshort);
+   void (GLAPIENTRY * Rectsv)(const GLshort *, const GLshort *);
+   void (GLAPIENTRY * TexCoord1d)(GLdouble);
+   void (GLAPIENTRY * TexCoord1dv)(const GLdouble *);
+   void (GLAPIENTRY * TexCoord1f)(GLfloat);
+   void (GLAPIENTRY * TexCoord1fv)(const GLfloat *);
+   void (GLAPIENTRY * TexCoord1i)(GLint);
+   void (GLAPIENTRY * TexCoord1iv)(const GLint *);
+   void (GLAPIENTRY * TexCoord1s)(GLshort);
+   void (GLAPIENTRY * TexCoord1sv)(const GLshort *);
+   void (GLAPIENTRY * TexCoord2d)(GLdouble, GLdouble);
+   void (GLAPIENTRY * TexCoord2dv)(const GLdouble *);
+   void (GLAPIENTRY * TexCoord2f)(GLfloat, GLfloat);
+   void (GLAPIENTRY * TexCoord2fv)(const GLfloat *);
+   void (GLAPIENTRY * TexCoord2i)(GLint, GLint);
+   void (GLAPIENTRY * TexCoord2iv)(const GLint *);
+   void (GLAPIENTRY * TexCoord2s)(GLshort, GLshort);
+   void (GLAPIENTRY * TexCoord2sv)(const GLshort *);
+   void (GLAPIENTRY * TexCoord3d)(GLdouble, GLdouble, GLdouble);
+   void (GLAPIENTRY * TexCoord3dv)(const GLdouble *);
+   void (GLAPIENTRY * TexCoord3f)(GLfloat, GLfloat, GLfloat);
+   void (GLAPIENTRY * TexCoord3fv)(const GLfloat *);
+   void (GLAPIENTRY * TexCoord3i)(GLint, GLint, GLint);
+   void (GLAPIENTRY * TexCoord3iv)(const GLint *);
+   void (GLAPIENTRY * TexCoord3s)(GLshort, GLshort, GLshort);
+   void (GLAPIENTRY * TexCoord3sv)(const GLshort *);
+   void (GLAPIENTRY * TexCoord4d)(GLdouble, GLdouble, GLdouble, GLdouble);
+   void (GLAPIENTRY * TexCoord4dv)(const GLdouble *);
+   void (GLAPIENTRY * TexCoord4f)(GLfloat, GLfloat, GLfloat, GLfloat);
+   void (GLAPIENTRY * TexCoord4fv)(const GLfloat *);
+   void (GLAPIENTRY * TexCoord4i)(GLint, GLint, GLint, GLint);
+   void (GLAPIENTRY * TexCoord4iv)(const GLint *);
+   void (GLAPIENTRY * TexCoord4s)(GLshort, GLshort, GLshort, GLshort);
+   void (GLAPIENTRY * TexCoord4sv)(const GLshort *);
+   void (GLAPIENTRY * Vertex2d)(GLdouble, GLdouble);
+   void (GLAPIENTRY * Vertex2dv)(const GLdouble *);
+   void (GLAPIENTRY * Vertex2f)(GLfloat, GLfloat);
+   void (GLAPIENTRY * Vertex2fv)(const GLfloat *);
+   void (GLAPIENTRY * Vertex2i)(GLint, GLint);
+   void (GLAPIENTRY * Vertex2iv)(const GLint *);
+   void (GLAPIENTRY * Vertex2s)(GLshort, GLshort);
+   void (GLAPIENTRY * Vertex2sv)(const GLshort *);
+   void (GLAPIENTRY * Vertex3d)(GLdouble, GLdouble, GLdouble);
+   void (GLAPIENTRY * Vertex3dv)(const GLdouble *);
+   void (GLAPIENTRY * Vertex3f)(GLfloat, GLfloat, GLfloat);
+   void (GLAPIENTRY * Vertex3fv)(const GLfloat *);
+   void (GLAPIENTRY * Vertex3i)(GLint, GLint, GLint);
+   void (GLAPIENTRY * Vertex3iv)(const GLint *);
+   void (GLAPIENTRY * Vertex3s)(GLshort, GLshort, GLshort);
+   void (GLAPIENTRY * Vertex3sv)(const GLshort *);
+   void (GLAPIENTRY * Vertex4d)(GLdouble, GLdouble, GLdouble, GLdouble);
+   void (GLAPIENTRY * Vertex4dv)(const GLdouble *);
+   void (GLAPIENTRY * Vertex4f)(GLfloat, GLfloat, GLfloat, GLfloat);
+   void (GLAPIENTRY * Vertex4fv)(const GLfloat *);
+   void (GLAPIENTRY * Vertex4i)(GLint, GLint, GLint, GLint);
+   void (GLAPIENTRY * Vertex4iv)(const GLint *);
+   void (GLAPIENTRY * Vertex4s)(GLshort, GLshort, GLshort, GLshort);
+   void (GLAPIENTRY * Vertex4sv)(const GLshort *);
+   void (GLAPIENTRY * ClipPlane)(GLenum, const GLdouble *);
+   void (GLAPIENTRY * ColorMaterial)(GLenum, GLenum);
+   void (GLAPIENTRY * CullFace)(GLenum);
+   void (GLAPIENTRY * Fogf)(GLenum, GLfloat);
+   void (GLAPIENTRY * Fogfv)(GLenum, const GLfloat *);
+   void (GLAPIENTRY * Fogi)(GLenum, GLint);
+   void (GLAPIENTRY * Fogiv)(GLenum, const GLint *);
+   void (GLAPIENTRY * FrontFace)(GLenum);
+   void (GLAPIENTRY * Hint)(GLenum, GLenum);
+   void (GLAPIENTRY * Lightf)(GLenum, GLenum, GLfloat);
+   void (GLAPIENTRY * Lightfv)(GLenum, GLenum, const GLfloat *);
+   void (GLAPIENTRY * Lighti)(GLenum, GLenum, GLint);
+   void (GLAPIENTRY * Lightiv)(GLenum, GLenum, const GLint *);
+   void (GLAPIENTRY * LightModelf)(GLenum, GLfloat);
+   void (GLAPIENTRY * LightModelfv)(GLenum, const GLfloat *);
+   void (GLAPIENTRY * LightModeli)(GLenum, GLint);
+   void (GLAPIENTRY * LightModeliv)(GLenum, const GLint *);
+   void (GLAPIENTRY * LineStipple)(GLint, GLushort);
+   void (GLAPIENTRY * LineWidth)(GLfloat);
+   void (GLAPIENTRY * Materialf)(GLenum, GLenum, GLfloat);
+   void (GLAPIENTRY * Materialfv)(GLenum, GLenum, const GLfloat *);
+   void (GLAPIENTRY * Materiali)(GLenum, GLenum, GLint);
+   void (GLAPIENTRY * Materialiv)(GLenum, GLenum, const GLint *);
+   void (GLAPIENTRY * PointSize)(GLfloat);
+   void (GLAPIENTRY * PolygonMode)(GLenum, GLenum);
+   void (GLAPIENTRY * PolygonStipple)(const GLubyte *);
+   void (GLAPIENTRY * Scissor)(GLint, GLint, GLsizei, GLsizei);
+   void (GLAPIENTRY * ShadeModel)(GLenum);
+   void (GLAPIENTRY * TexParameterf)(GLenum, GLenum, GLfloat);
+   void (GLAPIENTRY * TexParameterfv)(GLenum, GLenum, const GLfloat *);
+   void (GLAPIENTRY * TexParameteri)(GLenum, GLenum, GLint);
+   void (GLAPIENTRY * TexParameteriv)(GLenum, GLenum, const GLint *);
+   void (GLAPIENTRY * TexImage1D)(GLenum, GLint, GLint, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+   void (GLAPIENTRY * TexImage2D)(GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+   void (GLAPIENTRY * TexEnvf)(GLenum, GLenum, GLfloat);
+   void (GLAPIENTRY * TexEnvfv)(GLenum, GLenum, const GLfloat *);
+   void (GLAPIENTRY * TexEnvi)(GLenum, GLenum, GLint);
+   void (GLAPIENTRY * TexEnviv)(GLenum, GLenum, const GLint *);
+   void (GLAPIENTRY * TexGend)(GLenum, GLenum, GLdouble);
+   void (GLAPIENTRY * TexGendv)(GLenum, GLenum, const GLdouble *);
+   void (GLAPIENTRY * TexGenf)(GLenum, GLenum, GLfloat);
+   void (GLAPIENTRY * TexGenfv)(GLenum, GLenum, const GLfloat *);
+   void (GLAPIENTRY * TexGeni)(GLenum, GLenum, GLint);
+   void (GLAPIENTRY * TexGeniv)(GLenum, GLenum, const GLint *);
+   void (GLAPIENTRY * FeedbackBuffer)(GLsizei, GLenum, GLfloat *);
+   void (GLAPIENTRY * SelectBuffer)(GLsizei, GLuint *);
+   GLint (GLAPIENTRY * RenderMode)(GLenum);
+   void (GLAPIENTRY * InitNames)(void);
+   void (GLAPIENTRY * LoadName)(GLuint);
+   void (GLAPIENTRY * PassThrough)(GLfloat);
+   void (GLAPIENTRY * PopName)(void);
+   void (GLAPIENTRY * PushName)(GLuint);
+   void (GLAPIENTRY * DrawBuffer)(GLenum);
+   void (GLAPIENTRY * Clear)(GLbitfield);
+   void (GLAPIENTRY * ClearAccum)(GLfloat, GLfloat, GLfloat, GLfloat);
+   void (GLAPIENTRY * ClearIndex)(GLfloat);
+   void (GLAPIENTRY * ClearColor)(GLclampf, GLclampf, GLclampf, GLclampf);
+   void (GLAPIENTRY * ClearStencil)(GLint);
+   void (GLAPIENTRY * ClearDepth)(GLclampd);
+   void (GLAPIENTRY * StencilMask)(GLuint);
+   void (GLAPIENTRY * ColorMask)(GLboolean, GLboolean, GLboolean, GLboolean);
+   void (GLAPIENTRY * DepthMask)(GLboolean);
+   void (GLAPIENTRY * IndexMask)(GLuint);
+   void (GLAPIENTRY * Accum)(GLenum, GLfloat);
+   void (GLAPIENTRY * Disable)(GLenum);
+   void (GLAPIENTRY * Enable)(GLenum);
+   void (GLAPIENTRY * Finish)(void);
+   void (GLAPIENTRY * Flush)(void);
+   void (GLAPIENTRY * PopAttrib)(void);
+   void (GLAPIENTRY * PushAttrib)(GLbitfield);
+   void (GLAPIENTRY * Map1d)(GLenum, GLdouble, GLdouble, GLint, GLint, const GLdouble *);
+   void (GLAPIENTRY * Map1f)(GLenum, GLfloat, GLfloat, GLint, GLint, const GLfloat *);
+   void (GLAPIENTRY * Map2d)(GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *);
+   void (GLAPIENTRY * Map2f)(GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *);
+   void (GLAPIENTRY * MapGrid1d)(GLint, GLdouble, GLdouble);
+   void (GLAPIENTRY * MapGrid1f)(GLint, GLfloat, GLfloat);
+   void (GLAPIENTRY * MapGrid2d)(GLint, GLdouble, GLdouble, GLint, GLdouble, GLdouble);
+   void (GLAPIENTRY * MapGrid2f)(GLint, GLfloat, GLfloat, GLint, GLfloat, GLfloat);
+   void (GLAPIENTRY * EvalCoord1d)(GLdouble);
+   void (GLAPIENTRY * EvalCoord1dv)(const GLdouble *);
+   void (GLAPIENTRY * EvalCoord1f)(GLfloat);
+   void (GLAPIENTRY * EvalCoord1fv)(const GLfloat *);
+   void (GLAPIENTRY * EvalCoord2d)(GLdouble, GLdouble);
+   void (GLAPIENTRY * EvalCoord2dv)(const GLdouble *);
+   void (GLAPIENTRY * EvalCoord2f)(GLfloat, GLfloat);
+   void (GLAPIENTRY * EvalCoord2fv)(const GLfloat *);
+   void (GLAPIENTRY * EvalMesh1)(GLenum, GLint, GLint);
+   void (GLAPIENTRY * EvalPoint1)(GLint);
+   void (GLAPIENTRY * EvalMesh2)(GLenum, GLint, GLint, GLint, GLint);
+   void (GLAPIENTRY * EvalPoint2)(GLint, GLint);
+   void (GLAPIENTRY * AlphaFunc)(GLenum, GLclampf);
+   void (GLAPIENTRY * BlendFunc)(GLenum, GLenum);
+   void (GLAPIENTRY * LogicOp)(GLenum);
+   void (GLAPIENTRY * StencilFunc)(GLenum, GLint, GLuint);
+   void (GLAPIENTRY * StencilOp)(GLenum, GLenum, GLenum);
+   void (GLAPIENTRY * DepthFunc)(GLenum);
+   void (GLAPIENTRY * PixelZoom)(GLfloat, GLfloat);
+   void (GLAPIENTRY * PixelTransferf)(GLenum, GLfloat);
+   void (GLAPIENTRY * PixelTransferi)(GLenum, GLint);
+   void (GLAPIENTRY * PixelStoref)(GLenum, GLfloat);
+   void (GLAPIENTRY * PixelStorei)(GLenum, GLint);
+   void (GLAPIENTRY * PixelMapfv)(GLenum, GLint, const GLfloat *);
+   void (GLAPIENTRY * PixelMapuiv)(GLenum, GLint, const GLuint *);
+   void (GLAPIENTRY * PixelMapusv)(GLenum, GLint, const GLushort *);
+   void (GLAPIENTRY * ReadBuffer)(GLenum);
+   void (GLAPIENTRY * CopyPixels)(GLint, GLint, GLsizei, GLsizei, GLenum);
+   void (GLAPIENTRY * ReadPixels)(GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLvoid *);
+   void (GLAPIENTRY * DrawPixels)(GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+   void (GLAPIENTRY * GetBooleanv)(GLenum, GLboolean *);
+   void (GLAPIENTRY * GetClipPlane)(GLenum, GLdouble *);
+   void (GLAPIENTRY * GetDoublev)(GLenum, GLdouble *);
+   GLenum (GLAPIENTRY * GetError)(void);
+   void (GLAPIENTRY * GetFloatv)(GLenum, GLfloat *);
+   void (GLAPIENTRY * GetIntegerv)(GLenum, GLint *);
+   void (GLAPIENTRY * GetLightfv)(GLenum, GLenum, GLfloat *);
+   void (GLAPIENTRY * GetLightiv)(GLenum, GLenum, GLint *);
+   void (GLAPIENTRY * GetMapdv)(GLenum, GLenum, GLdouble *);
+   void (GLAPIENTRY * GetMapfv)(GLenum, GLenum, GLfloat *);
+   void (GLAPIENTRY * GetMapiv)(GLenum, GLenum, GLint *);
+   void (GLAPIENTRY * GetMaterialfv)(GLenum, GLenum, GLfloat *);
+   void (GLAPIENTRY * GetMaterialiv)(GLenum, GLenum, GLint *);
+   void (GLAPIENTRY * GetPixelMapfv)(GLenum, GLfloat *);
+   void (GLAPIENTRY * GetPixelMapuiv)(GLenum, GLuint *);
+   void (GLAPIENTRY * GetPixelMapusv)(GLenum, GLushort *);
+   void (GLAPIENTRY * GetPolygonStipple)(GLubyte *);
+   const GLubyte * (GLAPIENTRY * GetString)(GLenum);
+   void (GLAPIENTRY * GetTexEnvfv)(GLenum, GLenum, GLfloat *);
+   void (GLAPIENTRY * GetTexEnviv)(GLenum, GLenum, GLint *);
+   void (GLAPIENTRY * GetTexGendv)(GLenum, GLenum, GLdouble *);
+   void (GLAPIENTRY * GetTexGenfv)(GLenum, GLenum, GLfloat *);
+   void (GLAPIENTRY * GetTexGeniv)(GLenum, GLenum, GLint *);
+   void (GLAPIENTRY * GetTexImage)(GLenum, GLint, GLenum, GLenum, GLvoid *);
+   void (GLAPIENTRY * GetTexParameterfv)(GLenum, GLenum, GLfloat *);
+   void (GLAPIENTRY * GetTexParameteriv)(GLenum, GLenum, GLint *);
+   void (GLAPIENTRY * GetTexLevelParameterfv)(GLenum, GLint, GLenum, GLfloat *);
+   void (GLAPIENTRY * GetTexLevelParameteriv)(GLenum, GLint, GLenum, GLint *);
+   GLboolean (GLAPIENTRY * IsEnabled)(GLenum);
+   GLboolean (GLAPIENTRY * IsList)(GLuint);
+   void (GLAPIENTRY * DepthRange)(GLclampd, GLclampd);
+   void (GLAPIENTRY * Frustum)(GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble);
+   void (GLAPIENTRY * LoadIdentity)(void);
+   void (GLAPIENTRY * LoadMatrixf)(const GLfloat *);
+   void (GLAPIENTRY * LoadMatrixd)(const GLdouble *);
+   void (GLAPIENTRY * MatrixMode)(GLenum);
+   void (GLAPIENTRY * MultMatrixf)(const GLfloat *);
+   void (GLAPIENTRY * MultMatrixd)(const GLdouble *);
+   void (GLAPIENTRY * Ortho)(GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble);
+   void (GLAPIENTRY * PopMatrix)(void);
+   void (GLAPIENTRY * PushMatrix)(void);
+   void (GLAPIENTRY * Rotated)(GLdouble, GLdouble, GLdouble, GLdouble);
+   void (GLAPIENTRY * Rotatef)(GLfloat, GLfloat, GLfloat, GLfloat);
+   void (GLAPIENTRY * Scaled)(GLdouble, GLdouble, GLdouble);
+   void (GLAPIENTRY * Scalef)(GLfloat, GLfloat, GLfloat);
+   void (GLAPIENTRY * Translated)(GLdouble, GLdouble, GLdouble);
+   void (GLAPIENTRY * Translatef)(GLfloat, GLfloat, GLfloat);
+   void (GLAPIENTRY * Viewport)(GLint, GLint, GLsizei, GLsizei);
+   void (GLAPIENTRY * ArrayElement)(GLint);
+   void (GLAPIENTRY * BindTexture)(GLenum, GLuint);
+   void (GLAPIENTRY * ColorPointer)(GLint, GLenum, GLsizei, const GLvoid *);
+   void (GLAPIENTRY * DisableClientState)(GLenum);
+   void (GLAPIENTRY * DrawArrays)(GLenum, GLint, GLsizei);
+   void (GLAPIENTRY * DrawElements)(GLenum, GLsizei, GLenum, const GLvoid *);
+   void (GLAPIENTRY * EdgeFlagPointer)(GLsizei, const GLvoid *);
+   void (GLAPIENTRY * EnableClientState)(GLenum);
+   void (GLAPIENTRY * IndexPointer)(GLenum, GLsizei, const GLvoid *);
+   void (GLAPIENTRY * Indexub)(GLubyte);
+   void (GLAPIENTRY * Indexubv)(const GLubyte *);
+   void (GLAPIENTRY * InterleavedArrays)(GLenum, GLsizei, const GLvoid *);
+   void (GLAPIENTRY * NormalPointer)(GLenum, GLsizei, const GLvoid *);
+   void (GLAPIENTRY * PolygonOffset)(GLfloat, GLfloat);
+   void (GLAPIENTRY * TexCoordPointer)(GLint, GLenum, GLsizei, const GLvoid *);
+   void (GLAPIENTRY * VertexPointer)(GLint, GLenum, GLsizei, const GLvoid *);
+   GLboolean (GLAPIENTRY * AreTexturesResident)(GLsizei, const GLuint *, GLboolean *);
+   void (GLAPIENTRY * CopyTexImage1D)(GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint);
+   void (GLAPIENTRY * CopyTexImage2D)(GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint);
+   void (GLAPIENTRY * CopyTexSubImage1D)(GLenum, GLint, GLint, GLint, GLint, GLsizei);
+   void (GLAPIENTRY * CopyTexSubImage2D)(GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
+   void (GLAPIENTRY * DeleteTextures)(GLsizei, const GLuint *);
+   void (GLAPIENTRY * GenTextures)(GLsizei, GLuint *);
+   void (GLAPIENTRY * GetPointerv)(GLenum, GLvoid **);
+   GLboolean (GLAPIENTRY * IsTexture)(GLuint);
+   void (GLAPIENTRY * PrioritizeTextures)(GLsizei, const GLuint *, const GLclampf *);
+   void (GLAPIENTRY * TexSubImage1D)(GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *);
+   void (GLAPIENTRY * TexSubImage2D)(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+   void (GLAPIENTRY * PopClientAttrib)(void);
+   void (GLAPIENTRY * PushClientAttrib)(GLbitfield);
+};
+
+typedef struct __GLdispatchTableRec GLDISPATCHTABLE;
+
+typedef struct _GLCLTPROCTABLE
+{
+   int cEntries;
+   GLDISPATCHTABLE glDispatchTable;
+} GLCLTPROCTABLE, * PGLCLTPROCTABLE;
+
+typedef VOID (APIENTRY * PFN_SETPROCTABLE)(const GLCLTPROCTABLE*);
+
+/* Those functions are there in case GL calls are made without a context */
+extern const GLCLTPROCTABLE StubTable;
+
+/* This doesn't seem to be anywhere in ddk or psdk */
+DECLARE_HANDLE(DHGLRC);
+
+struct ICD_Data
+{
+    /* The Name returned with OPENGL_GETINFO escape code */
+    WCHAR DriverName[256];
+    /* The DLL handle */
+    HMODULE hModule;
+    
+    /* The ICD DLL exports */
+    BOOL      (WINAPI *DrvCopyContext)( DHGLRC, DHGLRC, UINT );
+    DHGLRC    (WINAPI *DrvCreateContext)( HDC );
+    DHGLRC    (WINAPI *DrvCreateLayerContext)( HDC, int );
+    BOOL      (WINAPI *DrvDeleteContext)( DHGLRC );
+    BOOL      (WINAPI *DrvDescribeLayerPlane)( HDC, int, int, UINT, LPLAYERPLANEDESCRIPTOR );
+    int       (WINAPI *DrvDescribePixelFormat)( IN HDC, IN int, IN UINT, OUT LPPIXELFORMATDESCRIPTOR );
+    int       (WINAPI *DrvGetLayerPaletteEntries)( HDC, int, int, int, COLORREF * );
+    PROC      (WINAPI *DrvGetProcAddress)( LPCSTR lpProcName );
+    void      (WINAPI *DrvReleaseContext)( DHGLRC hglrc ); /* maybe returns BOOL? */
+    BOOL      (WINAPI *DrvRealizeLayerPalette)( HDC, int, BOOL );
+    const GLCLTPROCTABLE* (WINAPI *DrvSetContext)( HDC hdc, DHGLRC hglrc, PFN_SETPROCTABLE callback );
+    int       (WINAPI *DrvSetLayerPaletteEntries)( HDC, int, int, int, CONST COLORREF * );
+    BOOL      (WINAPI *DrvSetPixelFormat)( IN HDC, IN int);
+    BOOL      (WINAPI *DrvShareLists)( DHGLRC, DHGLRC );
+    BOOL      (WINAPI *DrvSwapBuffers)( HDC );
+    BOOL      (WINAPI *DrvSwapLayerBuffers)( HDC, UINT );
+    
+    /* Make this a linked list */
+    struct ICD_Data* next;
+};
+
+struct ICD_Data* IntGetIcdData(HDC hdc);
+    
diff --git a/reactos/dll/opengl/opengl32_new/icdload.c b/reactos/dll/opengl/opengl32_new/icdload.c
new file mode 100644 (file)
index 0000000..00a15d4
--- /dev/null
@@ -0,0 +1,241 @@
+/*
+ * COPYRIGHT:            See COPYING in the top level directory
+ * PROJECT:              ReactOS kernel
+ * FILE:                 lib/opengl32/icdload.c
+ * PURPOSE:              OpenGL32 lib, ICD dll loader
+ */
+
+#include "opengl32.h"
+#include <winreg.h>
+
+#include <wine/debug.h>
+WINE_DEFAULT_DEBUG_CHANNEL(opengl32);
+
+struct Drv_Opengl_Info
+{
+    DWORD Version;          /*!< Driver interface version */
+    DWORD DriverVersion;    /*!< Driver version */
+    WCHAR DriverName[256];  /*!< Driver name */
+};
+
+static CRITICAL_SECTION icdload_cs = {NULL, -1, 0, 0, 0, 0};
+static struct ICD_Data* ICD_Data_List = NULL;
+static const WCHAR OpenGLDrivers_Key[] = L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\OpenGLDrivers";
+
+/* Retrieves the ICD data (driver version + relevant DLL entry points) for a device context */
+struct ICD_Data* IntGetIcdData(HDC hdc)
+{
+    int ret;
+    DWORD dwInput, dwValueType, Version, DriverVersion, Flags;
+    struct Drv_Opengl_Info DrvInfo;
+    struct ICD_Data* data;
+    HKEY OglKey, DrvKey;
+    WCHAR DllName[MAX_PATH];
+    BOOL (WINAPI *DrvValidateVersion)(DWORD);
+    
+    /* First, see if the driver supports this */
+    dwInput = OPENGL_GETINFO;
+    ret = ExtEscape(hdc,
+        QUERYESCSUPPORT,
+        sizeof(DWORD),
+        (LPCSTR)&dwInput,
+        0,
+        NULL);
+    
+    if(ret <= 0)
+    {
+        /* Driver doesn't support opengl */
+        return NULL;
+    }
+    
+    /* Query for the ICD DLL name and version */
+    dwInput = 0;
+    ret = ExtEscape(hdc,
+        OPENGL_GETINFO,
+        sizeof(DWORD),
+        (LPCSTR)&dwInput,
+        sizeof(DrvInfo),
+        (LPSTR)&DrvInfo);
+    
+    if(ret <= 0)
+    {
+        ERR("Driver claims to support OPENGL_GETINFO escape code, but doesn't.\n");
+        return NULL;
+    }
+    
+    /* Protect the list while we are loading*/
+    EnterCriticalSection(&icdload_cs);
+    
+    /* Search for it in the list of already loaded modules */
+    data = ICD_Data_List;
+    while(data)
+    {
+        if(!_wcsicmp(data->DriverName, DrvInfo.DriverName))
+        {
+            /* Found it */
+            TRACE("Found already loaded %p.\n", data);
+            LeaveCriticalSection(&icdload_cs);
+            return data;
+        }
+        data = data->next;
+    }
+    
+    /* It was still not loaded, look for it in the registry */
+    ret = RegOpenKeyExW(HKEY_LOCAL_MACHINE, OpenGLDrivers_Key, 0, KEY_READ, &OglKey);
+    if(ret != ERROR_SUCCESS)
+    {
+        ERR("Failed to open the OpenGLDrivers key.\n");
+        goto end;
+    }
+    ret = RegOpenKeyExW(OglKey, DrvInfo.DriverName, 0, KEY_READ, &DrvKey);
+    if(ret != ERROR_SUCCESS)
+    {
+        /* Some driver installer just provide the DLL name, like the Matrox G400 */
+        TRACE("No driver subkey for %S, trying to get DLL name directly.\n", DrvInfo.DriverName);
+        dwInput = sizeof(DllName);
+        ret = RegQueryValueExW(OglKey, DrvInfo.DriverName, 0, &dwValueType, (LPBYTE)DllName, &dwInput);
+        if((ret != ERROR_SUCCESS) || (dwValueType != REG_SZ))
+        {
+            ERR("Unable to get ICD DLL name!.\n");
+            RegCloseKey(OglKey);
+            goto end;
+        }
+        Version = DriverVersion = Flags = 0;
+        TRACE("DLL name is %S.\n", DllName);
+    }
+    else
+    {
+        /* The driver have a subkey for the ICD */
+        TRACE("Querying details from registry for %S.\n", DrvInfo.DriverName);
+        dwInput = sizeof(DllName);
+        ret = RegQueryValueExW(DrvKey, L"Dll", 0, &dwValueType, (LPBYTE)DllName, &dwInput);
+        if((ret != ERROR_SUCCESS) || (dwValueType != REG_SZ))
+        {
+            ERR("Unable to get ICD DLL name!.\n");
+            RegCloseKey(DrvKey);
+            RegCloseKey(OglKey);
+            goto end;
+        }
+        
+        dwInput = sizeof(Version);
+        ret = RegQueryValueExW(DrvKey, L"Version", 0, &dwValueType, (LPBYTE)&Version, &dwInput);
+        if((ret != ERROR_SUCCESS) || (dwValueType != REG_DWORD))
+        {
+            WARN("No version in driver subkey\n");
+        }
+        else if(Version != DrvInfo.Version)
+        {
+            ERR("Version mismatch between registry (%lu) and display driver (%lu).\n", Version, DrvInfo.Version);
+            RegCloseKey(DrvKey);
+            RegCloseKey(OglKey);
+            goto end;
+        }
+        
+        dwInput = sizeof(DriverVersion);
+        ret = RegQueryValueExW(DrvKey, L"DriverVersion", 0, &dwValueType, (LPBYTE)&DriverVersion, &dwInput);
+        if((ret != ERROR_SUCCESS) || (dwValueType != REG_DWORD))
+        {
+            WARN("No driver version in driver subkey\n");
+        }
+        else if(DriverVersion != DrvInfo.DriverVersion)
+        {
+            ERR("Driver version mismatch between registry (%lu) and display driver (%lu).\n", DriverVersion, DrvInfo.DriverVersion);
+            RegCloseKey(DrvKey);
+            RegCloseKey(OglKey);
+            goto end;
+        }
+        
+        dwInput = sizeof(Flags);
+        ret = RegQueryValueExW(DrvKey, L"Flags", 0, &dwValueType, (LPBYTE)&Flags, &dwInput);
+        if((ret != ERROR_SUCCESS) || (dwValueType != REG_DWORD))
+        {
+            WARN("No driver version in driver subkey\n");
+            Flags = 0;
+        }
+        
+        /* We're done */
+        RegCloseKey(DrvKey);
+        TRACE("DLL name is %S, Version %lx, DriverVersion %lx, Flags %lx.\n", DllName, Version, DriverVersion, Flags);
+    }
+    /* No need for this anymore */
+    RegCloseKey(OglKey);
+    
+    /* So far so good, allocate data */
+    data = HeapAlloc(GetProcessHeap(), 0, sizeof(*data));
+    if(!data)
+    {
+        ERR("Unable to allocate ICD data!\n");
+        goto end;
+    }
+    
+    /* Load the library */
+    data->hModule = LoadLibraryW(DllName);
+    if(!data->hModule)
+    {
+        ERR("Could not load the ICD DLL: %S.\n", DllName);
+        HeapFree(GetProcessHeap(), 0, data);
+        data = NULL;
+        goto end;
+    }
+    
+    /* 
+     * Validate version, if needed.
+     * Some drivers (at least VBOX), initialize stuff upon this call.
+     */
+    DrvValidateVersion = (void*)GetProcAddress(data->hModule, "DrvValidateVersion");
+    if(DrvValidateVersion)
+    {
+        if(!DrvValidateVersion(DrvInfo.DriverVersion))
+        {
+            ERR("DrvValidateVersion failed!.\n");
+            goto fail;
+        }
+    }
+    
+    /* Get the DLL exports */
+#define DRV_LOAD(x) do                                  \
+{                                                       \
+    data->x = (void*)GetProcAddress(data->hModule, #x); \
+    if(!data->x) {                                      \
+        ERR("%S lacks " #x "!\n", DllName);             \
+        goto fail;                                      \
+    }                                                   \
+} while(0)
+    DRV_LOAD(DrvCopyContext);
+    DRV_LOAD(DrvCreateContext);
+    DRV_LOAD(DrvCreateLayerContext);
+    DRV_LOAD(DrvDeleteContext);
+    DRV_LOAD(DrvDescribeLayerPlane);
+    DRV_LOAD(DrvDescribePixelFormat);
+    DRV_LOAD(DrvGetLayerPaletteEntries);
+    DRV_LOAD(DrvGetProcAddress);
+    DRV_LOAD(DrvReleaseContext);
+    DRV_LOAD(DrvRealizeLayerPalette);
+    DRV_LOAD(DrvSetContext);
+    DRV_LOAD(DrvSetLayerPaletteEntries);
+    DRV_LOAD(DrvSetPixelFormat);
+    DRV_LOAD(DrvShareLists);
+    DRV_LOAD(DrvSwapBuffers);
+    DRV_LOAD(DrvSwapLayerBuffers);
+#undef DRV_LOAD
+    
+    /* Copy the DriverName */
+    wcscpy(data->DriverName, DrvInfo.DriverName);
+    
+    /* Push the list */
+    data->next = ICD_Data_List;
+    ICD_Data_List = data;
+    
+    TRACE("Returning %p.\n", data);
+    
+end:
+    /* Unlock and return */
+    LeaveCriticalSection(&icdload_cs);
+    return data;
+
+fail:
+    LeaveCriticalSection(&icdload_cs);
+    FreeLibrary(data->hModule);
+    HeapFree(GetProcessHeap(), 0, data);
+    return NULL;
+}
\ No newline at end of file
diff --git a/reactos/dll/opengl/opengl32_new/opengl32.h b/reactos/dll/opengl/opengl32_new/opengl32.h
new file mode 100644 (file)
index 0000000..a603d8d
--- /dev/null
@@ -0,0 +1,130 @@
+/*
+ * COPYRIGHT:            See COPYING in the top level directory
+ * PROJECT:              ReactOS kernel
+ * FILE:                 lib/opengl32/opengl.h
+ * PURPOSE:              OpenGL32 lib, general header
+ */
+
+#pragma once
+
+#define WIN32_NO_STATUS
+#include <stdarg.h>
+#include <windef.h>
+#include <winbase.h>
+#include <winuser.h>
+#include <wingdi.h>
+#include <winddi.h>
+#include <GL/gl.h>
+
+#include "icd.h"
+
+struct wgl_context
+{
+    DWORD magic;
+    volatile LONG lock;
+    
+    DHGLRC dhglrc;
+    struct ICD_Data* icd_data;
+    INT pixelformat;
+    volatile LONG thread_id;
+};
+
+#define WGL_DC_OBJ_DC 0x1
+struct wgl_dc_data
+{
+    /* Header */
+    union
+    {
+        HWND hwnd;
+        HDC hdc;
+        HANDLE u;
+    } owner;
+    ULONG flags;
+    
+    /* Pixel format */
+    INT pixelformat;
+    
+    /* ICD */
+    struct ICD_Data* icd_data;
+    INT nb_icd_formats;
+    
+    /* Software implementation */
+    INT nb_sw_formats;
+    void* sw_data;
+    
+    /* Linked list */
+    struct wgl_dc_data* next;
+};
+
+#ifdef OPENGL32_USE_TLS
+extern DWORD OglTlsIndex;
+
+struct Opengl32_ThreadData
+{
+    const GLCLTPROCTABLE* ProcTable;
+    HGLRC hglrc;
+    HDC hdc;
+    struct wgl_dc_data* dc_data;
+};
+
+static inline
+HGLRC
+IntGetCurrentRC(void)
+{
+    struct Opengl32_ThreadData* data = TlsGetValue(OglTlsIndex);
+    return data->hglrc;
+}
+
+static inline
+DHGLRC
+IntGetCurrentDHGLRC(void)
+{
+    struct wgl_context* ctx = (struct wgl_context*)IntGetCurrentRC();
+    if(!ctx) return NULL;
+    return ctx->dhglrc;
+}
+
+static inline
+HDC
+IntGetCurrentDC(void)
+{
+    struct Opengl32_ThreadData* data = TlsGetValue(OglTlsIndex);
+    return data->hdc;
+}
+
+static inline
+struct wgl_dc_data*
+IntGetCurrentDcData(void)
+{
+    struct Opengl32_ThreadData* data = TlsGetValue(OglTlsIndex);
+    return data->dc_data;
+}
+
+static inline
+const GLDISPATCHTABLE *
+IntGetCurrentDispatchTable(void)
+{
+    struct Opengl32_ThreadData* data = TlsGetValue(OglTlsIndex);
+    return &data->ProcTable->glDispatchTable;
+}
+
+#else
+static inline
+const GLDISPATCHTABLE*
+IntGetCurrentDispatchTable(void)
+{
+    return (GLDISPATCHTABLE*)NtCurrentTeb()->glTable;
+}
+#endif // defined(OPENGL32_USE_TLS)
+
+/* Software implementation functions */
+INT sw_DescribePixelFormat(HDC hdc, INT format, UINT size, PIXELFORMATDESCRIPTOR* descr);
+BOOL sw_SetPixelFormat(struct wgl_dc_data*, INT format);
+DHGLRC sw_CreateContext(struct wgl_dc_data*);
+BOOL sw_DeleteContext(DHGLRC dhglrc);
+const GLCLTPROCTABLE* sw_SetContext(struct wgl_dc_data* dc_data, DHGLRC dhglrc);
+void sw_ReleaseContext(DHGLRC hglrc);
+PROC sw_GetProcAddress(LPCSTR name);
+BOOL sw_CopyContext(DHGLRC dhglrcSrc, DHGLRC dhglrcDst, UINT mask);
+BOOL sw_ShareLists(DHGLRC dhglrcSrc, DHGLRC dhglrcDst);
+BOOL sw_SwapBuffers(HDC hdc, struct wgl_dc_data* dc_data);
diff --git a/reactos/dll/opengl/opengl32_new/opengl32.spec b/reactos/dll/opengl/opengl32_new/opengl32.spec
new file mode 100644 (file)
index 0000000..8e393c9
--- /dev/null
@@ -0,0 +1,369 @@
+@ stub GlmfBeginGlsBlock
+@ stub GlmfCloseMetaFile
+@ stub GlmfEndGlsBlock
+@ stub GlmfEndPlayback
+@ stub GlmfInitPlayback
+@ stub GlmfPlayGlsRecord
+@ stdcall glAccum( long long )
+@ stdcall glAlphaFunc( long long )
+@ stdcall glAreTexturesResident( long ptr ptr )
+@ stdcall glArrayElement( long ) 
+@ stdcall glBegin( long ) 
+@ stdcall glBindTexture( long long ) 
+@ stdcall glBitmap( long long long long long long ptr ) 
+@ stdcall glBlendFunc( long long ) 
+@ stdcall glCallList( long ) 
+@ stdcall glCallLists( long long ptr ) 
+@ stdcall glClear( long ) 
+@ stdcall glClearAccum( long long long long ) 
+@ stdcall glClearColor( long long long long ) 
+@ stdcall glClearDepth( double ) 
+@ stdcall glClearIndex( long ) 
+@ stdcall glClearStencil( long ) 
+@ stdcall glClipPlane( long ptr ) 
+@ stdcall glColor3b( long long long ) 
+@ stdcall glColor3bv( ptr ) 
+@ stdcall glColor3d( double double double ) 
+@ stdcall glColor3dv( ptr ) 
+@ stdcall glColor3f( long long long ) 
+@ stdcall glColor3fv( ptr ) 
+@ stdcall glColor3i( long long long ) 
+@ stdcall glColor3iv( ptr ) 
+@ stdcall glColor3s( long long long ) 
+@ stdcall glColor3sv( ptr ) 
+@ stdcall glColor3ub( long long long ) 
+@ stdcall glColor3ubv( ptr ) 
+@ stdcall glColor3ui( long long long ) 
+@ stdcall glColor3uiv( ptr ) 
+@ stdcall glColor3us( long long long ) 
+@ stdcall glColor3usv( ptr ) 
+@ stdcall glColor4b( long long long long ) 
+@ stdcall glColor4bv( ptr ) 
+@ stdcall glColor4d( double double double double ) 
+@ stdcall glColor4dv( ptr ) 
+@ stdcall glColor4f( long long long long ) 
+@ stdcall glColor4fv( ptr ) 
+@ stdcall glColor4i( long long long long ) 
+@ stdcall glColor4iv( ptr ) 
+@ stdcall glColor4s( long long long long ) 
+@ stdcall glColor4sv( ptr ) 
+@ stdcall glColor4ub( long long long long ) 
+@ stdcall glColor4ubv( ptr ) 
+@ stdcall glColor4ui( long long long long ) 
+@ stdcall glColor4uiv( ptr ) 
+@ stdcall glColor4us( long long long long ) 
+@ stdcall glColor4usv( ptr ) 
+@ stdcall glColorMask( long long long long ) 
+@ stdcall glColorMaterial( long long ) 
+@ stdcall glColorPointer( long long long ptr ) 
+@ stdcall glCopyPixels( long long long long long ) 
+@ stdcall glCopyTexImage1D( long long long long long long long ) 
+@ stdcall glCopyTexImage2D( long long long long long long long long ) 
+@ stdcall glCopyTexSubImage1D( long long long long long long ) 
+@ stdcall glCopyTexSubImage2D( long long long long long long long long ) 
+@ stdcall glCullFace( long )
+@ stdcall glDebugEntry(long long)
+@ stdcall glDeleteLists( long long ) 
+@ stdcall glDeleteTextures( long ptr ) 
+@ stdcall glDepthFunc( long ) 
+@ stdcall glDepthMask( long ) 
+@ stdcall glDepthRange( double double ) 
+@ stdcall glDisable( long ) 
+@ stdcall glDisableClientState( long ) 
+@ stdcall glDrawArrays( long long long ) 
+@ stdcall glDrawBuffer( long ) 
+@ stdcall glDrawElements( long long long ptr ) 
+@ stdcall glDrawPixels( long long long long ptr ) 
+@ stdcall glEdgeFlag( long ) 
+@ stdcall glEdgeFlagPointer( long ptr ) 
+@ stdcall glEdgeFlagv( ptr ) 
+@ stdcall glEnable( long ) 
+@ stdcall glEnableClientState( long ) 
+@ stdcall glEnd( ) 
+@ stdcall glEndList( ) 
+@ stdcall glEvalCoord1d( double ) 
+@ stdcall glEvalCoord1dv( ptr ) 
+@ stdcall glEvalCoord1f( long ) 
+@ stdcall glEvalCoord1fv( ptr ) 
+@ stdcall glEvalCoord2d( double double )
+@ stdcall glEvalCoord2dv( ptr ) 
+@ stdcall glEvalCoord2f( long long ) 
+@ stdcall glEvalCoord2fv( ptr ) 
+@ stdcall glEvalMesh1( long long long ) 
+@ stdcall glEvalMesh2( long long long long long ) 
+@ stdcall glEvalPoint1( long ) 
+@ stdcall glEvalPoint2( long long ) 
+@ stdcall glFeedbackBuffer( long long ptr ) 
+@ stdcall glFinish( ) 
+@ stdcall glFlush( ) 
+@ stdcall glFogf( long long ) 
+@ stdcall glFogfv( long ptr ) 
+@ stdcall glFogi( long long ) 
+@ stdcall glFogiv( long ptr ) 
+@ stdcall glFrontFace( long ) 
+@ stdcall glFrustum( double double double double double double ) 
+@ stdcall glGenLists( long ) 
+@ stdcall glGenTextures( long ptr ) 
+@ stdcall glGetBooleanv( long ptr ) 
+@ stdcall glGetClipPlane( long ptr )
+@ stdcall glGetDoublev( long ptr ) 
+@ stdcall glGetError( ) 
+@ stdcall glGetFloatv( long ptr )
+@ stdcall glGetIntegerv( long ptr ) 
+@ stdcall glGetLightfv( long long ptr ) 
+@ stdcall glGetLightiv( long long ptr ) 
+@ stdcall glGetMapdv( long long ptr ) 
+@ stdcall glGetMapfv( long long ptr ) 
+@ stdcall glGetMapiv( long long ptr ) 
+@ stdcall glGetMaterialfv( long long ptr ) 
+@ stdcall glGetMaterialiv( long long ptr )
+@ stdcall glGetPixelMapfv( long ptr ) 
+@ stdcall glGetPixelMapuiv( long ptr ) 
+@ stdcall glGetPixelMapusv( long ptr ) 
+@ stdcall glGetPointerv( long ptr ) 
+@ stdcall glGetPolygonStipple( ptr )
+@ stdcall glGetString( long ) 
+@ stdcall glGetTexEnvfv( long long ptr ) 
+@ stdcall glGetTexEnviv( long long ptr ) 
+@ stdcall glGetTexGendv( long long ptr ) 
+@ stdcall glGetTexGenfv( long long ptr ) 
+@ stdcall glGetTexGeniv( long long ptr ) 
+@ stdcall glGetTexImage( long long long long ptr ) 
+@ stdcall glGetTexLevelParameterfv( long long long ptr ) 
+@ stdcall glGetTexLevelParameteriv( long long long ptr ) 
+@ stdcall glGetTexParameterfv( long long ptr ) 
+@ stdcall glGetTexParameteriv( long long ptr ) 
+@ stdcall glHint( long long )
+@ stdcall glIndexMask( long ) 
+@ stdcall glIndexPointer( long long ptr ) 
+@ stdcall glIndexd( double ) 
+@ stdcall glIndexdv( ptr ) 
+@ stdcall glIndexf( long ) 
+@ stdcall glIndexfv( ptr ) 
+@ stdcall glIndexi( long ) 
+@ stdcall glIndexiv( ptr )
+@ stdcall glIndexs( long ) 
+@ stdcall glIndexsv( ptr ) 
+@ stdcall glIndexub( long ) 
+@ stdcall glIndexubv( ptr ) 
+@ stdcall glInitNames( ) 
+@ stdcall glInterleavedArrays( long long ptr ) 
+@ stdcall glIsEnabled( long ) 
+@ stdcall glIsList( long ) 
+@ stdcall glIsTexture( long ) 
+@ stdcall glLightModelf( long long ) 
+@ stdcall glLightModelfv( long ptr ) 
+@ stdcall glLightModeli( long long ) 
+@ stdcall glLightModeliv( long ptr ) 
+@ stdcall glLightf( long long long ) 
+@ stdcall glLightfv( long long ptr ) 
+@ stdcall glLighti( long long long ) 
+@ stdcall glLightiv( long long ptr ) 
+@ stdcall glLineStipple( long long ) 
+@ stdcall glLineWidth( long ) 
+@ stdcall glListBase( long ) 
+@ stdcall glLoadIdentity( ) 
+@ stdcall glLoadMatrixd( ptr ) 
+@ stdcall glLoadMatrixf( ptr ) 
+@ stdcall glLoadName( long ) 
+@ stdcall glLogicOp( long ) 
+@ stdcall glMap1d( long double double long long ptr ) 
+@ stdcall glMap1f( long long long long long ptr ) 
+@ stdcall glMap2d( long double double long long double double long long ptr ) 
+@ stdcall glMap2f( long long long long long long long long long ptr ) 
+@ stdcall glMapGrid1d( long double double ) 
+@ stdcall glMapGrid1f( long long long )
+@ stdcall glMapGrid2d( long double double long double double ) 
+@ stdcall glMapGrid2f( long long long long long long ) 
+@ stdcall glMaterialf( long long long ) 
+@ stdcall glMaterialfv( long long ptr ) 
+@ stdcall glMateriali( long long long ) 
+@ stdcall glMaterialiv( long long ptr ) 
+@ stdcall glMatrixMode( long )
+@ stdcall glMultMatrixd( ptr ) 
+@ stdcall glMultMatrixf( ptr ) 
+@ stdcall glNewList( long long ) 
+@ stdcall glNormal3b( long long long ) 
+@ stdcall glNormal3bv( ptr ) 
+@ stdcall glNormal3d( double double double ) 
+@ stdcall glNormal3dv( ptr ) 
+@ stdcall glNormal3f( long long long ) 
+@ stdcall glNormal3fv( ptr ) 
+@ stdcall glNormal3i( long long long ) 
+@ stdcall glNormal3iv( ptr )
+@ stdcall glNormal3s( long long long ) 
+@ stdcall glNormal3sv( ptr ) 
+@ stdcall glNormalPointer( long long ptr ) 
+@ stdcall glOrtho( double double double double double double ) 
+@ stdcall glPassThrough( long ) 
+@ stdcall glPixelMapfv( long long ptr ) 
+@ stdcall glPixelMapuiv( long long ptr ) 
+@ stdcall glPixelMapusv( long long ptr ) 
+@ stdcall glPixelStoref( long long ) 
+@ stdcall glPixelStorei( long long ) 
+@ stdcall glPixelTransferf( long long ) 
+@ stdcall glPixelTransferi( long long ) 
+@ stdcall glPixelZoom( long long ) 
+@ stdcall glPointSize( long ) 
+@ stdcall glPolygonMode( long long ) 
+@ stdcall glPolygonOffset( long long ) 
+@ stdcall glPolygonStipple( ptr ) 
+@ stdcall glPopAttrib( ) 
+@ stdcall glPopClientAttrib( ) 
+@ stdcall glPopMatrix( ) 
+@ stdcall glPopName( ) 
+@ stdcall glPrioritizeTextures( long ptr ptr ) 
+@ stdcall glPushAttrib( long ) 
+@ stdcall glPushClientAttrib( long ) 
+@ stdcall glPushMatrix( ) 
+@ stdcall glPushName( long ) 
+@ stdcall glRasterPos2d( double double ) 
+@ stdcall glRasterPos2dv( ptr ) 
+@ stdcall glRasterPos2f( long long ) 
+@ stdcall glRasterPos2fv( ptr ) 
+@ stdcall glRasterPos2i( long long ) 
+@ stdcall glRasterPos2iv( ptr ) 
+@ stdcall glRasterPos2s( long long ) 
+@ stdcall glRasterPos2sv( ptr ) 
+@ stdcall glRasterPos3d( double double double ) 
+@ stdcall glRasterPos3dv( ptr ) 
+@ stdcall glRasterPos3f( long long long ) 
+@ stdcall glRasterPos3fv( ptr ) 
+@ stdcall glRasterPos3i( long long long ) 
+@ stdcall glRasterPos3iv( ptr ) 
+@ stdcall glRasterPos3s( long long long ) 
+@ stdcall glRasterPos3sv( ptr ) 
+@ stdcall glRasterPos4d( double double double double ) 
+@ stdcall glRasterPos4dv( ptr ) 
+@ stdcall glRasterPos4f( long long long long ) 
+@ stdcall glRasterPos4fv( ptr ) 
+@ stdcall glRasterPos4i( long long long long ) 
+@ stdcall glRasterPos4iv( ptr ) 
+@ stdcall glRasterPos4s( long long long long ) 
+@ stdcall glRasterPos4sv( ptr ) 
+@ stdcall glReadBuffer( long ) 
+@ stdcall glReadPixels( long long long long long long ptr ) 
+@ stdcall glRectd( double double double double ) 
+@ stdcall glRectdv( ptr ptr ) 
+@ stdcall glRectf( long long long long ) 
+@ stdcall glRectfv( ptr ptr ) 
+@ stdcall glRecti( long long long long ) 
+@ stdcall glRectiv( ptr ptr ) 
+@ stdcall glRects( long long long long ) 
+@ stdcall glRectsv( ptr ptr ) 
+@ stdcall glRenderMode( long ) 
+@ stdcall glRotated( double double double double ) 
+@ stdcall glRotatef( long long long long ) 
+@ stdcall glScaled( double double double ) 
+@ stdcall glScalef( long long long ) 
+@ stdcall glScissor( long long long long ) 
+@ stdcall glSelectBuffer( long ptr ) 
+@ stdcall glShadeModel( long ) 
+@ stdcall glStencilFunc( long long long ) 
+@ stdcall glStencilMask( long ) 
+@ stdcall glStencilOp( long long long ) 
+@ stdcall glTexCoord1d( double ) 
+@ stdcall glTexCoord1dv( ptr ) 
+@ stdcall glTexCoord1f( long ) 
+@ stdcall glTexCoord1fv( ptr ) 
+@ stdcall glTexCoord1i( long ) 
+@ stdcall glTexCoord1iv( ptr ) 
+@ stdcall glTexCoord1s( long ) 
+@ stdcall glTexCoord1sv( ptr ) 
+@ stdcall glTexCoord2d( double double ) 
+@ stdcall glTexCoord2dv( ptr ) 
+@ stdcall glTexCoord2f( long long ) 
+@ stdcall glTexCoord2fv( ptr ) 
+@ stdcall glTexCoord2i( long long ) 
+@ stdcall glTexCoord2iv( ptr ) 
+@ stdcall glTexCoord2s( long long ) 
+@ stdcall glTexCoord2sv( ptr ) 
+@ stdcall glTexCoord3d( double double double ) 
+@ stdcall glTexCoord3dv( ptr ) 
+@ stdcall glTexCoord3f( long long long ) 
+@ stdcall glTexCoord3fv( ptr ) 
+@ stdcall glTexCoord3i( long long long ) 
+@ stdcall glTexCoord3iv( ptr ) 
+@ stdcall glTexCoord3s( long long long ) 
+@ stdcall glTexCoord3sv( ptr ) 
+@ stdcall glTexCoord4d( double double double double ) 
+@ stdcall glTexCoord4dv( ptr ) 
+@ stdcall glTexCoord4f( long long long long ) 
+@ stdcall glTexCoord4fv( ptr ) 
+@ stdcall glTexCoord4i( long long long long ) 
+@ stdcall glTexCoord4iv( ptr ) 
+@ stdcall glTexCoord4s( long long long long ) 
+@ stdcall glTexCoord4sv( ptr ) 
+@ stdcall glTexCoordPointer( long long long ptr ) 
+@ stdcall glTexEnvf( long long long ) 
+@ stdcall glTexEnvfv( long long ptr ) 
+@ stdcall glTexEnvi( long long long ) 
+@ stdcall glTexEnviv( long long ptr ) 
+@ stdcall glTexGend( long long double ) 
+@ stdcall glTexGendv( long long ptr ) 
+@ stdcall glTexGenf( long long long ) 
+@ stdcall glTexGenfv( long long ptr ) 
+@ stdcall glTexGeni( long long long ) 
+@ stdcall glTexGeniv( long long ptr ) 
+@ stdcall glTexImage1D( long long long long long long long ptr ) 
+@ stdcall glTexImage2D( long long long long long long long long ptr )
+@ stdcall glTexParameterf( long long long ) 
+@ stdcall glTexParameterfv( long long ptr ) 
+@ stdcall glTexParameteri( long long long ) 
+@ stdcall glTexParameteriv( long long ptr ) 
+@ stdcall glTexSubImage1D( long long long long long long ptr ) 
+@ stdcall glTexSubImage2D( long long long long long long long long ptr ) 
+@ stdcall glTranslated( double double double ) 
+@ stdcall glTranslatef( long long long ) 
+@ stdcall glVertex2d( double double ) 
+@ stdcall glVertex2dv( ptr ) 
+@ stdcall glVertex2f( long long ) 
+@ stdcall glVertex2fv( ptr ) 
+@ stdcall glVertex2i( long long ) 
+@ stdcall glVertex2iv( ptr ) 
+@ stdcall glVertex2s( long long ) 
+@ stdcall glVertex2sv( ptr ) 
+@ stdcall glVertex3d( double double double ) 
+@ stdcall glVertex3dv( ptr ) 
+@ stdcall glVertex3f( long long long ) 
+@ stdcall glVertex3fv( ptr ) 
+@ stdcall glVertex3i( long long long ) 
+@ stdcall glVertex3iv( ptr ) 
+@ stdcall glVertex3s( long long long ) 
+@ stdcall glVertex3sv( ptr ) 
+@ stdcall glVertex4d( double double double double ) 
+@ stdcall glVertex4dv( ptr ) 
+@ stdcall glVertex4f( long long long long ) 
+@ stdcall glVertex4fv( ptr ) 
+@ stdcall glVertex4i( long long long long ) 
+@ stdcall glVertex4iv( ptr ) 
+@ stdcall glVertex4s( long long long long ) 
+@ stdcall glVertex4sv( ptr ) 
+@ stdcall glVertexPointer( long long long ptr ) 
+@ stdcall glViewport( long long long long ) 
+
+@ stdcall wglChoosePixelFormat(long ptr)
+@ stdcall wglCopyContext(long long long)
+@ stdcall wglCreateContext(long)
+@ stdcall wglCreateLayerContext(long long)
+@ stdcall wglDeleteContext(long)
+@ stdcall wglDescribeLayerPlane(long long long long ptr)
+@ stdcall wglDescribePixelFormat(long long long ptr)
+@ stdcall wglGetCurrentContext()
+@ stdcall wglGetCurrentDC()
+@ stdcall wglGetDefaultProcAddress(str)
+@ stdcall wglGetLayerPaletteEntries(long long long long ptr)
+@ stdcall wglGetPixelFormat(long)
+@ stdcall wglGetProcAddress(str)
+@ stdcall wglMakeCurrent(long long)
+@ stdcall wglRealizeLayerPalette(long long long)
+@ stdcall wglSetLayerPaletteEntries(long long long long ptr)
+@ stdcall wglSetPixelFormat(long long ptr)
+@ stdcall wglShareLists(long long)
+@ stdcall wglSwapBuffers(long)
+@ stdcall wglSwapLayerBuffers(long long)
+@ stdcall wglSwapMultipleBuffers(long ptr)
+@ stdcall wglUseFontBitmapsA(long long long long)
+@ stdcall wglUseFontBitmapsW(long long long long)
+@ stdcall wglUseFontOutlinesA(long long long long long long long ptr)
+@ stdcall wglUseFontOutlinesW(long long long long long long long ptr)
diff --git a/reactos/dll/opengl/opengl32_new/swimpl.c b/reactos/dll/opengl/opengl32_new/swimpl.c
new file mode 100644 (file)
index 0000000..930ac9b
--- /dev/null
@@ -0,0 +1,577 @@
+/*
+ * COPYRIGHT:            See COPYING in the top level directory
+ * PROJECT:              ReactOS
+ * FILE:                 dll/opengl/opengl32/wgl.c
+ * PURPOSE:              OpenGL32 DLL, opengl software implementation
+ */
+
+#include "opengl32.h"
+#include <GL/osmesa.h>
+
+#include <assert.h>
+
+#include <wine/debug.h>
+WINE_DEFAULT_DEBUG_CHANNEL(opengl32);
+
+/* OSMesa stuff */
+static HMODULE hMesaDll = NULL;
+static OSMesaContext (GLAPIENTRY *pOSMesaCreateContextExt)(GLenum format, GLint depthBits, GLint stencilBits,
+                                                 GLint accumBits, OSMesaContext sharelist);
+static void (GLAPIENTRY *pOSMesaDestroyContext)(OSMesaContext ctx);
+static GLboolean (GLAPIENTRY *pOSMesaMakeCurrent)( OSMesaContext ctx, void *buffer, GLenum type,
+                                        GLsizei width, GLsizei height );
+static void (GLAPIENTRY *pOSMesaPixelStore)( GLint pname, GLint value );
+static OSMESAproc (GLAPIENTRY *pOSMesaGetProcAddress)(const char *funcName);
+
+struct sw_context
+{
+    OSMesaContext mesa_ctx;
+    HHOOK hook;
+    struct sw_framebuffer* framebuffer;
+};
+
+#define SW_FB_DOUBLEBUFFERED    0x1
+#define SW_FB_DIBSECTION        0x2
+#define SW_FB_FREE_BITS         0x4
+struct sw_framebuffer
+{
+    INT sw_format;
+    UINT format_index;
+    void* bits;
+    DWORD flags;
+    BITMAPINFO bmi;
+};
+
+/* For our special SB glFinish implementation */
+static void (GLAPIENTRY * pFinish)(void);
+
+/* Single buffered API table */
+static GLCLTPROCTABLE sw_table_sb;
+/* Double buffered API table */
+static GLCLTPROCTABLE sw_table_db;
+
+static const struct
+{
+    UINT mesa;
+    BYTE color_bits;
+    BYTE red_bits, red_shift;
+    BYTE green_bits, green_shift;
+    BYTE blue_bits, blue_shift;
+    BYTE alpha_bits, alpha_shift;
+    BYTE accum_bits;
+    BYTE depth_bits;
+    BYTE stencil_bits;
+} pixel_formats[] =
+{
+    { OSMESA_BGRA,     32,  8, 16, 8, 8,  8, 0,  8, 24,  16, 32, 8 },
+    { OSMESA_BGRA,     32,  8, 16, 8, 8,  8, 0,  8, 24,  16, 16, 8 },
+    { OSMESA_RGBA,     32,  8, 0,  8, 8,  8, 16, 8, 24,  16, 32, 8 },
+    { OSMESA_RGBA,     32,  8, 0,  8, 8,  8, 16, 8, 24,  16, 16, 8 },
+    { OSMESA_ARGB,     32,  8, 8,  8, 16, 8, 24, 8, 0,   16, 32, 8 },
+    { OSMESA_ARGB,     32,  8, 8,  8, 16, 8, 24, 8, 0,   16, 16, 8 },
+    { OSMESA_RGB,      24,  8, 0,  8, 8,  8, 16, 0, 0,   16, 32, 8 },
+    { OSMESA_RGB,      24,  8, 0,  8, 8,  8, 16, 0, 0,   16, 16, 8 },
+    { OSMESA_BGR,      24,  8, 16, 8, 8,  8, 0,  0, 0,   16, 32, 8 },
+    { OSMESA_BGR,      24,  8, 16, 8, 8,  8, 0,  0, 0,   16, 16, 8 },
+    { OSMESA_RGB_565,  16,  5, 0,  6, 5,  5, 11, 0, 0,   16, 32, 8 },
+    { OSMESA_RGB_565,  16,  5, 0,  6, 5,  5, 11, 0, 0,   16, 16, 8 },
+};
+
+/* glFinish for single-buffered pixel formats */
+static void GLAPIENTRY sw_sb_Finish(void)
+{
+    struct wgl_dc_data* dc_data = IntGetCurrentDcData();
+    struct sw_framebuffer* fb;
+    HDC hdc;
+    
+    /* Call osmesa */
+    pFinish();
+    
+    assert(dc_data != NULL);
+    fb = dc_data->sw_data;
+    assert(fb != NULL);
+    
+    if(fb->flags & SW_FB_DIBSECTION)
+        return;
+    
+    if(dc_data->flags & WGL_DC_OBJ_DC)
+        hdc = GetDC(dc_data->owner.hwnd);
+    else
+        hdc = dc_data->owner.hdc;
+    
+    /* Upload the data to the device */
+    SetDIBitsToDevice(hdc,
+        0,
+        0,
+        fb->bmi.bmiHeader.biWidth,
+        fb->bmi.bmiHeader.biHeight,
+        0,
+        0,
+        0,
+        fb->bmi.bmiHeader.biWidth,
+        fb->bits,
+        &fb->bmi,
+        DIB_RGB_COLORS);
+    
+    if(dc_data->flags & WGL_DC_OBJ_DC)
+        ReleaseDC(dc_data->owner.hwnd, hdc);
+}
+
+static UINT index_from_format(struct wgl_dc_data* dc_data, INT format, BOOL* doubleBuffered)
+{
+    UINT index, nb_win_compat = 0, start_win_compat = 0;
+    HDC hdc;
+    INT bpp;
+    
+    *doubleBuffered = FALSE;
+    
+    if(!(dc_data->flags & WGL_DC_OBJ_DC))
+        return format - 1; /* OBJ_MEMDC, not double buffered */
+    
+    hdc = GetDC(dc_data->owner.hwnd);
+
+    /* Find the window compatible formats */
+    bpp = GetDeviceCaps(hdc, BITSPIXEL);
+    for(index = 0; index<sizeof(pixel_formats)/sizeof(pixel_formats[0]); index++)
+    {
+        if(pixel_formats[index].color_bits == bpp)
+        {
+            if(!start_win_compat)
+                start_win_compat = index+1;
+            nb_win_compat++;
+        }
+    }
+    ReleaseDC(dc_data->owner.hwnd, hdc);
+    
+    /* Double buffered format */
+    if(format < (start_win_compat + nb_win_compat))
+    {
+        if(format >= start_win_compat)
+            *doubleBuffered = TRUE;
+        return format-1;
+    }
+    /* Shift */
+    return format - nb_win_compat - 1;
+}
+
+INT sw_DescribePixelFormat(HDC hdc, INT format, UINT size, PIXELFORMATDESCRIPTOR* descr)
+{
+    UINT index, nb_win_compat = 0, start_win_compat = 0;
+    INT ret = sizeof(pixel_formats)/sizeof(pixel_formats[0]);
+    
+    if(GetObjectType(hdc) == OBJ_DC)
+    {
+        /* Find the window compatible formats */
+        INT bpp = GetDeviceCaps(hdc, BITSPIXEL);
+        for(index = 0; index<sizeof(pixel_formats)/sizeof(pixel_formats[0]); index++)
+        {
+            if(pixel_formats[index].color_bits == bpp)
+            {
+                if(!start_win_compat)
+                    start_win_compat = index+1;
+                nb_win_compat++;
+            }
+        }
+        /* Add the double buffered formats */
+        ret += nb_win_compat;
+    }
+
+    index = (UINT)format - 1;
+    if(!descr)
+        return ret;
+    if((format > ret) || (size != sizeof(*descr)))
+        return 0;
+
+    /* Set flags */
+    descr->dwFlags = PFD_SUPPORT_GDI | PFD_SUPPORT_OPENGL | PFD_DRAW_TO_BITMAP | PFD_GENERIC_FORMAT;
+    /* See if this is a format compatible with the window */
+    if(format >= start_win_compat && format < (start_win_compat + nb_win_compat*2) )
+    {
+        /* It is */
+        descr->dwFlags |= PFD_DRAW_TO_WINDOW;
+        /* See if this should be double buffered */
+        if(format < (start_win_compat + nb_win_compat))
+        {
+            /* No GDI, no bitmap */
+            descr->dwFlags &= ~(PFD_SUPPORT_GDI | PFD_DRAW_TO_BITMAP);
+            descr->dwFlags |= PFD_DOUBLEBUFFER;
+        }
+    }
+    /* Normalize the index */
+    if(format >= start_win_compat + nb_win_compat)
+        index -= nb_win_compat;
+    
+    /* Fill the rest of the structure */
+    descr->nSize            = sizeof(*descr);
+    descr->nVersion         = 1;
+    descr->iPixelType       = PFD_TYPE_RGBA;
+    descr->cColorBits       = pixel_formats[index].color_bits;
+    descr->cRedBits         = pixel_formats[index].red_bits;
+    descr->cRedShift        = pixel_formats[index].red_shift;
+    descr->cGreenBits       = pixel_formats[index].green_bits;
+    descr->cGreenShift      = pixel_formats[index].green_shift;
+    descr->cBlueBits        = pixel_formats[index].blue_bits;
+    descr->cBlueShift       = pixel_formats[index].blue_shift;
+    descr->cAlphaBits       = pixel_formats[index].alpha_bits;
+    descr->cAlphaShift      = pixel_formats[index].alpha_shift;
+    descr->cAccumBits       = pixel_formats[index].accum_bits;
+    descr->cAccumRedBits    = pixel_formats[index].accum_bits / 4;
+    descr->cAccumGreenBits  = pixel_formats[index].accum_bits / 4;
+    descr->cAccumBlueBits   = pixel_formats[index].accum_bits / 4;
+    descr->cAccumAlphaBits  = pixel_formats[index].accum_bits / 4;
+    descr->cDepthBits       = pixel_formats[index].depth_bits;
+    descr->cStencilBits     = pixel_formats[index].stencil_bits;
+    descr->cAuxBuffers      = 0;
+    descr->iLayerType       = PFD_MAIN_PLANE;
+    return ret;
+}
+
+BOOL sw_SetPixelFormat(struct wgl_dc_data* dc_data, INT format)
+{
+    struct sw_framebuffer* fb;
+    BOOL doubleBuffered;
+    /* NOTE: we let the wgl implementation tracking the pixel format for us */
+    if(hMesaDll != NULL)
+        goto osmesa_loaded;
+
+    /* So, someone is crazy enough to ask for sw implementation. Load it. */
+    TRACE("OpenGL software implementation START!\n");
+    
+    hMesaDll = LoadLibrary("osmesa.dll");
+    if(!hMesaDll)
+    {
+        ERR("Failed loading osmesa.dll.\n");
+        return FALSE;
+    }
+    
+#define LOAD_PROC(x) do                                     \
+{                                                           \
+    p## x = (void*)GetProcAddress(hMesaDll, #x);                   \
+    if(!p##x)                                               \
+    {                                                       \
+        ERR("Failed loading " #x " from osmesa.dll.\n");    \
+        FreeLibrary(hMesaDll);                              \
+        hMesaDll = NULL;                                    \
+        return FALSE;                                       \
+    }                                                       \
+} while(0)
+    LOAD_PROC(OSMesaCreateContextExt);
+    LOAD_PROC(OSMesaDestroyContext);
+    LOAD_PROC(OSMesaMakeCurrent);
+    LOAD_PROC(OSMesaPixelStore);
+    LOAD_PROC(OSMesaGetProcAddress);
+#undef LOAD_PROC
+    
+    /* Load the GL api entries */
+#define USE_GL_FUNC(x) do                                                       \
+{                                                                               \
+    sw_table_db.glDispatchTable.x = (void*)GetProcAddress(hMesaDll, "gl" #x);   \
+    if(!sw_table_db.glDispatchTable.x)                                          \
+    {                                                                           \
+        ERR("Failed loading gl" #x " from osmesa.dll.\n");                      \
+        FreeLibrary(hMesaDll);                                                  \
+        hMesaDll = NULL;                                                        \
+        return FALSE;                                                           \
+    }                                                                           \
+    sw_table_sb.glDispatchTable.x = sw_table_db.glDispatchTable.x;              \
+} while(0);
+    #include "glfuncs.h"
+#undef USE_GL_FUNC
+    /* For completeness */
+    sw_table_db.cEntries = sw_table_sb.cEntries = OPENGL_VERSION_110_ENTRIES;
+    
+    /* We are not really single buffered, but this trick fits the bill */
+    pFinish = sw_table_sb.glDispatchTable.Finish;
+    sw_table_sb.glDispatchTable.Finish = sw_sb_Finish;
+
+osmesa_loaded:
+    /* Now allocate our structure */
+    fb = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*fb));
+    if(!fb)
+        return FALSE;
+    /* Get the format index */
+    fb->format_index = index_from_format(dc_data, format, &doubleBuffered);
+    fb->flags = doubleBuffered ? SW_FB_DOUBLEBUFFERED : 0;
+    /* Everything went fine */
+    dc_data->sw_data = fb;
+    return TRUE;
+}
+
+DHGLRC sw_CreateContext(struct wgl_dc_data* dc_data)
+{
+    struct sw_context *context;
+    struct sw_framebuffer* fb = dc_data->sw_data;
+    
+    context = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*context));
+    if(!context)
+        return NULL;
+
+    context->mesa_ctx = pOSMesaCreateContextExt(pixel_formats[fb->format_index].mesa,
+                                                pixel_formats[fb->format_index].depth_bits,
+                                                pixel_formats[fb->format_index].stencil_bits,
+                                                pixel_formats[fb->format_index].accum_bits, 0 );
+    
+    if(!context->mesa_ctx)
+    {
+        HeapFree( GetProcessHeap(), 0, context );
+        return NULL;
+    }
+    context->hook = NULL;
+    return (DHGLRC)context;
+}
+
+BOOL sw_DeleteContext(DHGLRC dhglrc)
+{
+    struct sw_context* context = (struct sw_context*)dhglrc;
+    
+    pOSMesaDestroyContext( context->mesa_ctx );
+    HeapFree( GetProcessHeap(), 0, context );
+    
+    return TRUE;
+}
+
+void sw_ReleaseContext(DHGLRC dhglrc)
+{
+    struct sw_context* context = (struct sw_context*)dhglrc;
+    
+    /* Pass to osmesa the fact that there is no active context anymore */
+    pOSMesaMakeCurrent( NULL, NULL, GL_UNSIGNED_BYTE, 0, 0 );
+    
+    /* Un-own */
+    context->framebuffer = NULL;
+    
+    /* Unhook */
+    if(context->hook)
+    {
+        UnhookWindowsHookEx(context->hook);
+        context->hook = NULL;
+    }
+}
+
+#define WIDTH_BYTES_ALIGN32(cx, bpp) ((((cx) * (bpp) + 31) & ~31) >> 3)
+static
+LRESULT CALLBACK
+sw_call_window_proc(
+   int nCode,
+   WPARAM wParam,
+   LPARAM lParam )
+{
+    struct wgl_dc_data* dc_data = IntGetCurrentDcData();
+    struct sw_context* ctx = (struct sw_context*)IntGetCurrentDHGLRC();
+    struct sw_framebuffer* fb;
+    PCWPSTRUCT pParams = (PCWPSTRUCT)lParam;
+
+    if((!dc_data) || (!ctx))
+        return 0;
+    
+    if(!(dc_data->flags & WGL_DC_OBJ_DC))
+        return 0;
+    
+    if((nCode < 0) || (dc_data->owner.hwnd != pParams->hwnd) || (dc_data->sw_data == NULL))
+        return CallNextHookEx(ctx->hook, nCode, wParam, lParam);
+    
+    fb = dc_data->sw_data;
+
+    if (pParams->message == WM_WINDOWPOSCHANGED)
+    {
+        /* We handle WM_WINDOWPOSCHANGED instead of WM_SIZE because according to
+         * http://blogs.msdn.com/oldnewthing/archive/2008/01/15/7113860.aspx 
+         * WM_SIZE is generated from WM_WINDOWPOSCHANGED by DefWindowProc so it 
+         * can be masked out by the application. */
+        LPWINDOWPOS lpWindowPos = (LPWINDOWPOS)pParams->lParam;
+        if((lpWindowPos->flags & SWP_SHOWWINDOW) || 
+            !(lpWindowPos->flags & SWP_NOMOVE) ||
+            !(lpWindowPos->flags & SWP_NOSIZE))
+        {
+            /* Size in WINDOWPOS includes the window frame, so get the size 
+             * of the client area via GetClientRect.  */
+            RECT client_rect;
+            UINT width, height, widthBytes;
+            GetClientRect(pParams->hwnd, &client_rect);
+            width = client_rect.right - client_rect.left;
+            height = client_rect.bottom - client_rect.top;
+            /* Do not reallocate for minimized windows */
+            if(width <= 0 || height <= 0)
+                goto end;
+            /* Temporarily disable osmesa */
+            pOSMesaMakeCurrent(NULL, NULL, GL_UNSIGNED_BYTE, 0, 0);
+            /* Resize the buffer accordingly */
+            widthBytes = WIDTH_BYTES_ALIGN32(width, pixel_formats[fb->format_index].color_bits);
+            fb->bits = HeapReAlloc(GetProcessHeap(), 0, fb->bits, widthBytes * height);
+            /* Update this */
+            fb->bmi.bmiHeader.biWidth = width;
+            fb->bmi.bmiHeader.biHeight = height;
+            /* Re-enable osmesa */
+            pOSMesaMakeCurrent(ctx->mesa_ctx, fb->bits, GL_UNSIGNED_BYTE, width, height);
+            pOSMesaPixelStore(OSMESA_ROW_LENGTH, widthBytes * 8 / pixel_formats[fb->format_index].color_bits);
+        }
+    }
+
+end:
+    return CallNextHookEx(ctx->hook, nCode, wParam, lParam);
+}
+
+const GLCLTPROCTABLE* sw_SetContext(struct wgl_dc_data* dc_data, DHGLRC dhglrc)
+{
+    struct sw_context* context = (struct sw_context*)dhglrc;
+    struct sw_framebuffer* fb = dc_data->sw_data;
+    UINT width, height, widthBytes;
+    void* bits = NULL;
+
+    if(dc_data->flags & WGL_DC_OBJ_DC)
+    {
+        HWND hwnd = dc_data->owner.hwnd;
+        RECT client_rect;
+        if(!hwnd)
+        {
+            ERR("Physical DC without a window!\n");
+            return NULL;
+        }
+        if(!GetClientRect(hwnd, &client_rect))
+        {
+            ERR("GetClientRect failed!\n");
+            return NULL;
+        }
+        /* This is a physical DC. Setup the hook */
+        context->hook = SetWindowsHookEx(WH_CALLWNDPROC,
+                            sw_call_window_proc,
+                            NULL,
+                            GetCurrentThreadId());
+        /* Calculate width & height */
+        width  = client_rect.right  - client_rect.left;
+        height = client_rect.bottom - client_rect.top;
+    }
+    else /* OBJ_MEMDC */
+    {
+        BITMAP bm;
+        HBITMAP hbmp;
+        HDC hdc = dc_data->owner.hdc;
+        
+        if(fb->flags & SW_FB_DOUBLEBUFFERED)
+        {
+            ERR("Memory DC called with a double buffered format.\n");
+            return FALSE;
+        }
+        
+        hbmp = GetCurrentObject( hdc, OBJ_BITMAP );
+        if(!hbmp)
+        {
+            ERR("No Bitmap!\n");
+            return NULL;
+        }
+        if(GetObject(hbmp, sizeof(bm), &bm) == 0)
+        {
+            ERR("GetObject failed!\n");
+            return NULL;
+        }
+        
+        widthBytes = bm.bmWidthBytes;
+        width = bm.bmWidth;
+        height = bm.bmHeight;
+        bits = bm.bmBits;
+    }
+    
+    if(!width) width = 1;
+    if(!height) height = 1;
+    
+    if(bits)
+    {
+        if(fb->flags & SW_FB_FREE_BITS)
+        {
+            fb->flags ^= SW_FB_FREE_BITS;
+            HeapFree(GetProcessHeap(), 0, fb->bits);
+        }
+        fb->flags |= SW_FB_DIBSECTION;
+        fb->bits = bits;
+    }
+    else
+    {
+        widthBytes = WIDTH_BYTES_ALIGN32(width, pixel_formats[fb->format_index].color_bits);
+        if(fb->flags & SW_FB_FREE_BITS)
+            fb->bits = HeapReAlloc(GetProcessHeap(), 0, fb->bits, widthBytes * height);
+        else
+            fb->bits = HeapAlloc(GetProcessHeap(), 0, widthBytes * height);
+        fb->flags |= SW_FB_FREE_BITS;
+        fb->flags &= ~SW_FB_DIBSECTION;
+    }
+    
+    /* Set details up */
+    fb->bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+    fb->bmi.bmiHeader.biWidth = width;
+    fb->bmi.bmiHeader.biHeight = height;
+    fb->bmi.bmiHeader.biPlanes = 1;
+    fb->bmi.bmiHeader.biBitCount = pixel_formats[fb->format_index].color_bits;
+    fb->bmi.bmiHeader.biCompression = BI_RGB;
+    fb->bmi.bmiHeader.biSizeImage = 0;
+    fb->bmi.bmiHeader.biXPelsPerMeter = 0;
+    fb->bmi.bmiHeader.biYPelsPerMeter = 0;
+    fb->bmi.bmiHeader.biClrUsed = 0;
+    fb->bmi.bmiHeader.biClrImportant = 0;
+    
+    if(!pOSMesaMakeCurrent(context->mesa_ctx, fb->bits, GL_UNSIGNED_BYTE, width, height))
+    {
+        ERR("OSMesaMakeCurrent failed!\n");
+        /* Damn! Free everything */
+        if(fb->flags & SW_FB_FREE_BITS)
+            HeapFree(GetProcessHeap(), 0, fb->bits);
+        fb->flags &= ~SW_FB_FREE_BITS;
+        fb->bits = NULL;
+    
+        /* Unhook */
+        if(context->hook)
+        {
+            UnhookWindowsHookEx(context->hook);
+            context->hook = NULL;
+        }
+        return NULL;
+    }
+    
+    /* Don't forget to tell mesa how our image is organized */
+    pOSMesaPixelStore(OSMESA_ROW_LENGTH, widthBytes * 8 / pixel_formats[fb->format_index].color_bits);
+    
+    /* Own the context */
+    context->framebuffer = fb;
+
+    return (fb->flags & SW_FB_DOUBLEBUFFERED) ? &sw_table_db : &sw_table_sb;
+}
+
+PROC sw_GetProcAddress(LPCSTR name)
+{
+    return (PROC)pOSMesaGetProcAddress(name);
+}
+
+BOOL sw_CopyContext(DHGLRC dhglrcSrc, DHGLRC dhglrcDst, UINT mask)
+{
+    FIXME("Software wglCopyContext is UNIMPLEMENTED, mask %lx.\n", mask);
+    return FALSE;
+}
+
+BOOL sw_ShareLists(DHGLRC dhglrcSrc, DHGLRC dhglrcDst)
+{
+    FIXME("Software wglShareLists is UNIMPLEMENTED.\n");
+    return FALSE;
+}
+
+BOOL sw_SwapBuffers(HDC hdc, struct wgl_dc_data* dc_data)
+{
+    struct sw_framebuffer* fb = dc_data->sw_data;
+    
+    if(!(fb->flags & SW_FB_DOUBLEBUFFERED))
+        return TRUE;
+    
+    if(!(fb->bits))
+        return TRUE;
+    
+    return (SetDIBitsToDevice(hdc,
+        0,
+        0,
+        fb->bmi.bmiHeader.biWidth,
+        fb->bmi.bmiHeader.biHeight,
+        0,
+        0,
+        0,
+        fb->bmi.bmiHeader.biWidth,
+        fb->bits,
+        &fb->bmi,
+        DIB_RGB_COLORS) != 0);
+}
\ No newline at end of file
diff --git a/reactos/dll/opengl/opengl32_new/wgl.c b/reactos/dll/opengl/opengl32_new/wgl.c
new file mode 100644 (file)
index 0000000..1f0dca6
--- /dev/null
@@ -0,0 +1,906 @@
+/*
+ * COPYRIGHT:            See COPYING in the top level directory
+ * PROJECT:              ReactOS
+ * FILE:                 dll/opengl/opengl32/wgl.c
+ * PURPOSE:              OpenGL32 DLL, WGL functions
+ */
+
+#include "opengl32.h"
+
+#include <pseh/pseh2.h>
+
+#include <wine/debug.h>
+WINE_DEFAULT_DEBUG_CHANNEL(wgl);
+
+static CRITICAL_SECTION dc_data_cs = {NULL, -1, 0, 0, 0, 0};
+static struct wgl_dc_data* dc_data_list = NULL;
+
+/* FIXME: suboptimal */
+static
+struct wgl_dc_data*
+get_dc_data(HDC hdc)
+{
+    HWND hwnd = NULL;
+    struct wgl_dc_data* data;
+    DWORD objType = GetObjectType(hdc);
+    ULONG flags = 0;
+    union
+    {
+        HWND hwnd;
+        HDC hdc;
+        HANDLE u;
+    } id;
+    
+    /* Look for the right data identifier */
+    if(objType == OBJ_DC)
+    {
+        hwnd = WindowFromDC(hdc);
+        if(!hwnd)
+            return NULL;
+        id.hwnd = hwnd;
+        flags = WGL_DC_OBJ_DC;
+    }
+    else if(objType == OBJ_MEMDC)
+    {
+        id.hdc = hdc;
+    }
+    else
+    {
+        return NULL;
+    }
+
+    EnterCriticalSection(&dc_data_cs);
+    data = dc_data_list;
+    while(data)
+    {
+        if(data->owner.u == id.u)
+        {
+            LeaveCriticalSection(&dc_data_cs);
+            return data;
+        }
+        data = data->next;
+    }
+    data= HeapAlloc(GetProcessHeap(), 0, sizeof(*data));
+    if(!data)
+    {
+        LeaveCriticalSection(&dc_data_cs);
+        return NULL;
+    }
+    /* initialize the structure */
+    data->owner.u = id.u;
+    data->flags = flags;
+    data->pixelformat = 0;
+    /* Load the driver */
+    data->icd_data = IntGetIcdData(hdc);
+    /* Get the number of available formats for this DC once and for all */
+    if(data->icd_data)
+        data->nb_icd_formats = data->icd_data->DrvDescribePixelFormat(hdc, 0, 0, NULL);
+    else
+        data->nb_icd_formats = 0;
+    data->nb_sw_formats = sw_DescribePixelFormat(hdc, 0, 0, NULL);
+    data->next = dc_data_list;
+    dc_data_list = data;
+    LeaveCriticalSection(&dc_data_cs);
+    return data;
+}
+
+void release_dc_data(struct wgl_dc_data* dc_data)
+{
+    (void)dc_data;
+}
+
+struct wgl_context* get_context(HGLRC hglrc)
+{
+    struct wgl_context* context = (struct wgl_context*)hglrc;
+    
+    if(!hglrc)
+        return NULL;
+    
+    _SEH2_TRY
+    {
+        if(context->magic != 'GLRC')
+            context = NULL;
+    }
+    _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+    {
+        context = NULL;
+    }
+    _SEH2_END;
+    
+    return context;
+}
+
+INT WINAPI wglDescribePixelFormat(HDC hdc, INT format, UINT size, PIXELFORMATDESCRIPTOR *descr )
+{
+    struct wgl_dc_data* dc_data = get_dc_data(hdc);
+    INT ret;
+    
+    if(!dc_data)
+    {
+        SetLastError(ERROR_INVALID_HANDLE);
+        return 0;
+    }
+    
+    ret = dc_data->nb_icd_formats + dc_data->nb_sw_formats;
+    
+    if(!descr)
+    {
+        release_dc_data(dc_data);
+        return ret;
+    }
+    if((format == 0) || (format > ret) || (size != sizeof(*descr)))
+    {
+        release_dc_data(dc_data);
+        SetLastError(ERROR_INVALID_PARAMETER);
+        return 0;
+    }
+    
+    /* Query ICD if needed */
+    if(format <= dc_data->nb_icd_formats)
+    {
+        if(!dc_data->icd_data->DrvDescribePixelFormat(hdc, format, size, descr))
+        {
+            ret = 0;
+        }
+    }
+    else
+    {
+        /* This is a software format */
+        format -= dc_data->nb_icd_formats;
+        if(!sw_DescribePixelFormat(hdc, format, size, descr))
+        {
+            ret = 0;
+        }
+    }
+    
+    release_dc_data(dc_data);
+    return ret;
+}
+
+INT WINAPI wglChoosePixelFormat(HDC hdc, const PIXELFORMATDESCRIPTOR* ppfd)
+{
+    PIXELFORMATDESCRIPTOR format, best;
+    int i, count, best_format;
+    int bestDBuffer = -1, bestStereo = -1;
+
+    TRACE_(wgl)( "%p %p: size %u version %u flags %u type %u color %u %u,%u,%u,%u "
+                 "accum %u depth %u stencil %u aux %u\n",
+                 hdc, ppfd, ppfd->nSize, ppfd->nVersion, ppfd->dwFlags, ppfd->iPixelType,
+                 ppfd->cColorBits, ppfd->cRedBits, ppfd->cGreenBits, ppfd->cBlueBits, ppfd->cAlphaBits,
+                 ppfd->cAccumBits, ppfd->cDepthBits, ppfd->cStencilBits, ppfd->cAuxBuffers );
+
+    count = wglDescribePixelFormat( hdc, 0, 0, NULL );
+    if (!count) return 0;
+
+    best_format = 0;
+    best.dwFlags = 0;
+    best.cAlphaBits = -1;
+    best.cColorBits = -1;
+    best.cDepthBits = -1;
+    best.cStencilBits = -1;
+    best.cAuxBuffers = -1;
+
+    for (i = 1; i <= count; i++)
+    {
+        if (!wglDescribePixelFormat( hdc, i, sizeof(format), &format )) continue;
+
+        if (ppfd->iPixelType != format.iPixelType)
+        {
+            TRACE( "pixel type mismatch for iPixelFormat=%d\n", i );
+            continue;
+        }
+
+        /* only use bitmap capable for formats for bitmap rendering */
+        if( (ppfd->dwFlags & PFD_DRAW_TO_BITMAP) != (format.dwFlags & PFD_DRAW_TO_BITMAP))
+        {
+            TRACE( "PFD_DRAW_TO_BITMAP mismatch for iPixelFormat=%d\n", i );
+            continue;
+        }
+
+        /* The behavior of PDF_STEREO/PFD_STEREO_DONTCARE and PFD_DOUBLEBUFFER / PFD_DOUBLEBUFFER_DONTCARE
+         * is not very clear on MSDN. They specify that ChoosePixelFormat tries to match pixel formats
+         * with the flag (PFD_STEREO / PFD_DOUBLEBUFFERING) set. Otherwise it says that it tries to match
+         * formats without the given flag set.
+         * A test on Windows using a Radeon 9500pro on WinXP (the driver doesn't support Stereo)
+         * has indicated that a format without stereo is returned when stereo is unavailable.
+         * So in case PFD_STEREO is set, formats that support it should have priority above formats
+         * without. In case PFD_STEREO_DONTCARE is set, stereo is ignored.
+         *
+         * To summarize the following is most likely the correct behavior:
+         * stereo not set -> prefer non-stereo formats, but also accept stereo formats
+         * stereo set -> prefer stereo formats, but also accept non-stereo formats
+         * stereo don't care -> it doesn't matter whether we get stereo or not
+         *
+         * In Wine we will treat non-stereo the same way as don't care because it makes
+         * format selection even more complicated and second drivers with Stereo advertise
+         * each format twice anyway.
+         */
+
+        /* Doublebuffer, see the comments above */
+        if (!(ppfd->dwFlags & PFD_DOUBLEBUFFER_DONTCARE))
+        {
+            if (((ppfd->dwFlags & PFD_DOUBLEBUFFER) != bestDBuffer) &&
+                ((format.dwFlags & PFD_DOUBLEBUFFER) == (ppfd->dwFlags & PFD_DOUBLEBUFFER)))
+                goto found;
+
+            if (bestDBuffer != -1 && (format.dwFlags & PFD_DOUBLEBUFFER) != bestDBuffer) continue;
+        }
+
+        /* Stereo, see the comments above. */
+        if (!(ppfd->dwFlags & PFD_STEREO_DONTCARE))
+        {
+            if (((ppfd->dwFlags & PFD_STEREO) != bestStereo) &&
+                ((format.dwFlags & PFD_STEREO) == (ppfd->dwFlags & PFD_STEREO)))
+                goto found;
+
+            if (bestStereo != -1 && (format.dwFlags & PFD_STEREO) != bestStereo) continue;
+        }
+
+        /* Below we will do a number of checks to select the 'best' pixelformat.
+         * We assume the precedence cColorBits > cAlphaBits > cDepthBits > cStencilBits -> cAuxBuffers.
+         * The code works by trying to match the most important options as close as possible.
+         * When a reasonable format is found, we will try to match more options.
+         * It appears (see the opengl32 test) that Windows opengl drivers ignore options
+         * like cColorBits, cAlphaBits and friends if they are set to 0, so they are considered
+         * as DONTCARE. At least Serious Sam TSE relies on this behavior. */
+
+        if (ppfd->cColorBits)
+        {
+            if (((ppfd->cColorBits > best.cColorBits) && (format.cColorBits > best.cColorBits)) ||
+                ((format.cColorBits >= ppfd->cColorBits) && (format.cColorBits < best.cColorBits)))
+                goto found;
+
+            if (best.cColorBits != format.cColorBits)  /* Do further checks if the format is compatible */
+            {
+                TRACE( "color mismatch for iPixelFormat=%d\n", i );
+                continue;
+            }
+        }
+        if (ppfd->cAlphaBits)
+        {
+            if (((ppfd->cAlphaBits > best.cAlphaBits) && (format.cAlphaBits > best.cAlphaBits)) ||
+                ((format.cAlphaBits >= ppfd->cAlphaBits) && (format.cAlphaBits < best.cAlphaBits)))
+                goto found;
+
+            if (best.cAlphaBits != format.cAlphaBits)
+            {
+                TRACE( "alpha mismatch for iPixelFormat=%d\n", i );
+                continue;
+            }
+        }
+        if (ppfd->cDepthBits)
+        {
+            if (((ppfd->cDepthBits > best.cDepthBits) && (format.cDepthBits > best.cDepthBits)) ||
+                ((format.cDepthBits >= ppfd->cDepthBits) && (format.cDepthBits < best.cDepthBits)))
+                goto found;
+
+            if (best.cDepthBits != format.cDepthBits)
+            {
+                TRACE( "depth mismatch for iPixelFormat=%d\n", i );
+                continue;
+            }
+        }
+        if (ppfd->cStencilBits)
+        {
+            if (((ppfd->cStencilBits > best.cStencilBits) && (format.cStencilBits > best.cStencilBits)) ||
+                ((format.cStencilBits >= ppfd->cStencilBits) && (format.cStencilBits < best.cStencilBits)))
+                goto found;
+
+            if (best.cStencilBits != format.cStencilBits)
+            {
+                TRACE( "stencil mismatch for iPixelFormat=%d\n", i );
+                continue;
+            }
+        }
+        if (ppfd->cAuxBuffers)
+        {
+            if (((ppfd->cAuxBuffers > best.cAuxBuffers) && (format.cAuxBuffers > best.cAuxBuffers)) ||
+                ((format.cAuxBuffers >= ppfd->cAuxBuffers) && (format.cAuxBuffers < best.cAuxBuffers)))
+                goto found;
+
+            if (best.cAuxBuffers != format.cAuxBuffers)
+            {
+                TRACE( "aux mismatch for iPixelFormat=%d\n", i );
+                continue;
+            }
+        }
+        continue;
+
+    found:
+        best_format = i;
+        best = format;
+        bestDBuffer = format.dwFlags & PFD_DOUBLEBUFFER;
+        bestStereo = format.dwFlags & PFD_STEREO;
+    }
+
+    TRACE( "returning %u\n", best_format );
+    return best_format;
+}
+
+BOOL WINAPI wglCopyContext(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask)
+{
+    struct wgl_context* ctx_src = get_context(hglrcSrc);
+    struct wgl_context* ctx_dst = get_context(hglrcDst);
+    
+    if(!ctx_src || !ctx_dst)
+    {
+        SetLastError(ERROR_INVALID_HANDLE);
+        return FALSE;
+    }
+    
+    /* Check this is the same pixel format */
+    if((ctx_dst->icd_data != ctx_src->icd_data) ||
+        (ctx_dst->pixelformat != ctx_src->pixelformat))
+    {
+        SetLastError(ERROR_INVALID_PIXEL_FORMAT);
+        return FALSE;
+    }
+    
+    if(ctx_src->icd_data)
+        return ctx_src->icd_data->DrvCopyContext(ctx_src->dhglrc, ctx_dst->dhglrc, mask);
+    
+    return sw_CopyContext(ctx_src->dhglrc, ctx_dst->dhglrc, mask);
+}
+
+HGLRC WINAPI wglCreateContext(HDC hdc)
+{
+    struct wgl_dc_data* dc_data = get_dc_data(hdc);
+    struct wgl_context* context;
+    DHGLRC dhglrc;
+    
+    if(!dc_data)
+    {
+        SetLastError(ERROR_INVALID_HANDLE);
+        return NULL;
+    }
+    
+    if(!dc_data->pixelformat)
+    {
+        release_dc_data(dc_data);
+        SetLastError(ERROR_INVALID_PIXEL_FORMAT);
+        return NULL;
+    }
+    
+    if(!dc_data->icd_data)
+        dhglrc = sw_CreateContext(dc_data);
+    else
+        dhglrc = dc_data->icd_data->DrvCreateContext(hdc);
+    
+    if(!dhglrc)
+    {
+        release_dc_data(dc_data);
+        SetLastError(ERROR_INVALID_PIXEL_FORMAT);
+        return NULL;
+    }
+    
+    context = HeapAlloc(GetProcessHeap(), 0, sizeof(*context));
+    if(!context)
+    {
+        if(!dc_data->icd_data)
+            sw_DeleteContext(dhglrc);
+        else
+            dc_data->icd_data->DrvDeleteContext(dhglrc);
+        release_dc_data(dc_data);
+        SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+        return NULL;
+    }
+    /* Copy info from the DC data */
+    context->dhglrc = dhglrc;
+    context->icd_data = dc_data->icd_data;
+    context->pixelformat = dc_data->pixelformat;
+    context->thread_id = 0;
+    
+    context->magic = 'GLRC';
+    
+    release_dc_data(dc_data);
+    return (HGLRC)context;
+}
+
+HGLRC WINAPI wglCreateLayerContext(HDC hdc, int iLayerPlane)
+{
+    struct wgl_dc_data* dc_data = get_dc_data(hdc);
+    struct wgl_context* context;
+    DHGLRC dhglrc;
+    
+    if(!dc_data)
+    {
+        SetLastError(ERROR_INVALID_HANDLE);
+        return NULL;
+    }
+    
+    if(!dc_data->pixelformat)
+    {
+        release_dc_data(dc_data);
+        SetLastError(ERROR_INVALID_PIXEL_FORMAT);
+        return NULL;
+    }
+    
+    if(!dc_data->icd_data)
+    {
+        if(iLayerPlane != 0)
+        {
+            /* Not supported in SW implementation  */
+            release_dc_data(dc_data);
+            SetLastError(ERROR_INVALID_PIXEL_FORMAT);
+            return NULL;
+        }
+        dhglrc = sw_CreateContext(dc_data);
+    }
+    else
+    {
+        dhglrc = dc_data->icd_data->DrvCreateLayerContext(hdc, iLayerPlane);
+    }
+    
+    if(!dhglrc)
+    {
+        release_dc_data(dc_data);
+        SetLastError(ERROR_INVALID_PIXEL_FORMAT);
+        return NULL;
+    }
+    
+    context = HeapAlloc(GetProcessHeap(), 0, sizeof(*context));
+    if(!context)
+    {
+        if(!dc_data->icd_data)
+            sw_DeleteContext(dhglrc);
+        else
+            dc_data->icd_data->DrvDeleteContext(dhglrc);
+        release_dc_data(dc_data);
+        SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+        return NULL;
+    }
+    /* Copy info from the DC data */
+    context->dhglrc = dhglrc;
+    context->icd_data = dc_data->icd_data;
+    context->pixelformat = dc_data->pixelformat;
+    context->thread_id = 0;
+    
+    context->magic = 'GLRC';
+    
+    release_dc_data(dc_data);
+    return (HGLRC)context;
+}
+
+BOOL WINAPI wglDeleteContext(HGLRC hglrc)
+{
+    struct wgl_context* context = get_context(hglrc);
+    LONG thread_id = GetCurrentThreadId();
+    
+    if(!context)
+    {
+        SetLastError(ERROR_INVALID_HANDLE);
+        return FALSE;
+    }
+    
+    /* Own this context before touching it */
+    if(InterlockedCompareExchange(&context->thread_id, thread_id, 0) != 0)
+    {
+        /* We can't delete a context current to another thread */
+        if(context->thread_id != thread_id)
+        {
+            SetLastError(ERROR_BUSY);
+            return FALSE;
+        }
+        
+        /* This is in our thread. Release and try again */
+        if(!wglMakeCurrent(NULL, NULL))
+            return FALSE;
+        return wglDeleteContext(hglrc);
+    }
+    
+    if(context->icd_data)
+        context->icd_data->DrvDeleteContext(context->dhglrc);
+    else
+        sw_DeleteContext(context->dhglrc);
+    
+    context->magic = 0;
+    HeapFree(GetProcessHeap(), 0, context);
+    
+    return TRUE;
+}
+
+BOOL WINAPI wglDescribeLayerPlane(HDC hdc,
+                                  int iPixelFormat,
+                                  int iLayerPlane,
+                                  UINT nBytes,
+                                  LPLAYERPLANEDESCRIPTOR plpd)
+{
+    struct wgl_dc_data* dc_data = get_dc_data(hdc);
+    
+    if(!dc_data)
+    {
+        SetLastError(ERROR_INVALID_HANDLE);
+        return FALSE;
+    }
+    
+    if(iPixelFormat <= dc_data->nb_icd_formats)
+        return dc_data->icd_data->DrvDescribeLayerPlane(hdc, iPixelFormat, iLayerPlane, nBytes, plpd);
+    
+    /* SW implementation doesn't support this */
+    return FALSE;
+}
+
+HGLRC WINAPI wglGetCurrentContext(void)
+{
+    return IntGetCurrentRC();
+}
+
+HDC WINAPI wglGetCurrentDC(void)
+{
+    return IntGetCurrentDC();
+}
+
+PROC WINAPI wglGetDefaultProcAddress(LPCSTR lpszProc)
+{
+    /* undocumented... */
+    return NULL;
+}
+
+int WINAPI wglGetLayerPaletteEntries(HDC hdc, int iLayerPlane, int iStart, int cEntries, COLORREF* pcr )
+{
+    struct wgl_dc_data* dc_data = get_dc_data(hdc);
+    
+    if(!dc_data)
+    {
+        SetLastError(ERROR_INVALID_HANDLE);
+        return 0;
+    }
+    
+    if(!dc_data->pixelformat)
+    {
+        SetLastError(ERROR_INVALID_PIXEL_FORMAT);
+        return 0;
+    }
+    
+    if(dc_data->icd_data)
+        return dc_data->icd_data->DrvGetLayerPaletteEntries(hdc, iLayerPlane, iStart, cEntries, pcr);
+    
+    /* SW implementation doesn't support this */
+    return 0;
+}
+
+INT WINAPI wglGetPixelFormat(HDC hdc)
+{
+    INT ret;
+    struct wgl_dc_data* dc_data = get_dc_data(hdc);
+    
+    if(!dc_data)
+    {
+        SetLastError(ERROR_INVALID_HANDLE);
+        return 0;
+    }
+    
+    ret = dc_data->pixelformat;
+    release_dc_data(dc_data);
+    return ret;
+}
+
+PROC WINAPI wglGetProcAddress(LPCSTR name)
+{
+    struct wgl_context* context = get_context(IntGetCurrentRC());
+    if(!context)
+        return NULL;
+    
+    /* This shall fail for opengl 1.1 functions */
+#define USE_GL_FUNC(x) if(!strcmp(name, "gl" #x)) return NULL;
+#include "glfuncs.h"
+#undef USE_GL_FUNCS
+    
+    /* Forward */
+    if(context->icd_data)
+        return context->icd_data->DrvGetProcAddress(name);
+    return sw_GetProcAddress(name);
+}
+
+void APIENTRY set_api_table(const GLCLTPROCTABLE* table)
+{
+#ifdef OPENGL32_USE_TLS
+    struct Opengl32_ThreadData* data = TlsGetValue(OglTlsIndex);
+    data->ProcTable = table;
+#else
+    NtCurrentTeb()->glTable = &table->glDispatchTable;
+#endif
+}
+    
+BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc)
+{
+    struct wgl_context* ctx = get_context(hglrc);
+    struct wgl_context* old_ctx = get_context(IntGetCurrentRC());
+    const GLCLTPROCTABLE* apiTable;
+    LONG thread_id = (LONG)GetCurrentThreadId();
+    
+    if(ctx)
+    {
+        struct wgl_dc_data* dc_data = get_dc_data(hdc);
+        if(!dc_data)
+        {
+            ERR("wglMakeCurrent was passed an invalid DC handle.\n");
+            SetLastError(ERROR_INVALID_HANDLE);
+            return FALSE;
+        }
+        
+        /* Check compatibility */
+        if((ctx->icd_data != dc_data->icd_data) || (ctx->pixelformat != dc_data->pixelformat))
+        {
+            /* That's bad, man */
+            ERR("HGLRC %p and HDC %p are not compatible.\n", hglrc, hdc); 
+            release_dc_data(dc_data);
+            SetLastError(ERROR_INVALID_HANDLE);
+            return FALSE;
+        }
+        
+        /* Set the thread ID */
+        if(InterlockedCompareExchange(&ctx->thread_id, thread_id, 0) != 0)
+        {
+            /* Already current for a thread. Maybe it's us ? */
+            release_dc_data(dc_data);
+            if(ctx->thread_id != thread_id)
+                SetLastError(ERROR_BUSY);
+            return (ctx->thread_id == thread_id);
+        }
+        
+        if(old_ctx)
+        {
+            /* Unset it */
+            if(old_ctx->icd_data)
+                old_ctx->icd_data->DrvReleaseContext(old_ctx->dhglrc);
+            else
+                sw_ReleaseContext(old_ctx->dhglrc);
+            InterlockedExchange(&old_ctx->thread_id, 0);
+        }
+        
+        /* Call the ICD or SW implementation */
+        if(ctx->icd_data)
+            apiTable = ctx->icd_data->DrvSetContext(hdc, ctx->dhglrc, set_api_table);
+        else
+            apiTable = sw_SetContext(dc_data, ctx->dhglrc);
+        if(!apiTable)
+        {
+            ERR("DrvSetContext failed!\n");
+            /* revert */
+            InterlockedExchange(&ctx->thread_id, 0);
+            SetLastError(ERROR_INVALID_PARAMETER);
+            return FALSE;
+        }
+        set_api_table(apiTable);
+        /* Make it current */
+#ifdef OPENGL32_USE_TLS
+        {
+            struct Opengl32_ThreadData* thread_data = TlsGetValue(OglTlsIndex);
+            
+            thread_data->hglrc = hglrc;
+            thread_data->hdc = hdc;
+            thread_data->dc_data = dc_data;
+        }
+#endif
+    }
+    else if(old_ctx)
+    {
+        /* Unset it */
+        if(old_ctx->icd_data)
+            old_ctx->icd_data->DrvReleaseContext(old_ctx->dhglrc);
+        else
+            sw_ReleaseContext(old_ctx->dhglrc);
+        InterlockedExchange(&old_ctx->thread_id, 0);
+#ifdef OPENGL32_USE_TLS
+        {
+            struct Opengl32_ThreadData* thread_data = TlsGetValue(OglTlsIndex);
+            
+            thread_data->hglrc = NULL;
+            thread_data->hdc = NULL;
+            thread_data->dc_data = NULL;
+        }
+#endif
+        /* Reset the no-op table */
+        set_api_table(&StubTable);
+        /* Test conformance (extreme cases) */
+        return hglrc == NULL;
+    }
+    else
+    {
+        /* Winetest conformance */
+        if (GetObjectType( hdc ) != OBJ_DC && GetObjectType( hdc ) != OBJ_MEMDC)
+        {
+            ERR( "Error: hdc is not a DC handle!\n");
+            SetLastError( ERROR_INVALID_HANDLE );
+            return FALSE;
+        }
+    }
+
+    return TRUE;
+}
+
+BOOL WINAPI wglRealizeLayerPalette(HDC hdc,
+                                   int iLayerPlane,
+                                   BOOL bRealize)
+{
+    struct wgl_dc_data* dc_data = get_dc_data(hdc);
+    
+    if(!dc_data)
+    {
+        SetLastError(ERROR_INVALID_HANDLE);
+        return FALSE;
+    }
+    
+    if(!dc_data->pixelformat)
+    {
+        SetLastError(ERROR_INVALID_PIXEL_FORMAT);
+        return FALSE;
+    }
+    
+    if(dc_data->icd_data)
+        return dc_data->icd_data->DrvRealizeLayerPalette(hdc, iLayerPlane, bRealize);
+    
+    /* SW implementation doesn't support this */
+    return FALSE;
+}
+
+int WINAPI wglSetLayerPaletteEntries(HDC hdc,
+                                     int iLayerPlane,
+                                     int iStart,
+                                     int cEntries,
+                                     const COLORREF *pcr)
+{
+    struct wgl_dc_data* dc_data = get_dc_data(hdc);
+    
+    if(!dc_data)
+    {
+        SetLastError(ERROR_INVALID_HANDLE);
+        return 0;
+    }
+    
+    if(!dc_data->pixelformat)
+    {
+        SetLastError(ERROR_INVALID_PIXEL_FORMAT);
+        return 0;
+    }
+    
+    if(dc_data->icd_data)
+        return dc_data->icd_data->DrvSetLayerPaletteEntries(hdc, iLayerPlane, iStart, cEntries, pcr);
+    
+    /* SW implementation doesn't support this */
+    return 0;
+}
+
+BOOL WINAPI wglSetPixelFormat(HDC hdc, INT format, const PIXELFORMATDESCRIPTOR *descr)
+{
+    struct wgl_dc_data* dc_data = get_dc_data(hdc);
+    INT sw_format;
+    BOOL ret;
+    
+    if(!dc_data)
+    {
+        SetLastError(ERROR_INVALID_HANDLE);
+        return FALSE;
+    }
+    
+    if(!format)
+    {
+        SetLastError(ERROR_INVALID_PARAMETER);
+        return FALSE;
+    }
+
+    if(dc_data->pixelformat)
+    {
+        return (format == dc_data->pixelformat);
+    }
+    
+    if(format <= dc_data->nb_icd_formats)
+    {
+        ret = dc_data->icd_data->DrvSetPixelFormat(hdc, format);
+        if(ret)
+        {
+            dc_data->pixelformat = format;
+            return TRUE;
+        }
+    }
+    
+    sw_format = format - dc_data->nb_icd_formats;
+    if(sw_format <= dc_data->nb_sw_formats)
+    {
+        ret = sw_SetPixelFormat(dc_data, sw_format);
+        if(ret)
+        {
+            /* This is now officially a software-only HDC */
+            dc_data->icd_data = NULL;
+            dc_data->pixelformat = format;
+            return TRUE;
+        }
+    }
+
+    SetLastError(ERROR_INVALID_PARAMETER);
+    return FALSE;
+}
+
+BOOL WINAPI wglShareLists(HGLRC hglrcSrc, HGLRC hglrcDst)
+{
+    struct wgl_context* ctx_src = get_context(hglrcSrc);
+    struct wgl_context* ctx_dst = get_context(hglrcDst);
+    
+    if(!ctx_src || !ctx_dst)
+    {
+        SetLastError(ERROR_INVALID_HANDLE);
+        return FALSE;
+    }
+    
+    /* Check this is the same pixel format */
+    if((ctx_dst->icd_data != ctx_src->icd_data) ||
+        (ctx_dst->pixelformat != ctx_src->pixelformat))
+    {
+        SetLastError(ERROR_INVALID_PIXEL_FORMAT);
+        return FALSE;
+    }
+    
+    if(ctx_src->icd_data)
+        return ctx_src->icd_data->DrvShareLists(ctx_src->dhglrc, ctx_dst->dhglrc);
+    
+    return sw_ShareLists(ctx_src->dhglrc, ctx_dst->dhglrc);
+}
+
+BOOL WINAPI wglSwapBuffers(HDC hdc)
+{
+    struct wgl_dc_data* dc_data = get_dc_data(hdc);
+    
+    if(!dc_data)
+    {
+        SetLastError(ERROR_INVALID_HANDLE);
+        return FALSE;
+    }
+    
+    if(!dc_data->pixelformat)
+    {
+        SetLastError(ERROR_INVALID_PIXEL_FORMAT);
+        return FALSE;
+    }
+    
+    if(dc_data->icd_data)
+        return dc_data->icd_data->DrvSwapBuffers(hdc);
+    
+    return sw_SwapBuffers(hdc, dc_data);
+}
+
+BOOL WINAPI wglSwapLayerBuffers(HDC hdc, UINT fuPlanes)
+{
+    return FALSE;
+}
+
+DWORD WINAPI wglSwapMultipleBuffers(UINT count, CONST WGLSWAP * toSwap)
+{
+    return 0;
+}
+
+BOOL WINAPI wglUseFontBitmapsA(HDC hdc, DWORD first, DWORD count, DWORD listBase)
+{
+    FIXME("stub.\n");
+    return FALSE;
+}
+
+BOOL WINAPI wglUseFontBitmapsW(HDC hdc, DWORD first, DWORD count, DWORD listBase)
+{
+    FIXME("stub.\n");
+    return FALSE;
+}
+
+BOOL WINAPI wglUseFontOutlinesA(HDC hdc,
+                               DWORD first,
+                               DWORD count,
+                               DWORD listBase,
+                               FLOAT deviation,
+                               FLOAT extrusion,
+                               int format,
+                               LPGLYPHMETRICSFLOAT lpgmf)
+{
+    return FALSE;
+}
+
+BOOL WINAPI wglUseFontOutlinesW(HDC hdc,
+                               DWORD first,
+                               DWORD count,
+                               DWORD listBase,
+                               FLOAT deviation,
+                               FLOAT extrusion,
+                               int format,
+                               LPGLYPHMETRICSFLOAT lpgmf)
+{
+    return FALSE;
+}