From: José Fonseca Date: Sun, 14 Nov 2010 00:35:05 +0000 (+0000) Subject: Basic Linux/GLX tracing support. X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=83178a01d2d20d308aa32d59db608abeb9874810;p=apitrace Basic Linux/GLX tracing support. --- diff --git a/.gitignore b/.gitignore index facbfdb..7fac701 100644 --- a/.gitignore +++ b/.gitignore @@ -14,8 +14,13 @@ *.pdb *.pyc *.pyo +*.so *.xml *.zip +CMakeFiles +CMakeCache.txt +cmake_install.cmake +Makefile MD5SUM config.log ddraw.cpp @@ -24,4 +29,5 @@ d3d9.cpp d3d10.cpp d3d10_1.cpp dxsdk +glx.cpp opengl32.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..accf9c3 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,91 @@ +cmake_minimum_required (VERSION 2.6) + +project (apitrace) + +find_package (PythonInterp REQUIRED) +find_package (OpenGL REQUIRED) + +find_package (ZLIB) + +if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") + # Nobody likes to include windows.h: + # - Microsoft's GL/gl.h header depends on windows.h but doesn't include it; + # - GLEW temporarily defines the necessary defines but undefines them later + # - certain GLUT distributions don't include it; + # - most of our programs are meant to be portable so don't include it. + # + # We could try to replicate the windows.h definitions required by + # GL/gl.h, but the build time savings don't compensate the constant + # headaches that brings, so instead we force windows.h to be included + # on every file. + if (MSVC) + add_definitions (-FIwindows.h) + else (MSVC) + add_definitions (--include windows.h) + endif (MSVC) + + # MSVC & MinGW only define & use APIENTRY + add_definitions (-DGLAPIENTRY=__stdcall) + + link_libraries (winmm) +endif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") + +if (MSVC) + # Enable math constants defines + add_definitions (-D_USE_MATH_DEFINES) + + # Silence several MSVC pedantic warnings + add_definitions (-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS) + add_definitions (-D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS) +endif (MSVC) + +# Use bundled ZLIB if system one can't be found +if (NOT ZLIB_FOUND) + add_library (zlib STATIC + zlib/adler32.c + zlib/compress.c + zlib/crc32.c + zlib/gzio.c + zlib/uncompr.c + zlib/deflate.c + zlib/trees.c + zlib/zutil.c + zlib/inflate.c + zlib/infback.c + zlib/inftrees.c + zlib/inffast.c + ) + + include_directories (zlib) + link_libraries (zlib) +else (NOT ZLIB_FOUND) + include_directories (${ZLIB_INCLUDE_DIRS}) + link_libraries (${ZLIB_LIBRARIES}) +endif (NOT ZLIB_FOUND) + +include_directories (${CMAKE_CURRENT_SOURCE_DIR}) + +if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") + + # opengl32.dll + add_custom_command ( + OUTPUT opengl32.cpp + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/opengl32.py > ${CMAKE_CURRENT_BINARY_DIR}/opengl32.cpp + DEPENDS opengl32.py gl.py windows.py base.py + ) + add_library (opengl32 SHARED opengl32.def opengl32.cpp log.cpp) + set_target_properties (opengl32 PROPERTIES PREFIX "") + +else () + + # libGL.so + add_custom_command ( + OUTPUT glx.cpp + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glx.py > ${CMAKE_CURRENT_BINARY_DIR}/glx.cpp + DEPENDS glx.py gl.py dl.py base.py + ) + add_library (glxtrace SHARED glx.cpp log.cpp) + set_target_properties (glxtrace PROPERTIES PREFIX "") + target_link_libraries (glxtrace dl) +endif () + diff --git a/base.py b/base.py index 98d2ded..d6ed0a2 100644 --- a/base.py +++ b/base.py @@ -332,6 +332,9 @@ class Function: def get_true_pointer(self): raise NotImplementedError + def exit_impl(self): + print ' ExitProcess(0);' + def fail_impl(self): if self.fail is not None: if self.type is Void: @@ -341,7 +344,7 @@ class Function: assert self.fail != '' print ' return %s;' % self.fail else: - print ' ExitProcess(0);' + self.exit_impl() def wrap_impl(self): pvalue = self.pointer_value() diff --git a/dl.py b/dl.py new file mode 100644 index 0000000..14b8b9f --- /dev/null +++ b/dl.py @@ -0,0 +1,82 @@ +########################################################################## +# +# Copyright 2008-2010 VMware, Inc. +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +# +##########################################################################/ + +"""dl""" + +from base import * + +class DllFunction(Function): + + def __init__(self, type, name, args, call = '', fail = None): + Function.__init__(self, type, name, args, call=call, fail=fail) + + def exit_impl(self): + print ' exit(0);' + + def get_true_pointer(self): + ptype = self.pointer_type() + pvalue = self.pointer_value() + print ' if(!%s) {' % (pvalue,) + print ' %s = (%s)dlsym(RTLD_NEXT, "%s");' % (pvalue, ptype, self.name) + print ' if(!%s)' % (pvalue,) + self.fail_impl() + print ' }' + + +class Dll: + + def __init__(self, name): + self.name = name + self.functions = [] + if self not in towrap: + towrap.append(self) + + def wrap_name(self): + return "Wrap" + self.name + + def wrap_pre_decl(self): + pass + + def wrap_decl(self): + for function in self.functions: + function.wrap_decl() + print + + def wrap_impl(self): + for function in self.functions: + function.wrap_impl() + print + print ''' +static void _init(void) __attribute__((constructor)); +static void _init(void) {''' + print r' Log::Open("%s");' % self.name + print '''} + +static void _uninit(void) __attribute__((destructor)); +static void _uninit(void) { + Log::Close(); +} +''' + diff --git a/glx.py b/glx.py new file mode 100644 index 0000000..4ed6226 --- /dev/null +++ b/glx.py @@ -0,0 +1,876 @@ +########################################################################## +# +# Copyright 2008-2009 VMware, Inc. +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +# +##########################################################################/ + +from gl import * +from dl import * + +libgl = Dll("libGL.so") +libgl.functions += [ + DllFunction(Void, "glNewList", [(GLuint, "list"), (GLenum, "mode")]), + DllFunction(Void, "glEndList", []), + DllFunction(Void, "glCallList", [(GLuint, "list")]), + DllFunction(Void, "glCallLists", [(GLsizei, "n"), (GLenum, "type"), (Pointer(Const(GLvoid)), "lists")]), + DllFunction(Void, "glDeleteLists", [(GLuint, "list"), (GLsizei, "range")]), + DllFunction(GLuint, "glGenLists", [(GLsizei, "range")]), + DllFunction(Void, "glListBase", [(GLuint, "base")]), + DllFunction(Void, "glBegin", [(GLprimenum, "mode")]), + DllFunction(Void, "glBitmap", [(GLsizei, "width"), (GLsizei, "height"), (GLfloat, "xorig"), (GLfloat, "yorig"), (GLfloat, "xmove"), (GLfloat, "ymove"), (Pointer(Const(GLubyte)), "bitmap")]), + DllFunction(Void, "glColor3b", [(GLbyte, "red"), (GLbyte, "green"), (GLbyte, "blue")]), + DllFunction(Void, "glColor3bv", [(Pointer(Const(GLbyte)), "v")]), + DllFunction(Void, "glColor3d", [(GLdouble, "red"), (GLdouble, "green"), (GLdouble, "blue")]), + DllFunction(Void, "glColor3dv", [(Pointer(Const(GLdouble)), "v")]), + DllFunction(Void, "glColor3f", [(GLfloat, "red"), (GLfloat, "green"), (GLfloat, "blue")]), + DllFunction(Void, "glColor3fv", [(Array(Const(GLfloat), "3"), "v")]), + DllFunction(Void, "glColor3i", [(GLint, "red"), (GLint, "green"), (GLint, "blue")]), + DllFunction(Void, "glColor3iv", [(Pointer(Const(GLint)), "v")]), + DllFunction(Void, "glColor3s", [(GLshort, "red"), (GLshort, "green"), (GLshort, "blue")]), + DllFunction(Void, "glColor3sv", [(Pointer(Const(GLshort)), "v")]), + DllFunction(Void, "glColor3ub", [(GLubyte, "red"), (GLubyte, "green"), (GLubyte, "blue")]), + DllFunction(Void, "glColor3ubv", [(Pointer(Const(GLubyte)), "v")]), + DllFunction(Void, "glColor3ui", [(GLuint, "red"), (GLuint, "green"), (GLuint, "blue")]), + DllFunction(Void, "glColor3uiv", [(Pointer(Const(GLuint)), "v")]), + DllFunction(Void, "glColor3us", [(GLushort, "red"), (GLushort, "green"), (GLushort, "blue")]), + DllFunction(Void, "glColor3usv", [(Pointer(Const(GLushort)), "v")]), + DllFunction(Void, "glColor4b", [(GLbyte, "red"), (GLbyte, "green"), (GLbyte, "blue"), (GLbyte, "alpha")]), + DllFunction(Void, "glColor4bv", [(Pointer(Const(GLbyte)), "v")]), + DllFunction(Void, "glColor4d", [(GLdouble, "red"), (GLdouble, "green"), (GLdouble, "blue"), (GLdouble, "alpha")]), + DllFunction(Void, "glColor4dv", [(Pointer(Const(GLdouble)), "v")]), + DllFunction(Void, "glColor4f", [(GLfloat, "red"), (GLfloat, "green"), (GLfloat, "blue"), (GLfloat, "alpha")]), + DllFunction(Void, "glColor4fv", [(Pointer(Const(GLfloat)), "v")]), + DllFunction(Void, "glColor4i", [(GLint, "red"), (GLint, "green"), (GLint, "blue"), (GLint, "alpha")]), + DllFunction(Void, "glColor4iv", [(Pointer(Const(GLint)), "v")]), + DllFunction(Void, "glColor4s", [(GLshort, "red"), (GLshort, "green"), (GLshort, "blue"), (GLshort, "alpha")]), + DllFunction(Void, "glColor4sv", [(Pointer(Const(GLshort)), "v")]), + DllFunction(Void, "glColor4ub", [(GLubyte, "red"), (GLubyte, "green"), (GLubyte, "blue"), (GLubyte, "alpha")]), + DllFunction(Void, "glColor4ubv", [(Pointer(Const(GLubyte)), "v")]), + DllFunction(Void, "glColor4ui", [(GLuint, "red"), (GLuint, "green"), (GLuint, "blue"), (GLuint, "alpha")]), + DllFunction(Void, "glColor4uiv", [(Pointer(Const(GLuint)), "v")]), + DllFunction(Void, "glColor4us", [(GLushort, "red"), (GLushort, "green"), (GLushort, "blue"), (GLushort, "alpha")]), + DllFunction(Void, "glColor4usv", [(Pointer(Const(GLushort)), "v")]), + DllFunction(Void, "glEdgeFlag", [(GLboolean, "flag")]), + DllFunction(Void, "glEdgeFlagv", [(Pointer(Const(GLboolean)), "flag")]), + DllFunction(Void, "glEnd", []), + DllFunction(Void, "glIndexd", [(GLdouble, "c")]), + DllFunction(Void, "glIndexdv", [(Pointer(Const(GLdouble)), "c")]), + DllFunction(Void, "glIndexf", [(GLfloat, "c")]), + DllFunction(Void, "glIndexfv", [(Pointer(Const(GLfloat)), "c")]), + DllFunction(Void, "glIndexi", [(GLint, "c")]), + DllFunction(Void, "glIndexiv", [(Pointer(Const(GLint)), "c")]), + DllFunction(Void, "glIndexs", [(GLshort, "c")]), + DllFunction(Void, "glIndexsv", [(Pointer(Const(GLshort)), "c")]), + DllFunction(Void, "glNormal3b", [(GLbyte, "nx"), (GLbyte, "ny"), (GLbyte, "nz")]), + DllFunction(Void, "glNormal3bv", [(Pointer(Const(GLbyte)), "v")]), + DllFunction(Void, "glNormal3d", [(GLdouble, "nx"), (GLdouble, "ny"), (GLdouble, "nz")]), + DllFunction(Void, "glNormal3dv", [(Pointer(Const(GLdouble)), "v")]), + DllFunction(Void, "glNormal3f", [(GLfloat, "nx"), (GLfloat, "ny"), (GLfloat, "nz")]), + DllFunction(Void, "glNormal3fv", [(Pointer(Const(GLfloat)), "v")]), + DllFunction(Void, "glNormal3i", [(GLint, "nx"), (GLint, "ny"), (GLint, "nz")]), + DllFunction(Void, "glNormal3iv", [(Pointer(Const(GLint)), "v")]), + DllFunction(Void, "glNormal3s", [(GLshort, "nx"), (GLshort, "ny"), (GLshort, "nz")]), + DllFunction(Void, "glNormal3sv", [(Pointer(Const(GLshort)), "v")]), + DllFunction(Void, "glRasterPos2d", [(GLdouble, "x"), (GLdouble, "y")]), + DllFunction(Void, "glRasterPos2dv", [(Pointer(Const(GLdouble)), "v")]), + DllFunction(Void, "glRasterPos2f", [(GLfloat, "x"), (GLfloat, "y")]), + DllFunction(Void, "glRasterPos2fv", [(Pointer(Const(GLfloat)), "v")]), + DllFunction(Void, "glRasterPos2i", [(GLint, "x"), (GLint, "y")]), + DllFunction(Void, "glRasterPos2iv", [(Pointer(Const(GLint)), "v")]), + DllFunction(Void, "glRasterPos2s", [(GLshort, "x"), (GLshort, "y")]), + DllFunction(Void, "glRasterPos2sv", [(Pointer(Const(GLshort)), "v")]), + DllFunction(Void, "glRasterPos3d", [(GLdouble, "x"), (GLdouble, "y"), (GLdouble, "z")]), + DllFunction(Void, "glRasterPos3dv", [(Pointer(Const(GLdouble)), "v")]), + DllFunction(Void, "glRasterPos3f", [(GLfloat, "x"), (GLfloat, "y"), (GLfloat, "z")]), + DllFunction(Void, "glRasterPos3fv", [(Pointer(Const(GLfloat)), "v")]), + DllFunction(Void, "glRasterPos3i", [(GLint, "x"), (GLint, "y"), (GLint, "z")]), + DllFunction(Void, "glRasterPos3iv", [(Pointer(Const(GLint)), "v")]), + DllFunction(Void, "glRasterPos3s", [(GLshort, "x"), (GLshort, "y"), (GLshort, "z")]), + DllFunction(Void, "glRasterPos3sv", [(Pointer(Const(GLshort)), "v")]), + DllFunction(Void, "glRasterPos4d", [(GLdouble, "x"), (GLdouble, "y"), (GLdouble, "z"), (GLdouble, "w")]), + DllFunction(Void, "glRasterPos4dv", [(Pointer(Const(GLdouble)), "v")]), + DllFunction(Void, "glRasterPos4f", [(GLfloat, "x"), (GLfloat, "y"), (GLfloat, "z"), (GLfloat, "w")]), + DllFunction(Void, "glRasterPos4fv", [(Pointer(Const(GLfloat)), "v")]), + DllFunction(Void, "glRasterPos4i", [(GLint, "x"), (GLint, "y"), (GLint, "z"), (GLint, "w")]), + DllFunction(Void, "glRasterPos4iv", [(Pointer(Const(GLint)), "v")]), + DllFunction(Void, "glRasterPos4s", [(GLshort, "x"), (GLshort, "y"), (GLshort, "z"), (GLshort, "w")]), + DllFunction(Void, "glRasterPos4sv", [(Pointer(Const(GLshort)), "v")]), + DllFunction(Void, "glRectd", [(GLdouble, "x1"), (GLdouble, "y1"), (GLdouble, "x2"), (GLdouble, "y2")]), + DllFunction(Void, "glRectdv", [(Pointer(Const(GLdouble)), "v1"), (Pointer(Const(GLdouble)), "v2")]), + DllFunction(Void, "glRectf", [(GLfloat, "x1"), (GLfloat, "y1"), (GLfloat, "x2"), (GLfloat, "y2")]), + DllFunction(Void, "glRectfv", [(Pointer(Const(GLfloat)), "v1"), (Pointer(Const(GLfloat)), "v2")]), + DllFunction(Void, "glRecti", [(GLint, "x1"), (GLint, "y1"), (GLint, "x2"), (GLint, "y2")]), + DllFunction(Void, "glRectiv", [(Pointer(Const(GLint)), "v1"), (Pointer(Const(GLint)), "v2")]), + DllFunction(Void, "glRects", [(GLshort, "x1"), (GLshort, "y1"), (GLshort, "x2"), (GLshort, "y2")]), + DllFunction(Void, "glRectsv", [(Pointer(Const(GLshort)), "v1"), (Pointer(Const(GLshort)), "v2")]), + DllFunction(Void, "glTexCoord1d", [(GLdouble, "s")]), + DllFunction(Void, "glTexCoord1dv", [(Pointer(Const(GLdouble)), "v")]), + DllFunction(Void, "glTexCoord1f", [(GLfloat, "s")]), + DllFunction(Void, "glTexCoord1fv", [(Pointer(Const(GLfloat)), "v")]), + DllFunction(Void, "glTexCoord1i", [(GLint, "s")]), + DllFunction(Void, "glTexCoord1iv", [(Pointer(Const(GLint)), "v")]), + DllFunction(Void, "glTexCoord1s", [(GLshort, "s")]), + DllFunction(Void, "glTexCoord1sv", [(Pointer(Const(GLshort)), "v")]), + DllFunction(Void, "glTexCoord2d", [(GLdouble, "s"), (GLdouble, "t")]), + DllFunction(Void, "glTexCoord2dv", [(Pointer(Const(GLdouble)), "v")]), + DllFunction(Void, "glTexCoord2f", [(GLfloat, "s"), (GLfloat, "t")]), + DllFunction(Void, "glTexCoord2fv", [(Pointer(Const(GLfloat)), "v")]), + DllFunction(Void, "glTexCoord2i", [(GLint, "s"), (GLint, "t")]), + DllFunction(Void, "glTexCoord2iv", [(Pointer(Const(GLint)), "v")]), + DllFunction(Void, "glTexCoord2s", [(GLshort, "s"), (GLshort, "t")]), + DllFunction(Void, "glTexCoord2sv", [(Pointer(Const(GLshort)), "v")]), + DllFunction(Void, "glTexCoord3d", [(GLdouble, "s"), (GLdouble, "t"), (GLdouble, "r")]), + DllFunction(Void, "glTexCoord3dv", [(Pointer(Const(GLdouble)), "v")]), + DllFunction(Void, "glTexCoord3f", [(GLfloat, "s"), (GLfloat, "t"), (GLfloat, "r")]), + DllFunction(Void, "glTexCoord3fv", [(Pointer(Const(GLfloat)), "v")]), + DllFunction(Void, "glTexCoord3i", [(GLint, "s"), (GLint, "t"), (GLint, "r")]), + DllFunction(Void, "glTexCoord3iv", [(Pointer(Const(GLint)), "v")]), + DllFunction(Void, "glTexCoord3s", [(GLshort, "s"), (GLshort, "t"), (GLshort, "r")]), + DllFunction(Void, "glTexCoord3sv", [(Pointer(Const(GLshort)), "v")]), + DllFunction(Void, "glTexCoord4d", [(GLdouble, "s"), (GLdouble, "t"), (GLdouble, "r"), (GLdouble, "q")]), + DllFunction(Void, "glTexCoord4dv", [(Pointer(Const(GLdouble)), "v")]), + DllFunction(Void, "glTexCoord4f", [(GLfloat, "s"), (GLfloat, "t"), (GLfloat, "r"), (GLfloat, "q")]), + DllFunction(Void, "glTexCoord4fv", [(Pointer(Const(GLfloat)), "v")]), + DllFunction(Void, "glTexCoord4i", [(GLint, "s"), (GLint, "t"), (GLint, "r"), (GLint, "q")]), + DllFunction(Void, "glTexCoord4iv", [(Pointer(Const(GLint)), "v")]), + DllFunction(Void, "glTexCoord4s", [(GLshort, "s"), (GLshort, "t"), (GLshort, "r"), (GLshort, "q")]), + DllFunction(Void, "glTexCoord4sv", [(Pointer(Const(GLshort)), "v")]), + DllFunction(Void, "glVertex2d", [(GLdouble, "x"), (GLdouble, "y")]), + DllFunction(Void, "glVertex2dv", [(Pointer(Const(GLdouble)), "v")]), + DllFunction(Void, "glVertex2f", [(GLfloat, "x"), (GLfloat, "y")]), + DllFunction(Void, "glVertex2fv", [(Pointer(Const(GLfloat)), "v")]), + DllFunction(Void, "glVertex2i", [(GLint, "x"), (GLint, "y")]), + DllFunction(Void, "glVertex2iv", [(Pointer(Const(GLint)), "v")]), + DllFunction(Void, "glVertex2s", [(GLshort, "x"), (GLshort, "y")]), + DllFunction(Void, "glVertex2sv", [(Pointer(Const(GLshort)), "v")]), + DllFunction(Void, "glVertex3d", [(GLdouble, "x"), (GLdouble, "y"), (GLdouble, "z")]), + DllFunction(Void, "glVertex3dv", [(Pointer(Const(GLdouble)), "v")]), + DllFunction(Void, "glVertex3f", [(GLfloat, "x"), (GLfloat, "y"), (GLfloat, "z")]), + DllFunction(Void, "glVertex3fv", [(Pointer(Const(GLfloat)), "v")]), + DllFunction(Void, "glVertex3i", [(GLint, "x"), (GLint, "y"), (GLint, "z")]), + DllFunction(Void, "glVertex3iv", [(Pointer(Const(GLint)), "v")]), + DllFunction(Void, "glVertex3s", [(GLshort, "x"), (GLshort, "y"), (GLshort, "z")]), + DllFunction(Void, "glVertex3sv", [(Pointer(Const(GLshort)), "v")]), + DllFunction(Void, "glVertex4d", [(GLdouble, "x"), (GLdouble, "y"), (GLdouble, "z"), (GLdouble, "w")]), + DllFunction(Void, "glVertex4dv", [(Pointer(Const(GLdouble)), "v")]), + DllFunction(Void, "glVertex4f", [(GLfloat, "x"), (GLfloat, "y"), (GLfloat, "z"), (GLfloat, "w")]), + DllFunction(Void, "glVertex4fv", [(Pointer(Const(GLfloat)), "v")]), + DllFunction(Void, "glVertex4i", [(GLint, "x"), (GLint, "y"), (GLint, "z"), (GLint, "w")]), + DllFunction(Void, "glVertex4iv", [(Pointer(Const(GLint)), "v")]), + DllFunction(Void, "glVertex4s", [(GLshort, "x"), (GLshort, "y"), (GLshort, "z"), (GLshort, "w")]), + DllFunction(Void, "glVertex4sv", [(Pointer(Const(GLshort)), "v")]), + DllFunction(Void, "glClipPlane", [(GLenum, "plane"), (Pointer(Const(GLdouble)), "equation")]), + DllFunction(Void, "glColorMaterial", [(GLenum, "face"), (GLenum, "mode")]), + DllFunction(Void, "glCullFace", [(GLenum, "mode")]), + DllFunction(Void, "glFogf", [(GLenum, "pname"), (GLfloat, "param")]), + DllFunction(Void, "glFogfv", [(GLenum, "pname"), (Pointer(Const(GLfloat)), "params")]), + DllFunction(Void, "glFogi", [(GLenum, "pname"), (GLint, "param")]), + DllFunction(Void, "glFogiv", [(GLenum, "pname"), (Pointer(Const(GLint)), "params")]), + DllFunction(Void, "glFrontFace", [(GLenum, "mode")]), + DllFunction(Void, "glHint", [(GLenum, "target"), (GLenum, "mode")]), + DllFunction(Void, "glLightf", [(GLenum, "light"), (GLenum, "pname"), (GLfloat, "param")]), + DllFunction(Void, "glLightfv", [(GLenum, "light"), (GLenum, "pname"), (Pointer(Const(GLfloat)), "params")]), + DllFunction(Void, "glLighti", [(GLenum, "light"), (GLenum, "pname"), (GLint, "param")]), + DllFunction(Void, "glLightiv", [(GLenum, "light"), (GLenum, "pname"), (Pointer(Const(GLint)), "params")]), + DllFunction(Void, "glLightModelf", [(GLenum, "pname"), (GLfloat, "param")]), + DllFunction(Void, "glLightModelfv", [(GLenum, "pname"), (Pointer(Const(GLfloat)), "params")]), + DllFunction(Void, "glLightModeli", [(GLenum, "pname"), (GLint, "param")]), + DllFunction(Void, "glLightModeliv", [(GLenum, "pname"), (Pointer(Const(GLint)), "params")]), + DllFunction(Void, "glLineStipple", [(GLint, "factor"), (GLushort, "pattern")]), + DllFunction(Void, "glLineWidth", [(GLfloat, "width")]), + DllFunction(Void, "glMaterialf", [(GLenum, "face"), (GLenum, "pname"), (GLfloat, "param")]), + DllFunction(Void, "glMaterialfv", [(GLenum, "face"), (GLenum, "pname"), (Pointer(Const(GLfloat)), "params")]), + DllFunction(Void, "glMateriali", [(GLenum, "face"), (GLenum, "pname"), (GLint, "param")]), + DllFunction(Void, "glMaterialiv", [(GLenum, "face"), (GLenum, "pname"), (Pointer(Const(GLint)), "params")]), + DllFunction(Void, "glPointSize", [(GLfloat, "size")]), + DllFunction(Void, "glPolygonMode", [(GLenum, "face"), (GLenum, "mode")]), + DllFunction(Void, "glPolygonStipple", [(Pointer(Const(GLubyte)), "mask")]), + DllFunction(Void, "glScissor", [(GLint, "x"), (GLint, "y"), (GLsizei, "width"), (GLsizei, "height")]), + DllFunction(Void, "glShadeModel", [(GLenum, "mode")]), + DllFunction(Void, "glTexParameterf", [(GLenum, "target"), (GLenum, "pname"), (GLfloat, "param")]), + DllFunction(Void, "glTexParameterfv", [(GLenum, "target"), (GLenum, "pname"), (Pointer(Const(GLfloat)), "params")]), + DllFunction(Void, "glTexParameteri", [(GLenum, "target"), (GLenum, "pname"), (GLint, "param")]), + DllFunction(Void, "glTexParameteriv", [(GLenum, "target"), (GLenum, "pname"), (Pointer(Const(GLint)), "params")]), + DllFunction(Void, "glTexImage1D", [(GLenum, "target"), (GLint, "level"), (GLint, "internalformat"), (GLsizei, "width"), (GLint, "border"), (GLenum, "format"), (GLenum, "type"), (Pointer(Const(GLvoid)), "pixels")]), + DllFunction(Void, "glTexImage2D", [(GLenum, "target"), (GLint, "level"), (GLint, "internalformat"), (GLsizei, "width"), (GLsizei, "height"), (GLint, "border"), (GLenum, "format"), (GLenum, "type"), (Pointer(Const(GLvoid)), "pixels")]), + DllFunction(Void, "glTexEnvf", [(GLenum, "target"), (GLenum, "pname"), (GLfloat, "param")]), + DllFunction(Void, "glTexEnvfv", [(GLenum, "target"), (GLenum, "pname"), (Pointer(Const(GLfloat)), "params")]), + DllFunction(Void, "glTexEnvi", [(GLenum, "target"), (GLenum, "pname"), (GLint, "param")]), + DllFunction(Void, "glTexEnviv", [(GLenum, "target"), (GLenum, "pname"), (Pointer(Const(GLint)), "params")]), + DllFunction(Void, "glTexGend", [(GLenum, "coord"), (GLenum, "pname"), (GLdouble, "param")]), + DllFunction(Void, "glTexGendv", [(GLenum, "coord"), (GLenum, "pname"), (Pointer(Const(GLdouble)), "params")]), + DllFunction(Void, "glTexGenf", [(GLenum, "coord"), (GLenum, "pname"), (GLfloat, "param")]), + DllFunction(Void, "glTexGenfv", [(GLenum, "coord"), (GLenum, "pname"), (Pointer(Const(GLfloat)), "params")]), + DllFunction(Void, "glTexGeni", [(GLenum, "coord"), (GLenum, "pname"), (GLint, "param")]), + DllFunction(Void, "glTexGeniv", [(GLenum, "coord"), (GLenum, "pname"), (Pointer(Const(GLint)), "params")]), + DllFunction(Void, "glFeedbackBuffer", [(GLsizei, "size"), (GLenum, "type"), (OutPointer(GLfloat), "buffer")]), + DllFunction(Void, "glSelectBuffer", [(GLsizei, "size"), (OutPointer(GLuint), "buffer")]), + DllFunction(GLint, "glRenderMode", [(GLenum, "mode")]), + DllFunction(Void, "glInitNames", []), + DllFunction(Void, "glLoadName", [(GLuint, "name")]), + DllFunction(Void, "glPassThrough", [(GLfloat, "token")]), + DllFunction(Void, "glPopName", []), + DllFunction(Void, "glPushName", [(GLuint, "name")]), + DllFunction(Void, "glDrawBuffer", [(GLenum, "mode")]), + DllFunction(Void, "glClear", [(GLbufferbitfield, "mask")]), + DllFunction(Void, "glClearAccum", [(GLfloat, "red"), (GLfloat, "green"), (GLfloat, "blue"), (GLfloat, "alpha")]), + DllFunction(Void, "glClearIndex", [(GLfloat, "c")]), + DllFunction(Void, "glClearColor", [(GLclampf, "red"), (GLclampf, "green"), (GLclampf, "blue"), (GLclampf, "alpha")]), + DllFunction(Void, "glClearStencil", [(GLint, "s")]), + DllFunction(Void, "glClearDepth", [(GLclampd, "depth")]), + DllFunction(Void, "glStencilMask", [(GLuint, "mask")]), + DllFunction(Void, "glColorMask", [(GLboolean, "red"), (GLboolean, "green"), (GLboolean, "blue"), (GLboolean, "alpha")]), + DllFunction(Void, "glDepthMask", [(GLboolean, "flag")]), + DllFunction(Void, "glIndexMask", [(GLuint, "mask")]), + DllFunction(Void, "glAccum", [(GLenum, "op"), (GLfloat, "value")]), + DllFunction(Void, "glDisable", [(GLenum, "cap")]), + DllFunction(Void, "glEnable", [(GLenum, "cap")]), + DllFunction(Void, "glFinish", []), + DllFunction(Void, "glFlush", []), + DllFunction(Void, "glPopAttrib", []), + DllFunction(Void, "glPushAttrib", [(GLbitfield, "mask")]), + DllFunction(Void, "glMap1d", [(GLenum, "target"), (GLdouble, "u1"), (GLdouble, "u2"), (GLint, "stride"), (GLint, "order"), (Pointer(Const(GLdouble)), "points")]), + DllFunction(Void, "glMap1f", [(GLenum, "target"), (GLfloat, "u1"), (GLfloat, "u2"), (GLint, "stride"), (GLint, "order"), (Pointer(Const(GLfloat)), "points")]), + DllFunction(Void, "glMap2d", [(GLenum, "target"), (GLdouble, "u1"), (GLdouble, "u2"), (GLint, "ustride"), (GLint, "uorder"), (GLdouble, "v1"), (GLdouble, "v2"), (GLint, "vstride"), (GLint, "vorder"), (Pointer(Const(GLdouble)), "points")]), + DllFunction(Void, "glMap2f", [(GLenum, "target"), (GLfloat, "u1"), (GLfloat, "u2"), (GLint, "ustride"), (GLint, "uorder"), (GLfloat, "v1"), (GLfloat, "v2"), (GLint, "vstride"), (GLint, "vorder"), (Pointer(Const(GLfloat)), "points")]), + DllFunction(Void, "glMapGrid1d", [(GLint, "un"), (GLdouble, "u1"), (GLdouble, "u2")]), + DllFunction(Void, "glMapGrid1f", [(GLint, "un"), (GLfloat, "u1"), (GLfloat, "u2")]), + DllFunction(Void, "glMapGrid2d", [(GLint, "un"), (GLdouble, "u1"), (GLdouble, "u2"), (GLint, "vn"), (GLdouble, "v1"), (GLdouble, "v2")]), + DllFunction(Void, "glMapGrid2f", [(GLint, "un"), (GLfloat, "u1"), (GLfloat, "u2"), (GLint, "vn"), (GLfloat, "v1"), (GLfloat, "v2")]), + DllFunction(Void, "glEvalCoord1d", [(GLdouble, "u")]), + DllFunction(Void, "glEvalCoord1dv", [(Pointer(Const(GLdouble)), "u")]), + DllFunction(Void, "glEvalCoord1f", [(GLfloat, "u")]), + DllFunction(Void, "glEvalCoord1fv", [(Pointer(Const(GLfloat)), "u")]), + DllFunction(Void, "glEvalCoord2d", [(GLdouble, "u"), (GLdouble, "v")]), + DllFunction(Void, "glEvalCoord2dv", [(Pointer(Const(GLdouble)), "u")]), + DllFunction(Void, "glEvalCoord2f", [(GLfloat, "u"), (GLfloat, "v")]), + DllFunction(Void, "glEvalCoord2fv", [(Pointer(Const(GLfloat)), "u")]), + DllFunction(Void, "glEvalMesh1", [(GLenum, "mode"), (GLint, "i1"), (GLint, "i2")]), + DllFunction(Void, "glEvalPoint1", [(GLint, "i")]), + DllFunction(Void, "glEvalMesh2", [(GLenum, "mode"), (GLint, "i1"), (GLint, "i2"), (GLint, "j1"), (GLint, "j2")]), + DllFunction(Void, "glEvalPoint2", [(GLint, "i"), (GLint, "j")]), + DllFunction(Void, "glAlphaFunc", [(GLenum, "func"), (GLclampf, "ref")]), + DllFunction(Void, "glBlendFunc", [(GLenum, "sfactor"), (GLenum, "dfactor")]), + DllFunction(Void, "glLogicOp", [(GLenum, "opcode")]), + DllFunction(Void, "glStencilFunc", [(GLenum, "func"), (GLint, "ref"), (GLuint, "mask")]), + DllFunction(Void, "glStencilOp", [(GLenum, "fail"), (GLenum, "zfail"), (GLenum, "zpass")]), + DllFunction(Void, "glDepthFunc", [(GLenum, "func")]), + DllFunction(Void, "glPixelZoom", [(GLfloat, "xfactor"), (GLfloat, "yfactor")]), + DllFunction(Void, "glPixelTransferf", [(GLenum, "pname"), (GLfloat, "param")]), + DllFunction(Void, "glPixelTransferi", [(GLenum, "pname"), (GLint, "param")]), + DllFunction(Void, "glPixelStoref", [(GLenum, "pname"), (GLfloat, "param")]), + DllFunction(Void, "glPixelStorei", [(GLenum, "pname"), (GLint, "param")]), + DllFunction(Void, "glPixelMapfv", [(GLenum, "map"), (GLsizei, "mapsize"), (Pointer(Const(GLfloat)), "values")]), + DllFunction(Void, "glPixelMapuiv", [(GLenum, "map"), (GLsizei, "mapsize"), (Pointer(Const(GLuint)), "values")]), + DllFunction(Void, "glPixelMapusv", [(GLenum, "map"), (GLsizei, "mapsize"), (Pointer(Const(GLushort)), "values")]), + DllFunction(Void, "glReadBuffer", [(GLenum, "mode")]), + DllFunction(Void, "glCopyPixels", [(GLint, "x"), (GLint, "y"), (GLsizei, "width"), (GLsizei, "height"), (GLenum, "type")]), + DllFunction(Void, "glReadPixels", [(GLint, "x"), (GLint, "y"), (GLsizei, "width"), (GLsizei, "height"), (GLenum, "format"), (GLenum, "type"), (OutPointer(GLvoid), "pixels")]), + DllFunction(Void, "glDrawPixels", [(GLsizei, "width"), (GLsizei, "height"), (GLenum, "format"), (GLenum, "type"), (Pointer(Const(GLvoid)), "pixels")]), + DllFunction(Void, "glGetBooleanv", [(GLenum, "pname"), (OutPointer(GLboolean), "params")]), + DllFunction(Void, "glGetClipPlane", [(GLenum, "plane"), (OutPointer(GLdouble), "equation")]), + DllFunction(Void, "glGetDoublev", [(GLenum, "pname"), (OutPointer(GLdouble), "params")]), + DllFunction(GLenum, "glGetError", []), + DllFunction(Void, "glGetFloatv", [(GLenum, "pname"), (OutPointer(GLfloat), "params")]), + DllFunction(Void, "glGetIntegerv", [(GLenum, "pname"), (OutPointer(GLint), "params")]), + DllFunction(Void, "glGetLightfv", [(GLenum, "light"), (GLenum, "pname"), (OutPointer(GLfloat), "params")]), + DllFunction(Void, "glGetLightiv", [(GLenum, "light"), (GLenum, "pname"), (OutPointer(GLint), "params")]), + DllFunction(Void, "glGetMapdv", [(GLenum, "target"), (GLenum, "query"), (OutPointer(GLdouble), "v")]), + DllFunction(Void, "glGetMapfv", [(GLenum, "target"), (GLenum, "query"), (OutPointer(GLfloat), "v")]), + DllFunction(Void, "glGetMapiv", [(GLenum, "target"), (GLenum, "query"), (OutPointer(GLint), "v")]), + DllFunction(Void, "glGetMaterialfv", [(GLenum, "face"), (GLenum, "pname"), (OutPointer(GLfloat), "params")]), + DllFunction(Void, "glGetMaterialiv", [(GLenum, "face"), (GLenum, "pname"), (OutPointer(GLint), "params")]), + DllFunction(Void, "glGetPixelMapfv", [(GLenum, "map"), (OutPointer(GLfloat), "values")]), + DllFunction(Void, "glGetPixelMapuiv", [(GLenum, "map"), (OutPointer(GLuint), "values")]), + DllFunction(Void, "glGetPixelMapusv", [(GLenum, "map"), (OutPointer(GLushort), "values")]), + DllFunction(Void, "glGetPolygonStipple", [(OutPointer(GLubyte), "mask")]), + DllFunction(Alias("const GLubyte *", String), "glGetString", [(GLenum, "name")]), + DllFunction(Void, "glGetTexEnvfv", [(GLenum, "target"), (GLenum, "pname"), (OutPointer(GLfloat), "params")]), + DllFunction(Void, "glGetTexEnviv", [(GLenum, "target"), (GLenum, "pname"), (OutPointer(GLint), "params")]), + DllFunction(Void, "glGetTexGendv", [(GLenum, "coord"), (GLenum, "pname"), (OutPointer(GLdouble), "params")]), + DllFunction(Void, "glGetTexGenfv", [(GLenum, "coord"), (GLenum, "pname"), (OutPointer(GLfloat), "params")]), + DllFunction(Void, "glGetTexGeniv", [(GLenum, "coord"), (GLenum, "pname"), (OutPointer(GLint), "params")]), + DllFunction(Void, "glGetTexImage", [(GLenum, "target"), (GLint, "level"), (GLenum, "format"), (GLenum, "type"), (OutPointer(GLvoid), "pixels")]), + DllFunction(Void, "glGetTexParameterfv", [(GLenum, "target"), (GLenum, "pname"), (OutPointer(GLfloat), "params")]), + DllFunction(Void, "glGetTexParameteriv", [(GLenum, "target"), (GLenum, "pname"), (OutPointer(GLint), "params")]), + DllFunction(Void, "glGetTexLevelParameterfv", [(GLenum, "target"), (GLint, "level"), (GLenum, "pname"), (OutPointer(GLfloat), "params")]), + DllFunction(Void, "glGetTexLevelParameteriv", [(GLenum, "target"), (GLint, "level"), (GLenum, "pname"), (OutPointer(GLint), "params")]), + DllFunction(GLboolean, "glIsEnabled", [(GLenum, "cap")]), + DllFunction(GLboolean, "glIsList", [(GLuint, "list")]), + DllFunction(Void, "glDepthRange", [(GLclampd, "zNear"), (GLclampd, "zFar")]), + DllFunction(Void, "glFrustum", [(GLdouble, "left"), (GLdouble, "right"), (GLdouble, "bottom"), (GLdouble, "top"), (GLdouble, "zNear"), (GLdouble, "zFar")]), + DllFunction(Void, "glLoadIdentity", []), + DllFunction(Void, "glLoadMatrixf", [(Pointer(Const(GLfloat)), "m")]), + DllFunction(Void, "glLoadMatrixd", [(Pointer(Const(GLdouble)), "m")]), + DllFunction(Void, "glMatrixMode", [(GLenum, "mode")]), + DllFunction(Void, "glMultMatrixf", [(Pointer(Const(GLfloat)), "m")]), + DllFunction(Void, "glMultMatrixd", [(Pointer(Const(GLdouble)), "m")]), + DllFunction(Void, "glOrtho", [(GLdouble, "left"), (GLdouble, "right"), (GLdouble, "bottom"), (GLdouble, "top"), (GLdouble, "zNear"), (GLdouble, "zFar")]), + DllFunction(Void, "glPopMatrix", []), + DllFunction(Void, "glPushMatrix", []), + DllFunction(Void, "glRotated", [(GLdouble, "angle"), (GLdouble, "x"), (GLdouble, "y"), (GLdouble, "z")]), + DllFunction(Void, "glRotatef", [(GLfloat, "angle"), (GLfloat, "x"), (GLfloat, "y"), (GLfloat, "z")]), + DllFunction(Void, "glScaled", [(GLdouble, "x"), (GLdouble, "y"), (GLdouble, "z")]), + DllFunction(Void, "glScalef", [(GLfloat, "x"), (GLfloat, "y"), (GLfloat, "z")]), + DllFunction(Void, "glTranslated", [(GLdouble, "x"), (GLdouble, "y"), (GLdouble, "z")]), + DllFunction(Void, "glTranslatef", [(GLfloat, "x"), (GLfloat, "y"), (GLfloat, "z")]), + DllFunction(Void, "glViewport", [(GLint, "x"), (GLint, "y"), (GLsizei, "width"), (GLsizei, "height")]), + DllFunction(Void, "glArrayElement", [(GLint, "i")]), + DllFunction(Void, "glBindTexture", [(GLenum, "target"), (GLuint, "texture")]), + DllFunction(Void, "glColorPointer", [(GLint, "size"), (GLenum, "type"), (GLsizei, "stride"), (Pointer(Const(GLvoid)), "pointer")]), + DllFunction(Void, "glDisableClientState", [(GLenum, "array")]), + DllFunction(Void, "glDrawArrays", [(GLenum, "mode"), (GLint, "first"), (GLsizei, "count")]), + DllFunction(Void, "glDrawElements", [(GLenum, "mode"), (GLsizei, "count"), (GLenum, "type"), (Pointer(Const(GLvoid)), "indices")]), + DllFunction(Void, "glEdgeFlagPointer", [(GLsizei, "stride"), (Pointer(Const(GLvoid)), "pointer")]), + DllFunction(Void, "glEnableClientState", [(GLenum, "array")]), + DllFunction(Void, "glIndexPointer", [(GLenum, "type"), (GLsizei, "stride"), (Pointer(Const(GLvoid)), "pointer")]), + DllFunction(Void, "glIndexub", [(GLubyte, "c")]), + DllFunction(Void, "glIndexubv", [(Pointer(Const(GLubyte)), "c")]), + DllFunction(Void, "glInterleavedArrays", [(GLenum, "format"), (GLsizei, "stride"), (Pointer(Const(GLvoid)), "pointer")]), + DllFunction(Void, "glNormalPointer", [(GLenum, "type"), (GLsizei, "stride"), (Pointer(Const(GLvoid)), "pointer")]), + DllFunction(Void, "glPolygonOffset", [(GLfloat, "factor"), (GLfloat, "units")]), + DllFunction(Void, "glTexCoordPointer", [(GLint, "size"), (GLenum, "type"), (GLsizei, "stride"), (Pointer(Const(GLvoid)), "pointer")]), + DllFunction(Void, "glVertexPointer", [(GLint, "size"), (GLenum, "type"), (GLsizei, "stride"), (Pointer(Const(GLvoid)), "pointer")]), + DllFunction(GLboolean, "glAreTexturesResident", [(GLsizei, "n"), (Pointer(Const(GLuint)), "textures"), (OutPointer(GLboolean), "residences")]), + DllFunction(Void, "glCopyTexImage1D", [(GLenum, "target"), (GLint, "level"), (GLenum, "internalformat"), (GLint, "x"), (GLint, "y"), (GLsizei, "width"), (GLint, "border")]), + DllFunction(Void, "glCopyTexImage2D", [(GLenum, "target"), (GLint, "level"), (GLenum, "internalformat"), (GLint, "x"), (GLint, "y"), (GLsizei, "width"), (GLsizei, "height"), (GLint, "border")]), + DllFunction(Void, "glCopyTexSubImage1D", [(GLenum, "target"), (GLint, "level"), (GLint, "xoffset"), (GLint, "x"), (GLint, "y"), (GLsizei, "width")]), + DllFunction(Void, "glCopyTexSubImage2D", [(GLenum, "target"), (GLint, "level"), (GLint, "xoffset"), (GLint, "yoffset"), (GLint, "x"), (GLint, "y"), (GLsizei, "width"), (GLsizei, "height")]), + DllFunction(Void, "glDeleteTextures", [(GLsizei, "n"), (Pointer(Const(GLuint)), "textures")]), + DllFunction(Void, "glGenTextures", [(GLsizei, "n"), (OutPointer(GLuint), "textures")]), + DllFunction(Void, "glGetPointerv", [(GLenum, "pname"), (OutPointer(Pointer(GLvoid)), "params")]), + DllFunction(GLboolean, "glIsTexture", [(GLuint, "texture")]), + DllFunction(Void, "glPrioritizeTextures", [(GLsizei, "n"), (Pointer(Const(GLuint)), "textures"), (Pointer(Const(GLclampf)), "priorities")]), + DllFunction(Void, "glTexSubImage1D", [(GLenum, "target"), (GLint, "level"), (GLint, "xoffset"), (GLsizei, "width"), (GLenum, "format"), (GLenum, "type"), (Pointer(Const(GLvoid)), "pixels")]), + DllFunction(Void, "glTexSubImage2D", [(GLenum, "target"), (GLint, "level"), (GLint, "xoffset"), (GLint, "yoffset"), (GLsizei, "width"), (GLsizei, "height"), (GLenum, "format"), (GLenum, "type"), (Pointer(Const(GLvoid)), "pixels")]), + DllFunction(Void, "glPopClientAttrib", []), + DllFunction(Void, "glPushClientAttrib", [(GLbitfield, "mask")]), + DllFunction(Void, "glBlendColor", [(GLclampf, "red"), (GLclampf, "green"), (GLclampf, "blue"), (GLclampf, "alpha")]), + DllFunction(Void, "glBlendEquation", [(GLenum, "mode")]), + DllFunction(Void, "glDrawRangeElements", [(GLenum, "mode"), (GLuint, "start"), (GLuint, "end"), (GLsizei, "count"), (GLenum, "type"), (Pointer(Const(GLvoid)), "indices")]), + DllFunction(Void, "glColorTable", [(GLenum, "target"), (GLenum, "internalformat"), (GLsizei, "width"), (GLenum, "format"), (GLenum, "type"), (Pointer(Const(GLvoid)), "table")]), + DllFunction(Void, "glColorTableParameterfv", [(GLenum, "target"), (GLenum, "pname"), (Pointer(Const(GLfloat)), "params")]), + DllFunction(Void, "glColorTableParameteriv", [(GLenum, "target"), (GLenum, "pname"), (Pointer(Const(GLint)), "params")]), + DllFunction(Void, "glCopyColorTable", [(GLenum, "target"), (GLenum, "internalformat"), (GLint, "x"), (GLint, "y"), (GLsizei, "width")]), + DllFunction(Void, "glGetColorTable", [(GLenum, "target"), (GLenum, "format"), (GLenum, "type"), (Pointer(GLvoid), "table")]), + DllFunction(Void, "glGetColorTableParameterfv", [(GLenum, "target"), (GLenum, "pname"), (OutPointer(GLfloat), "params")]), + DllFunction(Void, "glGetColorTableParameteriv", [(GLenum, "target"), (GLenum, "pname"), (OutPointer(GLint), "params")]), + DllFunction(Void, "glColorSubTable", [(GLenum, "target"), (GLsizei, "start"), (GLsizei, "count"), (GLenum, "format"), (GLenum, "type"), (Pointer(Const(GLvoid)), "data")]), + DllFunction(Void, "glCopyColorSubTable", [(GLenum, "target"), (GLsizei, "start"), (GLint, "x"), (GLint, "y"), (GLsizei, "width")]), + DllFunction(Void, "glConvolutionFilter1D", [(GLenum, "target"), (GLenum, "internalformat"), (GLsizei, "width"), (GLenum, "format"), (GLenum, "type"), (Pointer(Const(GLvoid)), "image")]), + DllFunction(Void, "glConvolutionFilter2D", [(GLenum, "target"), (GLenum, "internalformat"), (GLsizei, "width"), (GLsizei, "height"), (GLenum, "format"), (GLenum, "type"), (Pointer(Const(GLvoid)), "image")]), + DllFunction(Void, "glConvolutionParameterf", [(GLenum, "target"), (GLenum, "pname"), (GLfloat, "params")]), + DllFunction(Void, "glConvolutionParameterfv", [(GLenum, "target"), (GLenum, "pname"), (Pointer(Const(GLfloat)), "params")]), + DllFunction(Void, "glConvolutionParameteri", [(GLenum, "target"), (GLenum, "pname"), (GLint, "params")]), + DllFunction(Void, "glConvolutionParameteriv", [(GLenum, "target"), (GLenum, "pname"), (Pointer(Const(GLint)), "params")]), + DllFunction(Void, "glCopyConvolutionFilter1D", [(GLenum, "target"), (GLenum, "internalformat"), (GLint, "x"), (GLint, "y"), (GLsizei, "width")]), + DllFunction(Void, "glCopyConvolutionFilter2D", [(GLenum, "target"), (GLenum, "internalformat"), (GLint, "x"), (GLint, "y"), (GLsizei, "width"), (GLsizei, "height")]), + DllFunction(Void, "glGetConvolutionFilter", [(GLenum, "target"), (GLenum, "format"), (GLenum, "type"), (Pointer(GLvoid), "image")]), + DllFunction(Void, "glGetConvolutionParameterfv", [(GLenum, "target"), (GLenum, "pname"), (OutPointer(GLfloat), "params")]), + DllFunction(Void, "glGetConvolutionParameteriv", [(GLenum, "target"), (GLenum, "pname"), (OutPointer(GLint), "params")]), + DllFunction(Void, "glGetSeparableFilter", [(GLenum, "target"), (GLenum, "format"), (GLenum, "type"), (Pointer(GLvoid), "row"), (Pointer(GLvoid), "column"), (Pointer(GLvoid), "span")]), + DllFunction(Void, "glSeparableFilter2D", [(GLenum, "target"), (GLenum, "internalformat"), (GLsizei, "width"), (GLsizei, "height"), (GLenum, "format"), (GLenum, "type"), (Pointer(Const(GLvoid)), "row"), (Pointer(Const(GLvoid)), "column")]), + DllFunction(Void, "glGetHistogram", [(GLenum, "target"), (GLboolean, "reset"), (GLenum, "format"), (GLenum, "type"), (Pointer(GLvoid), "values")]), + DllFunction(Void, "glGetHistogramParameterfv", [(GLenum, "target"), (GLenum, "pname"), (OutPointer(GLfloat), "params")]), + DllFunction(Void, "glGetHistogramParameteriv", [(GLenum, "target"), (GLenum, "pname"), (OutPointer(GLint), "params")]), + DllFunction(Void, "glGetMinmax", [(GLenum, "target"), (GLboolean, "reset"), (GLenum, "format"), (GLenum, "type"), (Pointer(GLvoid), "values")]), + DllFunction(Void, "glGetMinmaxParameterfv", [(GLenum, "target"), (GLenum, "pname"), (OutPointer(GLfloat), "params")]), + DllFunction(Void, "glGetMinmaxParameteriv", [(GLenum, "target"), (GLenum, "pname"), (OutPointer(GLint), "params")]), + DllFunction(Void, "glHistogram", [(GLenum, "target"), (GLsizei, "width"), (GLenum, "internalformat"), (GLboolean, "sink")]), + DllFunction(Void, "glMinmax", [(GLenum, "target"), (GLenum, "internalformat"), (GLboolean, "sink")]), + DllFunction(Void, "glResetHistogram", [(GLenum, "target")]), + DllFunction(Void, "glResetMinmax", [(GLenum, "target")]), + DllFunction(Void, "glTexImage3D", [(GLenum, "target"), (GLint, "level"), (GLint, "internalformat"), (GLsizei, "width"), (GLsizei, "height"), (GLsizei, "depth"), (GLint, "border"), (GLenum, "format"), (GLenum, "type"), (Pointer(Const(GLvoid)), "pixels")]), + DllFunction(Void, "glTexSubImage3D", [(GLenum, "target"), (GLint, "level"), (GLint, "xoffset"), (GLint, "yoffset"), (GLint, "zoffset"), (GLsizei, "width"), (GLsizei, "height"), (GLsizei, "depth"), (GLenum, "format"), (GLenum, "type"), (Pointer(Const(GLvoid)), "pixels")]), + DllFunction(Void, "glCopyTexSubImage3D", [(GLenum, "target"), (GLint, "level"), (GLint, "xoffset"), (GLint, "yoffset"), (GLint, "zoffset"), (GLint, "x"), (GLint, "y"), (GLsizei, "width"), (GLsizei, "height")]), + DllFunction(Void, "glActiveTextureARB", [(GLenum, "texture")]), + DllFunction(Void, "glClientActiveTextureARB", [(GLenum, "texture")]), + DllFunction(Void, "glMultiTexCoord1dARB", [(GLenum, "target"), (GLdouble, "s")]), + DllFunction(Void, "glMultiTexCoord1dvARB", [(GLenum, "target"), (Pointer(Const(GLdouble)), "v")]), + DllFunction(Void, "glMultiTexCoord1fARB", [(GLenum, "target"), (GLfloat, "s")]), + DllFunction(Void, "glMultiTexCoord1fvARB", [(GLenum, "target"), (Pointer(Const(GLfloat)), "v")]), + DllFunction(Void, "glMultiTexCoord1iARB", [(GLenum, "target"), (GLint, "s")]), + DllFunction(Void, "glMultiTexCoord1ivARB", [(GLenum, "target"), (Pointer(Const(GLint)), "v")]), + DllFunction(Void, "glMultiTexCoord1sARB", [(GLenum, "target"), (GLshort, "s")]), + DllFunction(Void, "glMultiTexCoord1svARB", [(GLenum, "target"), (Pointer(Const(GLshort)), "v")]), + DllFunction(Void, "glMultiTexCoord2dARB", [(GLenum, "target"), (GLdouble, "s"), (GLdouble, "t")]), + DllFunction(Void, "glMultiTexCoord2dvARB", [(GLenum, "target"), (Pointer(Const(GLdouble)), "v")]), + DllFunction(Void, "glMultiTexCoord2fARB", [(GLenum, "target"), (GLfloat, "s"), (GLfloat, "t")]), + DllFunction(Void, "glMultiTexCoord2fvARB", [(GLenum, "target"), (Pointer(Const(GLfloat)), "v")]), + DllFunction(Void, "glMultiTexCoord2iARB", [(GLenum, "target"), (GLint, "s"), (GLint, "t")]), + DllFunction(Void, "glMultiTexCoord2ivARB", [(GLenum, "target"), (Pointer(Const(GLint)), "v")]), + DllFunction(Void, "glMultiTexCoord2sARB", [(GLenum, "target"), (GLshort, "s"), (GLshort, "t")]), + DllFunction(Void, "glMultiTexCoord2svARB", [(GLenum, "target"), (Pointer(Const(GLshort)), "v")]), + DllFunction(Void, "glMultiTexCoord3dARB", [(GLenum, "target"), (GLdouble, "s"), (GLdouble, "t"), (GLdouble, "r")]), + DllFunction(Void, "glMultiTexCoord3dvARB", [(GLenum, "target"), (Pointer(Const(GLdouble)), "v")]), + DllFunction(Void, "glMultiTexCoord3fARB", [(GLenum, "target"), (GLfloat, "s"), (GLfloat, "t"), (GLfloat, "r")]), + DllFunction(Void, "glMultiTexCoord3fvARB", [(GLenum, "target"), (Pointer(Const(GLfloat)), "v")]), + DllFunction(Void, "glMultiTexCoord3iARB", [(GLenum, "target"), (GLint, "s"), (GLint, "t"), (GLint, "r")]), + DllFunction(Void, "glMultiTexCoord3ivARB", [(GLenum, "target"), (Pointer(Const(GLint)), "v")]), + DllFunction(Void, "glMultiTexCoord3sARB", [(GLenum, "target"), (GLshort, "s"), (GLshort, "t"), (GLshort, "r")]), + DllFunction(Void, "glMultiTexCoord3svARB", [(GLenum, "target"), (Pointer(Const(GLshort)), "v")]), + DllFunction(Void, "glMultiTexCoord4dARB", [(GLenum, "target"), (GLdouble, "s"), (GLdouble, "t"), (GLdouble, "r"), (GLdouble, "q")]), + DllFunction(Void, "glMultiTexCoord4dvARB", [(GLenum, "target"), (Pointer(Const(GLdouble)), "v")]), + DllFunction(Void, "glMultiTexCoord4fARB", [(GLenum, "target"), (GLfloat, "s"), (GLfloat, "t"), (GLfloat, "r"), (GLfloat, "q")]), + DllFunction(Void, "glMultiTexCoord4fvARB", [(GLenum, "target"), (Pointer(Const(GLfloat)), "v")]), + DllFunction(Void, "glMultiTexCoord4iARB", [(GLenum, "target"), (GLint, "s"), (GLint, "t"), (GLint, "r"), (GLint, "q")]), + DllFunction(Void, "glMultiTexCoord4ivARB", [(GLenum, "target"), (Pointer(Const(GLint)), "v")]), + DllFunction(Void, "glMultiTexCoord4sARB", [(GLenum, "target"), (GLshort, "s"), (GLshort, "t"), (GLshort, "r"), (GLshort, "q")]), + DllFunction(Void, "glMultiTexCoord4svARB", [(GLenum, "target"), (Pointer(Const(GLshort)), "v")]), +] + + +class GlxGetProcAddressFunction(DllFunction): + + def __init__(self, type, name, args): + DllFunction.__init__(self, type, name, args) + self.functions = [] + + def wrap_decl(self): + for function in self.functions: + function.wrap_decl() + DllFunction.wrap_decl(self) + + def wrap_impl(self): + for function in self.functions: + function.wrap_impl() + DllFunction.wrap_impl(self) + + def post_call_impl(self): + print ' if(result) {' + for function in self.functions: + ptype = function.pointer_type() + pvalue = function.pointer_value() + print ' if(!strcmp("%s", (const char *)procName)) {' % function.name + print ' %s = (%s)result;' % (pvalue, ptype) + print ' result = (void(*)())&%s;' % function.name; + print ' }' + print ' }' + + +PROC = Intrinsic("__GLXextFuncPtr", "%p") + +glXgetprocaddress = GlxGetProcAddressFunction(PROC, "glXGetProcAddress", [(Pointer(Const(GLubyte)), "procName")]) +libgl.functions.append(glXgetprocaddress) + +class GlxFunction(Function): + + def __init__(self, type, name, args, call = '', fail = None): + Function.__init__(self, type, name, args, call=call, fail=fail) + + def exit_impl(self): + print ' exit(0);' + + def get_true_pointer(self): + ptype = self.pointer_type() + pvalue = self.pointer_value() + print ' if(!%s)' % (pvalue,) + self.fail_impl() + +glXgetprocaddress.functions += [ + GlxFunction(Void, "glAttachShader", [(GLuint, "program"), (GLuint, "shader")]), + GlxFunction(GLuint, "glCreateProgram", []), + GlxFunction(GLuint, "glCreateShader", [(GLenum, "type")]), + GlxFunction(Void, "glDeleteProgram", [(GLuint, "program")]), + GlxFunction(Void, "glDeleteShader", [(GLuint, "program")]), + GlxFunction(Void, "glDetachShader", [(GLuint, "program"), (GLuint, "shader")]), + GlxFunction(Void, "glGetAttachedShaders", [(GLuint, "program"), (GLsizei, "maxCount"), (Pointer(GLsizei), "count"), (Pointer(GLuint), "obj")]), + GlxFunction(Void, "glGetProgramInfoLog", [(GLuint, "program"), (GLsizei, "bufSize"), (Pointer(GLsizei), "length"), (Pointer(GLchar), "infoLog")]), + GlxFunction(Void, "glGetProgramiv", [(GLuint, "program"), (GLenum, "pname"), (Pointer(GLint), "params")]), + GlxFunction(Void, "glGetShaderInfoLog", [(GLuint, "shader"), (GLsizei, "bufSize"), (Pointer(GLsizei), "length"), (Pointer(GLchar), "infoLog")]), + GlxFunction(Void, "glGetShaderiv", [(GLuint, "shader"), (GLenum, "pname"), (Pointer(GLint), "params")]), + GlxFunction(GLboolean, "glIsProgram", [(GLuint, "program")]), + GlxFunction(GLboolean, "glIsShader", [(GLuint, "shader")]), + GlxFunction(Void, "glStencilFuncSeparate", [(GLenum, "face"), (GLenum, "func"), (GLint, "ref"), (GLuint, "mask")]), + GlxFunction(Void, "glStencilMaskSeparate", [(GLenum, "face"), (GLuint, "mask")]), + GlxFunction(Void, "glStencilOpSeparate", [(GLenum, "face"), (GLenum, "sfail"), (GLenum, "zfail"), (GLenum, "zpass")]), + GlxFunction(Void, "glUniformMatrix2x3fv", [(GLint, "location"), (GLsizei, "count"), (GLboolean, "transpose"), (Pointer(Const(GLfloat)), "value")]), + GlxFunction(Void, "glUniformMatrix2x4fv", [(GLint, "location"), (GLsizei, "count"), (GLboolean, "transpose"), (Pointer(Const(GLfloat)), "value")]), + GlxFunction(Void, "glUniformMatrix3x2fv", [(GLint, "location"), (GLsizei, "count"), (GLboolean, "transpose"), (Pointer(Const(GLfloat)), "value")]), + GlxFunction(Void, "glUniformMatrix3x4fv", [(GLint, "location"), (GLsizei, "count"), (GLboolean, "transpose"), (Pointer(Const(GLfloat)), "value")]), + GlxFunction(Void, "glUniformMatrix4x2fv", [(GLint, "location"), (GLsizei, "count"), (GLboolean, "transpose"), (Pointer(Const(GLfloat)), "value")]), + GlxFunction(Void, "glUniformMatrix4x3fv", [(GLint, "location"), (GLsizei, "count"), (GLboolean, "transpose"), (Pointer(Const(GLfloat)), "value")]), + GlxFunction(Void, "glLoadTransposeMatrixdARB", [(Pointer(Const(GLdouble)), "m")]), + GlxFunction(Void, "glLoadTransposeMatrixfARB", [(Pointer(Const(GLfloat)), "m")]), + GlxFunction(Void, "glMultTransposeMatrixdARB", [(Pointer(Const(GLdouble)), "m")]), + GlxFunction(Void, "glMultTransposeMatrixfARB", [(Pointer(Const(GLfloat)), "m")]), + GlxFunction(Void, "glSampleCoverageARB", [(GLclampf, "value"), (GLboolean, "invert")]), + GlxFunction(Void, "glCompressedTexImage1DARB", [(GLenum, "target"), (GLint, "level"), (GLenum, "internalformat"), (GLsizei, "width"), (GLint, "border"), (GLsizei, "imageSize"), (Pointer(Const(GLvoid)), "data")]), + GlxFunction(Void, "glCompressedTexImage2DARB", [(GLenum, "target"), (GLint, "level"), (GLenum, "internalformat"), (GLsizei, "width"), (GLsizei, "height"), (GLint, "border"), (GLsizei, "imageSize"), (Pointer(Const(GLvoid)), "data")]), + GlxFunction(Void, "glCompressedTexImage3DARB", [(GLenum, "target"), (GLint, "level"), (GLenum, "internalformat"), (GLsizei, "width"), (GLsizei, "height"), (GLsizei, "depth"), (GLint, "border"), (GLsizei, "imageSize"), (Pointer(Const(GLvoid)), "data")]), + GlxFunction(Void, "glCompressedTexSubImage1DARB", [(GLenum, "target"), (GLint, "level"), (GLint, "xoffset"), (GLsizei, "width"), (GLenum, "format"), (GLsizei, "imageSize"), (Pointer(Const(GLvoid)), "data")]), + GlxFunction(Void, "glCompressedTexSubImage2DARB", [(GLenum, "target"), (GLint, "level"), (GLint, "xoffset"), (GLint, "yoffset"), (GLsizei, "width"), (GLsizei, "height"), (GLenum, "format"), (GLsizei, "imageSize"), (Pointer(Const(GLvoid)), "data")]), + GlxFunction(Void, "glCompressedTexSubImage3DARB", [(GLenum, "target"), (GLint, "level"), (GLint, "xoffset"), (GLint, "yoffset"), (GLint, "zoffset"), (GLsizei, "width"), (GLsizei, "height"), (GLsizei, "depth"), (GLenum, "format"), (GLsizei, "imageSize"), (Pointer(Const(GLvoid)), "data")]), + GlxFunction(Void, "glGetCompressedTexImageARB", [(GLenum, "target"), (GLint, "level"), (Pointer(GLvoid), "img")]), + GlxFunction(Void, "glDisableVertexAttribArrayARB", [(GLuint, "index")]), + GlxFunction(Void, "glEnableVertexAttribArrayARB", [(GLuint, "index")]), + GlxFunction(Void, "glGetProgramEnvParameterdvARB", [(GLenum, "target"), (GLuint, "index"), (Pointer(GLdouble), "params")]), + GlxFunction(Void, "glGetProgramEnvParameterfvARB", [(GLenum, "target"), (GLuint, "index"), (Pointer(GLfloat), "params")]), + GlxFunction(Void, "glGetProgramLocalParameterdvARB", [(GLenum, "target"), (GLuint, "index"), (Pointer(GLdouble), "params")]), + GlxFunction(Void, "glGetProgramLocalParameterfvARB", [(GLenum, "target"), (GLuint, "index"), (Pointer(GLfloat), "params")]), + GlxFunction(Void, "glGetProgramStringARB", [(GLenum, "target"), (GLenum, "pname"), (Pointer(GLvoid), "string")]), + GlxFunction(Void, "glGetProgramivARB", [(GLenum, "target"), (GLenum, "pname"), (Pointer(GLint), "params")]), + GlxFunction(Void, "glGetVertexAttribdvARB", [(GLuint, "index"), (GLenum, "pname"), (Pointer(GLdouble), "params")]), + GlxFunction(Void, "glGetVertexAttribfvARB", [(GLuint, "index"), (GLenum, "pname"), (Pointer(GLfloat), "params")]), + GlxFunction(Void, "glGetVertexAttribivARB", [(GLuint, "index"), (GLenum, "pname"), (Pointer(GLint), "params")]), + GlxFunction(Void, "glProgramEnvParameter4dARB", [(GLenum, "target"), (GLuint, "index"), (GLdouble, "x"), (GLdouble, "y"), (GLdouble, "z"), (GLdouble, "w")]), + GlxFunction(Void, "glProgramEnvParameter4dvARB", [(GLenum, "target"), (GLuint, "index"), (Pointer(Const(GLdouble)), "params")]), + GlxFunction(Void, "glProgramEnvParameter4fARB", [(GLenum, "target"), (GLuint, "index"), (GLfloat, "x"), (GLfloat, "y"), (GLfloat, "z"), (GLfloat, "w")]), + GlxFunction(Void, "glProgramEnvParameter4fvARB", [(GLenum, "target"), (GLuint, "index"), (Pointer(Const(GLfloat)), "params")]), + GlxFunction(Void, "glProgramLocalParameter4dARB", [(GLenum, "target"), (GLuint, "index"), (GLdouble, "x"), (GLdouble, "y"), (GLdouble, "z"), (GLdouble, "w")]), + GlxFunction(Void, "glProgramLocalParameter4dvARB", [(GLenum, "target"), (GLuint, "index"), (Pointer(Const(GLdouble)), "params")]), + GlxFunction(Void, "glProgramLocalParameter4fARB", [(GLenum, "target"), (GLuint, "index"), (GLfloat, "x"), (GLfloat, "y"), (GLfloat, "z"), (GLfloat, "w")]), + GlxFunction(Void, "glProgramLocalParameter4fvARB", [(GLenum, "target"), (GLuint, "index"), (Pointer(Const(GLfloat)), "params")]), + GlxFunction(Void, "glProgramStringARB", [(GLenum, "target"), (GLenum, "format"), (GLsizei, "len"), (Pointer(Const(GLvoid)), "string")]), + GlxFunction(Void, "glVertexAttrib1dARB", [(GLuint, "index"), (GLdouble, "x")]), + GlxFunction(Void, "glVertexAttrib1dvARB", [(GLuint, "index"), (Pointer(Const(GLdouble)), "v")]), + GlxFunction(Void, "glVertexAttrib1fARB", [(GLuint, "index"), (GLfloat, "x")]), + GlxFunction(Void, "glVertexAttrib1fvARB", [(GLuint, "index"), (Pointer(Const(GLfloat)), "v")]), + GlxFunction(Void, "glVertexAttrib1sARB", [(GLuint, "index"), (GLshort, "x")]), + GlxFunction(Void, "glVertexAttrib1svARB", [(GLuint, "index"), (Pointer(Const(GLshort)), "v")]), + GlxFunction(Void, "glVertexAttrib2dARB", [(GLuint, "index"), (GLdouble, "x"), (GLdouble, "y")]), + GlxFunction(Void, "glVertexAttrib2dvARB", [(GLuint, "index"), (Pointer(Const(GLdouble)), "v")]), + GlxFunction(Void, "glVertexAttrib2fARB", [(GLuint, "index"), (GLfloat, "x"), (GLfloat, "y")]), + GlxFunction(Void, "glVertexAttrib2fvARB", [(GLuint, "index"), (Pointer(Const(GLfloat)), "v")]), + GlxFunction(Void, "glVertexAttrib2sARB", [(GLuint, "index"), (GLshort, "x"), (GLshort, "y")]), + GlxFunction(Void, "glVertexAttrib2svARB", [(GLuint, "index"), (Pointer(Const(GLshort)), "v")]), + GlxFunction(Void, "glVertexAttrib3dARB", [(GLuint, "index"), (GLdouble, "x"), (GLdouble, "y"), (GLdouble, "z")]), + GlxFunction(Void, "glVertexAttrib3dvARB", [(GLuint, "index"), (Pointer(Const(GLdouble)), "v")]), + GlxFunction(Void, "glVertexAttrib3fARB", [(GLuint, "index"), (GLfloat, "x"), (GLfloat, "y"), (GLfloat, "z")]), + GlxFunction(Void, "glVertexAttrib3fvARB", [(GLuint, "index"), (Pointer(Const(GLfloat)), "v")]), + GlxFunction(Void, "glVertexAttrib3sARB", [(GLuint, "index"), (GLshort, "x"), (GLshort, "y"), (GLshort, "z")]), + GlxFunction(Void, "glVertexAttrib3svARB", [(GLuint, "index"), (Pointer(Const(GLshort)), "v")]), + GlxFunction(Void, "glVertexAttrib4NbvARB", [(GLuint, "index"), (Pointer(Const(GLbyte)), "v")]), + GlxFunction(Void, "glVertexAttrib4NivARB", [(GLuint, "index"), (Pointer(Const(GLint)), "v")]), + GlxFunction(Void, "glVertexAttrib4NsvARB", [(GLuint, "index"), (Pointer(Const(GLshort)), "v")]), + GlxFunction(Void, "glVertexAttrib4NubARB", [(GLuint, "index"), (GLubyte, "x"), (GLubyte, "y"), (GLubyte, "z"), (GLubyte, "w")]), + GlxFunction(Void, "glVertexAttrib4NubvARB", [(GLuint, "index"), (Pointer(Const(GLubyte)), "v")]), + GlxFunction(Void, "glVertexAttrib4NuivARB", [(GLuint, "index"), (Pointer(Const(GLuint)), "v")]), + GlxFunction(Void, "glVertexAttrib4NusvARB", [(GLuint, "index"), (Pointer(Const(GLushort)), "v")]), + GlxFunction(Void, "glVertexAttrib4bvARB", [(GLuint, "index"), (Pointer(Const(GLbyte)), "v")]), + GlxFunction(Void, "glVertexAttrib4dARB", [(GLuint, "index"), (GLdouble, "x"), (GLdouble, "y"), (GLdouble, "z"), (GLdouble, "w")]), + GlxFunction(Void, "glVertexAttrib4dvARB", [(GLuint, "index"), (Pointer(Const(GLdouble)), "v")]), + GlxFunction(Void, "glVertexAttrib4fARB", [(GLuint, "index"), (GLfloat, "x"), (GLfloat, "y"), (GLfloat, "z"), (GLfloat, "w")]), + GlxFunction(Void, "glVertexAttrib4fvARB", [(GLuint, "index"), (Pointer(Const(GLfloat)), "v")]), + GlxFunction(Void, "glVertexAttrib4ivARB", [(GLuint, "index"), (Pointer(Const(GLint)), "v")]), + GlxFunction(Void, "glVertexAttrib4sARB", [(GLuint, "index"), (GLshort, "x"), (GLshort, "y"), (GLshort, "z"), (GLshort, "w")]), + GlxFunction(Void, "glVertexAttrib4svARB", [(GLuint, "index"), (Pointer(Const(GLshort)), "v")]), + GlxFunction(Void, "glVertexAttrib4ubvARB", [(GLuint, "index"), (Pointer(Const(GLubyte)), "v")]), + GlxFunction(Void, "glVertexAttrib4uivARB", [(GLuint, "index"), (Pointer(Const(GLuint)), "v")]), + GlxFunction(Void, "glVertexAttrib4usvARB", [(GLuint, "index"), (Pointer(Const(GLushort)), "v")]), + GlxFunction(Void, "glVertexAttribPointerARB", [(GLuint, "index"), (GLint, "size"), (GLenum, "type"), (GLboolean, "normalized"), (GLsizei, "stride"), (Pointer(Const(GLvoid)), "pointer")]), + GlxFunction(Void, "glBindBufferARB", [(GLenum, "target"), (GLuint, "buffer")]), + GlxFunction(Void, "glBufferDataARB", [(GLenum, "target"), (GLsizeiptrARB, "size"), (Pointer(Const(GLvoid)), "data"), (GLenum, "usage")]), + GlxFunction(Void, "glBufferSubDataARB", [(GLenum, "target"), (GLintptrARB, "offset"), (GLsizeiptrARB, "size"), (Pointer(Const(GLvoid)), "data")]), + GlxFunction(Void, "glDeleteBuffersARB", [(GLsizei, "n"), (Pointer(Const(GLuint)), "buffer")]), + GlxFunction(Void, "glGenBuffersARB", [(GLsizei, "n"), (Pointer(GLuint), "buffer")]), + GlxFunction(Void, "glGetBufferParameterivARB", [(GLenum, "target"), (GLenum, "pname"), (Pointer(GLint), "params")]), + GlxFunction(Void, "glGetBufferPointervARB", [(GLenum, "target"), (GLenum, "pname"), (Pointer(Pointer(GLvoid)), "params")]), + GlxFunction(Void, "glGetBufferSubDataARB", [(GLenum, "target"), (GLintptrARB, "offset"), (GLsizeiptrARB, "size"), (Pointer(GLvoid), "data")]), + GlxFunction(GLboolean, "glIsBufferARB", [(GLuint, "buffer")]), + GlxFunction(Pointer(GLvoid), "glMapBufferARB", [(GLenum, "target"), (GLenum, "access")]), + GlxFunction(GLboolean, "glUnmapBufferARB", [(GLenum, "target")]), + GlxFunction(Void, "glBeginQueryARB", [(GLenum, "target"), (GLuint, "id")]), + GlxFunction(Void, "glDeleteQueriesARB", [(GLsizei, "n"), (Pointer(Const(GLuint)), "ids")]), + GlxFunction(Void, "glEndQueryARB", [(GLenum, "target")]), + GlxFunction(Void, "glGenQueriesARB", [(GLsizei, "n"), (Pointer(GLuint), "ids")]), + GlxFunction(Void, "glGetQueryObjectivARB", [(GLuint, "id"), (GLenum, "pname"), (Pointer(GLint), "params")]), + GlxFunction(Void, "glGetQueryObjectuivARB", [(GLuint, "id"), (GLenum, "pname"), (Pointer(GLuint), "params")]), + GlxFunction(Void, "glGetQueryivARB", [(GLenum, "target"), (GLenum, "pname"), (Pointer(GLint), "params")]), + GlxFunction(GLboolean, "glIsQueryARB", [(GLuint, "id")]), + GlxFunction(Void, "glAttachObjectARB", [(GLhandleARB, "containerObj"), (GLhandleARB, "obj")]), + GlxFunction(Void, "glCompileShaderARB", [(GLhandleARB, "shader")]), + GlxFunction(GLhandleARB, "glCreateProgramObjectARB", []), + GlxFunction(GLhandleARB, "glCreateShaderObjectARB", [(GLenum, "shaderType")]), + GlxFunction(Void, "glDeleteObjectARB", [(GLhandleARB, "obj")]), + GlxFunction(Void, "glDetachObjectARB", [(GLhandleARB, "containerObj"), (GLhandleARB, "attachedObj")]), + GlxFunction(Void, "glGetActiveUniformARB", [(GLhandleARB, "program"), (GLuint, "index"), (GLsizei, "bufSize"), (Pointer(GLsizei), "length"), (Pointer(GLint), "size"), (Pointer(GLenum), "type"), (Pointer(GLcharARB), "name")]), + GlxFunction(Void, "glGetAttachedObjectsARB", [(GLhandleARB, "containerObj"), (GLsizei, "maxLength"), (Pointer(GLsizei), "length"), (Pointer(GLhandleARB), "infoLog")]), + GlxFunction(GLhandleARB, "glGetHandleARB", [(GLenum, "pname")]), + GlxFunction(Void, "glGetInfoLogARB", [(GLhandleARB, "obj"), (GLsizei, "maxLength"), (Pointer(GLsizei), "length"), (Pointer(GLcharARB), "infoLog")]), + GlxFunction(Void, "glGetObjectParameterfvARB", [(GLhandleARB, "obj"), (GLenum, "pname"), (Pointer(GLfloat), "params")]), + GlxFunction(Void, "glGetObjectParameterivARB", [(GLhandleARB, "obj"), (GLenum, "pname"), (Pointer(GLint), "params")]), + GlxFunction(Void, "glGetShaderSourceARB", [(GLhandleARB, "shader"), (GLsizei, "bufSize"), (Pointer(GLsizei), "length"), (Pointer(GLcharARB), "source")]), + GlxFunction(GLint, "glGetUniformLocationARB", [(GLhandleARB, "program"), (Pointer(Const(GLcharARB)), "name")]), + GlxFunction(Void, "glGetUniformfvARB", [(GLhandleARB, "program"), (GLint, "location"), (Pointer(GLfloat), "params")]), + GlxFunction(Void, "glGetUniformivARB", [(GLhandleARB, "program"), (GLint, "location"), (Pointer(GLint), "params")]), + GlxFunction(Void, "glLinkProgramARB", [(GLhandleARB, "program")]), + GlxFunction(Void, "glShaderSourceARB", [(GLhandleARB, "shader"), (GLsizei, "count"), (Pointer(Pointer(Const(GLcharARB))), "string"), (Pointer(Const(GLint)), "length")]), + GlxFunction(Void, "glUniform1fARB", [(GLint, "location"), (GLfloat, "v0")]), + GlxFunction(Void, "glUniform1fvARB", [(GLint, "location"), (GLsizei, "count"), (Pointer(Const(GLfloat)), "value")]), + GlxFunction(Void, "glUniform1iARB", [(GLint, "location"), (GLint, "v0")]), + GlxFunction(Void, "glUniform1ivARB", [(GLint, "location"), (GLsizei, "count"), (Pointer(Const(GLint)), "value")]), + GlxFunction(Void, "glUniform2fARB", [(GLint, "location"), (GLfloat, "v0"), (GLfloat, "v1")]), + GlxFunction(Void, "glUniform2fvARB", [(GLint, "location"), (GLsizei, "count"), (Pointer(Const(GLfloat)), "value")]), + GlxFunction(Void, "glUniform2iARB", [(GLint, "location"), (GLint, "v0"), (GLint, "v1")]), + GlxFunction(Void, "glUniform2ivARB", [(GLint, "location"), (GLsizei, "count"), (Pointer(Const(GLint)), "value")]), + GlxFunction(Void, "glUniform3fARB", [(GLint, "location"), (GLfloat, "v0"), (GLfloat, "v1"), (GLfloat, "v2")]), + GlxFunction(Void, "glUniform3fvARB", [(GLint, "location"), (GLsizei, "count"), (Pointer(Const(GLfloat)), "value")]), + GlxFunction(Void, "glUniform3iARB", [(GLint, "location"), (GLint, "v0"), (GLint, "v1"), (GLint, "v2")]), + GlxFunction(Void, "glUniform3ivARB", [(GLint, "location"), (GLsizei, "count"), (Pointer(Const(GLint)), "value")]), + GlxFunction(Void, "glUniform4fARB", [(GLint, "location"), (GLfloat, "v0"), (GLfloat, "v1"), (GLfloat, "v2"), (GLfloat, "v3")]), + GlxFunction(Void, "glUniform4fvARB", [(GLint, "location"), (GLsizei, "count"), (Pointer(Const(GLfloat)), "value")]), + GlxFunction(Void, "glUniform4iARB", [(GLint, "location"), (GLint, "v0"), (GLint, "v1"), (GLint, "v2"), (GLint, "v3")]), + GlxFunction(Void, "glUniform4ivARB", [(GLint, "location"), (GLsizei, "count"), (Pointer(Const(GLint)), "value")]), + GlxFunction(Void, "glUniformMatrix2fvARB", [(GLint, "location"), (GLsizei, "count"), (GLboolean, "transpose"), (Pointer(Const(GLfloat)), "value")]), + GlxFunction(Void, "glUniformMatrix3fvARB", [(GLint, "location"), (GLsizei, "count"), (GLboolean, "transpose"), (Pointer(Const(GLfloat)), "value")]), + GlxFunction(Void, "glUniformMatrix4fvARB", [(GLint, "location"), (GLsizei, "count"), (GLboolean, "transpose"), (Pointer(Const(GLfloat)), "value")]), + GlxFunction(Void, "glUseProgramObjectARB", [(GLhandleARB, "program")]), + GlxFunction(Void, "glValidateProgramARB", [(GLhandleARB, "program")]), + GlxFunction(Void, "glBindAttribLocationARB", [(GLhandleARB, "program"), (GLuint, "index"), (Pointer(Const(GLcharARB)), "name")]), + GlxFunction(Void, "glGetActiveAttribARB", [(GLhandleARB, "program"), (GLuint, "index"), (GLsizei, "bufSize"), (Pointer(GLsizei), "length"), (Pointer(GLint), "size"), (Pointer(GLenum), "type"), (Pointer(GLcharARB), "name")]), + GlxFunction(GLint, "glGetAttribLocationARB", [(GLhandleARB, "program"), (Pointer(Const(GLcharARB)), "name")]), + GlxFunction(Void, "glDrawBuffersARB", [(GLsizei, "n"), (Pointer(Const(GLenum)), "bufs")]), + GlxFunction(Void, "glRenderbufferStorageMultisample", [(GLenum, "target"), (GLsizei, "samples"), (GLenum, "internalformat"), (GLsizei, "width"), (GLsizei, "height")]), + GlxFunction(Void, "glPolygonOffsetEXT", [(GLfloat, "factor"), (GLfloat, "bias")]), + GlxFunction(Void, "glGetPixelTexGenParameterfvSGIS", [(GLenum, "pname"), (Pointer(GLfloat), "params")]), + GlxFunction(Void, "glGetPixelTexGenParameterivSGIS", [(GLenum, "pname"), (Pointer(GLint), "params")]), + GlxFunction(Void, "glPixelTexGenParameterfSGIS", [(GLenum, "pname"), (GLfloat, "param")]), + GlxFunction(Void, "glPixelTexGenParameterfvSGIS", [(GLenum, "pname"), (Pointer(Const(GLfloat)), "params")]), + GlxFunction(Void, "glPixelTexGenParameteriSGIS", [(GLenum, "pname"), (GLint, "param")]), + GlxFunction(Void, "glPixelTexGenParameterivSGIS", [(GLenum, "pname"), (Pointer(Const(GLint)), "params")]), + GlxFunction(Void, "glSampleMaskSGIS", [(GLclampf, "value"), (GLboolean, "invert")]), + GlxFunction(Void, "glSamplePatternSGIS", [(GLenum, "pattern")]), + GlxFunction(Void, "glColorPointerEXT", [(GLint, "size"), (GLenum, "type"), (GLsizei, "stride"), (GLsizei, "count"), (Pointer(Const(GLvoid)), "pointer")]), + GlxFunction(Void, "glEdgeFlagPointerEXT", [(GLsizei, "stride"), (GLsizei, "count"), (Pointer(Const(GLboolean)), "pointer")]), + GlxFunction(Void, "glIndexPointerEXT", [(GLenum, "type"), (GLsizei, "stride"), (GLsizei, "count"), (Pointer(Const(GLvoid)), "pointer")]), + GlxFunction(Void, "glNormalPointerEXT", [(GLenum, "type"), (GLsizei, "stride"), (GLsizei, "count"), (Pointer(Const(GLvoid)), "pointer")]), + GlxFunction(Void, "glTexCoordPointerEXT", [(GLint, "size"), (GLenum, "type"), (GLsizei, "stride"), (GLsizei, "count"), (Pointer(Const(GLvoid)), "pointer")]), + GlxFunction(Void, "glVertexPointerEXT", [(GLint, "size"), (GLenum, "type"), (GLsizei, "stride"), (GLsizei, "count"), (Pointer(Const(GLvoid)), "pointer")]), + GlxFunction(Void, "glPointParameterfEXT", [(GLenum, "pname"), (GLfloat, "param")]), + GlxFunction(Void, "glPointParameterfvEXT", [(GLenum, "pname"), (Pointer(Const(GLfloat)), "params")]), + GlxFunction(Void, "glLockArraysEXT", [(GLint, "first"), (GLsizei, "count")]), + GlxFunction(Void, "glUnlockArraysEXT", []), + GlxFunction(Void, "glCullParameterdvEXT", [(GLenum, "pname"), (Pointer(GLdouble), "params")]), + GlxFunction(Void, "glCullParameterfvEXT", [(GLenum, "pname"), (Pointer(GLfloat), "params")]), + GlxFunction(Void, "glSecondaryColor3bEXT", [(GLbyte, "red"), (GLbyte, "green"), (GLbyte, "blue")]), + GlxFunction(Void, "glSecondaryColor3bvEXT", [(Pointer(Const(GLbyte)), "v")]), + GlxFunction(Void, "glSecondaryColor3dEXT", [(GLdouble, "red"), (GLdouble, "green"), (GLdouble, "blue")]), + GlxFunction(Void, "glSecondaryColor3dvEXT", [(Pointer(Const(GLdouble)), "v")]), + GlxFunction(Void, "glSecondaryColor3fEXT", [(GLfloat, "red"), (GLfloat, "green"), (GLfloat, "blue")]), + GlxFunction(Void, "glSecondaryColor3fvEXT", [(Pointer(Const(GLfloat)), "v")]), + GlxFunction(Void, "glSecondaryColor3iEXT", [(GLint, "red"), (GLint, "green"), (GLint, "blue")]), + GlxFunction(Void, "glSecondaryColor3ivEXT", [(Pointer(Const(GLint)), "v")]), + GlxFunction(Void, "glSecondaryColor3sEXT", [(GLshort, "red"), (GLshort, "green"), (GLshort, "blue")]), + GlxFunction(Void, "glSecondaryColor3svEXT", [(Pointer(Const(GLshort)), "v")]), + GlxFunction(Void, "glSecondaryColor3ubEXT", [(GLubyte, "red"), (GLubyte, "green"), (GLubyte, "blue")]), + GlxFunction(Void, "glSecondaryColor3ubvEXT", [(Pointer(Const(GLubyte)), "v")]), + GlxFunction(Void, "glSecondaryColor3uiEXT", [(GLuint, "red"), (GLuint, "green"), (GLuint, "blue")]), + GlxFunction(Void, "glSecondaryColor3uivEXT", [(Pointer(Const(GLuint)), "v")]), + GlxFunction(Void, "glSecondaryColor3usEXT", [(GLushort, "red"), (GLushort, "green"), (GLushort, "blue")]), + GlxFunction(Void, "glSecondaryColor3usvEXT", [(Pointer(Const(GLushort)), "v")]), + GlxFunction(Void, "glSecondaryColorPointerEXT", [(GLint, "size"), (GLenum, "type"), (GLsizei, "stride"), (Pointer(Const(GLvoid)), "pointer")]), + GlxFunction(Void, "glMultiDrawArraysEXT", [(GLenum, "mode"), (Pointer(GLint), "first"), (Pointer(GLsizei), "count"), (GLsizei, "primcount")]), + GlxFunction(Void, "glMultiDrawElementsEXT", [(GLenum, "mode"), (Pointer(Const(GLsizei)), "count"), (GLenum, "type"), (Pointer(Pointer(Const(GLvoid))), "indices"), (GLsizei, "primcount")]), + GlxFunction(Void, "glFogCoordPointerEXT", [(GLenum, "type"), (GLsizei, "stride"), (Pointer(Const(GLvoid)), "pointer")]), + GlxFunction(Void, "glFogCoorddEXT", [(GLdouble, "coord")]), + GlxFunction(Void, "glFogCoorddvEXT", [(Pointer(Const(GLdouble)), "coord")]), + GlxFunction(Void, "glFogCoordfEXT", [(GLfloat, "coord")]), + GlxFunction(Void, "glFogCoordfvEXT", [(Pointer(Const(GLfloat)), "coord")]), + GlxFunction(Void, "glPixelTexGenSGIX", [(GLenum, "mode")]), + GlxFunction(Void, "glBlendFuncSeparateEXT", [(GLenum, "sfactorRGB"), (GLenum, "dfactorRGB"), (GLenum, "sfactorAlpha"), (GLenum, "dfactorAlpha")]), + GlxFunction(Void, "glFlushVertexArrayRangeNV", []), + GlxFunction(Void, "glVertexArrayRangeNV", [(GLsizei, "length"), (Pointer(Const(GLvoid)), "pointer")]), + GlxFunction(Void, "glCombinerInputNV", [(GLenum, "stage"), (GLenum, "portion"), (GLenum, "variable"), (GLenum, "input"), (GLenum, "mapping"), (GLenum, "componentUsage")]), + GlxFunction(Void, "glCombinerOutputNV", [(GLenum, "stage"), (GLenum, "portion"), (GLenum, "abOutput"), (GLenum, "cdOutput"), (GLenum, "sumOutput"), (GLenum, "scale"), (GLenum, "bias"), (GLboolean, "abDotProduct"), (GLboolean, "cdDotProduct"), (GLboolean, "muxSum")]), + GlxFunction(Void, "glCombinerParameterfNV", [(GLenum, "pname"), (GLfloat, "param")]), + GlxFunction(Void, "glCombinerParameterfvNV", [(GLenum, "pname"), (Pointer(Const(GLfloat)), "params")]), + GlxFunction(Void, "glCombinerParameteriNV", [(GLenum, "pname"), (GLint, "param")]), + GlxFunction(Void, "glCombinerParameterivNV", [(GLenum, "pname"), (Pointer(Const(GLint)), "params")]), + GlxFunction(Void, "glFinalCombinerInputNV", [(GLenum, "variable"), (GLenum, "input"), (GLenum, "mapping"), (GLenum, "componentUsage")]), + GlxFunction(Void, "glGetCombinerInputParameterfvNV", [(GLenum, "stage"), (GLenum, "portion"), (GLenum, "variable"), (GLenum, "pname"), (Pointer(GLfloat), "params")]), + GlxFunction(Void, "glGetCombinerInputParameterivNV", [(GLenum, "stage"), (GLenum, "portion"), (GLenum, "variable"), (GLenum, "pname"), (Pointer(GLint), "params")]), + GlxFunction(Void, "glGetCombinerOutputParameterfvNV", [(GLenum, "stage"), (GLenum, "portion"), (GLenum, "pname"), (Pointer(GLfloat), "params")]), + GlxFunction(Void, "glGetCombinerOutputParameterivNV", [(GLenum, "stage"), (GLenum, "portion"), (GLenum, "pname"), (Pointer(GLint), "params")]), + GlxFunction(Void, "glGetFinalCombinerInputParameterfvNV", [(GLenum, "variable"), (GLenum, "pname"), (Pointer(GLfloat), "params")]), + GlxFunction(Void, "glGetFinalCombinerInputParameterivNV", [(GLenum, "variable"), (GLenum, "pname"), (Pointer(GLint), "params")]), + GlxFunction(Void, "glResizeBuffersMESA", []), + GlxFunction(Void, "glWindowPos2dMESA", [(GLdouble, "x"), (GLdouble, "y")]), + GlxFunction(Void, "glWindowPos2dvMESA", [(Pointer(Const(GLdouble)), "v")]), + GlxFunction(Void, "glWindowPos2fMESA", [(GLfloat, "x"), (GLfloat, "y")]), + GlxFunction(Void, "glWindowPos2fvMESA", [(Pointer(Const(GLfloat)), "v")]), + GlxFunction(Void, "glWindowPos2iMESA", [(GLint, "x"), (GLint, "y")]), + GlxFunction(Void, "glWindowPos2ivMESA", [(Pointer(Const(GLint)), "v")]), + GlxFunction(Void, "glWindowPos2sMESA", [(GLshort, "x"), (GLshort, "y")]), + GlxFunction(Void, "glWindowPos2svMESA", [(Pointer(Const(GLshort)), "v")]), + GlxFunction(Void, "glWindowPos3dMESA", [(GLdouble, "x"), (GLdouble, "y"), (GLdouble, "z")]), + GlxFunction(Void, "glWindowPos3dvMESA", [(Pointer(Const(GLdouble)), "v")]), + GlxFunction(Void, "glWindowPos3fMESA", [(GLfloat, "x"), (GLfloat, "y"), (GLfloat, "z")]), + GlxFunction(Void, "glWindowPos3fvMESA", [(Pointer(Const(GLfloat)), "v")]), + GlxFunction(Void, "glWindowPos3iMESA", [(GLint, "x"), (GLint, "y"), (GLint, "z")]), + GlxFunction(Void, "glWindowPos3ivMESA", [(Pointer(Const(GLint)), "v")]), + GlxFunction(Void, "glWindowPos3sMESA", [(GLshort, "x"), (GLshort, "y"), (GLshort, "z")]), + GlxFunction(Void, "glWindowPos3svMESA", [(Pointer(Const(GLshort)), "v")]), + GlxFunction(Void, "glWindowPos4dMESA", [(GLdouble, "x"), (GLdouble, "y"), (GLdouble, "z"), (GLdouble, "w")]), + GlxFunction(Void, "glWindowPos4dvMESA", [(Pointer(Const(GLdouble)), "v")]), + GlxFunction(Void, "glWindowPos4fMESA", [(GLfloat, "x"), (GLfloat, "y"), (GLfloat, "z"), (GLfloat, "w")]), + GlxFunction(Void, "glWindowPos4fvMESA", [(Pointer(Const(GLfloat)), "v")]), + GlxFunction(Void, "glWindowPos4iMESA", [(GLint, "x"), (GLint, "y"), (GLint, "z"), (GLint, "w")]), + GlxFunction(Void, "glWindowPos4ivMESA", [(Pointer(Const(GLint)), "v")]), + GlxFunction(Void, "glWindowPos4sMESA", [(GLshort, "x"), (GLshort, "y"), (GLshort, "z"), (GLshort, "w")]), + GlxFunction(Void, "glWindowPos4svMESA", [(Pointer(Const(GLshort)), "v")]), + GlxFunction(Void, "glMultiModeDrawArraysIBM", [(Pointer(Const(GLenum)), "mode"), (Pointer(Const(GLint)), "first"), (Pointer(Const(GLsizei)), "count"), (GLsizei, "primcount"), (GLint, "modestride")]), + GlxFunction(Void, "glMultiModeDrawElementsIBM", [(Pointer(Const(GLenum)), "mode"), (Pointer(Const(GLsizei)), "count"), (GLenum, "type"), (Pointer(Const(Pointer(Const(GLvoid)))), "indices"), (GLsizei, "primcount"), (GLint, "modestride")]), + GlxFunction(Void, "glDeleteFencesNV", [(GLsizei, "n"), (Pointer(Const(GLuint)), "fences")]), + GlxFunction(Void, "glFinishFenceNV", [(GLuint, "fence")]), + GlxFunction(Void, "glGenFencesNV", [(GLsizei, "n"), (Pointer(GLuint), "fences")]), + GlxFunction(Void, "glGetFenceivNV", [(GLuint, "fence"), (GLenum, "pname"), (Pointer(GLint), "params")]), + GlxFunction(GLboolean, "glIsFenceNV", [(GLuint, "fence")]), + GlxFunction(Void, "glSetFenceNV", [(GLuint, "fence"), (GLenum, "condition")]), + GlxFunction(GLboolean, "glTestFenceNV", [(GLuint, "fence")]), + GlxFunction(GLboolean, "glAreProgramsResidentNV", [(GLsizei, "n"), (Pointer(Const(GLuint)), "ids"), (Pointer(GLboolean), "residences")]), + GlxFunction(Void, "glBindProgramNV", [(GLenum, "target"), (GLuint, "program")]), + GlxFunction(Void, "glDeleteProgramsNV", [(GLsizei, "n"), (Pointer(Const(GLuint)), "programs")]), + GlxFunction(Void, "glExecuteProgramNV", [(GLenum, "target"), (GLuint, "id"), (Pointer(Const(GLfloat)), "params")]), + GlxFunction(Void, "glGenProgramsNV", [(GLsizei, "n"), (Pointer(GLuint), "programs")]), + GlxFunction(Void, "glGetProgramParameterdvNV", [(GLenum, "target"), (GLuint, "index"), (GLenum, "pname"), (Pointer(GLdouble), "params")]), + GlxFunction(Void, "glGetProgramParameterfvNV", [(GLenum, "target"), (GLuint, "index"), (GLenum, "pname"), (Pointer(GLfloat), "params")]), + GlxFunction(Void, "glGetProgramStringNV", [(GLuint, "id"), (GLenum, "pname"), (Pointer(GLubyte), "program")]), + GlxFunction(Void, "glGetProgramivNV", [(GLuint, "id"), (GLenum, "pname"), (Pointer(GLint), "params")]), + GlxFunction(Void, "glGetTrackMatrixivNV", [(GLenum, "target"), (GLuint, "address"), (GLenum, "pname"), (Pointer(GLint), "params")]), + GlxFunction(Void, "glGetVertexAttribPointervNV", [(GLuint, "index"), (GLenum, "pname"), (Pointer(Pointer(GLvoid)), "pointer")]), + GlxFunction(Void, "glGetVertexAttribdvNV", [(GLuint, "index"), (GLenum, "pname"), (Pointer(GLdouble), "params")]), + GlxFunction(Void, "glGetVertexAttribfvNV", [(GLuint, "index"), (GLenum, "pname"), (Pointer(GLfloat), "params")]), + GlxFunction(Void, "glGetVertexAttribivNV", [(GLuint, "index"), (GLenum, "pname"), (Pointer(GLint), "params")]), + GlxFunction(GLboolean, "glIsProgramNV", [(GLuint, "program")]), + GlxFunction(Void, "glLoadProgramNV", [(GLenum, "target"), (GLuint, "id"), (GLsizei, "len"), (Pointer(Const(GLubyte)), "program")]), + GlxFunction(Void, "glProgramParameters4dvNV", [(GLenum, "target"), (GLuint, "index"), (GLuint, "num"), (Pointer(Const(GLdouble)), "params")]), + GlxFunction(Void, "glProgramParameters4fvNV", [(GLenum, "target"), (GLuint, "index"), (GLuint, "num"), (Pointer(Const(GLfloat)), "params")]), + GlxFunction(Void, "glRequestResidentProgramsNV", [(GLsizei, "n"), (Pointer(Const(GLuint)), "ids")]), + GlxFunction(Void, "glTrackMatrixNV", [(GLenum, "target"), (GLuint, "address"), (GLenum, "matrix"), (GLenum, "transform")]), + GlxFunction(Void, "glVertexAttrib1dNV", [(GLuint, "index"), (GLdouble, "x")]), + GlxFunction(Void, "glVertexAttrib1dvNV", [(GLuint, "index"), (Pointer(Const(GLdouble)), "v")]), + GlxFunction(Void, "glVertexAttrib1fNV", [(GLuint, "index"), (GLfloat, "x")]), + GlxFunction(Void, "glVertexAttrib1fvNV", [(GLuint, "index"), (Pointer(Const(GLfloat)), "v")]), + GlxFunction(Void, "glVertexAttrib1sNV", [(GLuint, "index"), (GLshort, "x")]), + GlxFunction(Void, "glVertexAttrib1svNV", [(GLuint, "index"), (Pointer(Const(GLshort)), "v")]), + GlxFunction(Void, "glVertexAttrib2dNV", [(GLuint, "index"), (GLdouble, "x"), (GLdouble, "y")]), + GlxFunction(Void, "glVertexAttrib2dvNV", [(GLuint, "index"), (Pointer(Const(GLdouble)), "v")]), + GlxFunction(Void, "glVertexAttrib2fNV", [(GLuint, "index"), (GLfloat, "x"), (GLfloat, "y")]), + GlxFunction(Void, "glVertexAttrib2fvNV", [(GLuint, "index"), (Pointer(Const(GLfloat)), "v")]), + GlxFunction(Void, "glVertexAttrib2sNV", [(GLuint, "index"), (GLshort, "x"), (GLshort, "y")]), + GlxFunction(Void, "glVertexAttrib2svNV", [(GLuint, "index"), (Pointer(Const(GLshort)), "v")]), + GlxFunction(Void, "glVertexAttrib3dNV", [(GLuint, "index"), (GLdouble, "x"), (GLdouble, "y"), (GLdouble, "z")]), + GlxFunction(Void, "glVertexAttrib3dvNV", [(GLuint, "index"), (Pointer(Const(GLdouble)), "v")]), + GlxFunction(Void, "glVertexAttrib3fNV", [(GLuint, "index"), (GLfloat, "x"), (GLfloat, "y"), (GLfloat, "z")]), + GlxFunction(Void, "glVertexAttrib3fvNV", [(GLuint, "index"), (Pointer(Const(GLfloat)), "v")]), + GlxFunction(Void, "glVertexAttrib3sNV", [(GLuint, "index"), (GLshort, "x"), (GLshort, "y"), (GLshort, "z")]), + GlxFunction(Void, "glVertexAttrib3svNV", [(GLuint, "index"), (Pointer(Const(GLshort)), "v")]), + GlxFunction(Void, "glVertexAttrib4dNV", [(GLuint, "index"), (GLdouble, "x"), (GLdouble, "y"), (GLdouble, "z"), (GLdouble, "w")]), + GlxFunction(Void, "glVertexAttrib4dvNV", [(GLuint, "index"), (Pointer(Const(GLdouble)), "v")]), + GlxFunction(Void, "glVertexAttrib4fNV", [(GLuint, "index"), (GLfloat, "x"), (GLfloat, "y"), (GLfloat, "z"), (GLfloat, "w")]), + GlxFunction(Void, "glVertexAttrib4fvNV", [(GLuint, "index"), (Pointer(Const(GLfloat)), "v")]), + GlxFunction(Void, "glVertexAttrib4sNV", [(GLuint, "index"), (GLshort, "x"), (GLshort, "y"), (GLshort, "z"), (GLshort, "w")]), + GlxFunction(Void, "glVertexAttrib4svNV", [(GLuint, "index"), (Pointer(Const(GLshort)), "v")]), + GlxFunction(Void, "glVertexAttrib4ubNV", [(GLuint, "index"), (GLubyte, "x"), (GLubyte, "y"), (GLubyte, "z"), (GLubyte, "w")]), + GlxFunction(Void, "glVertexAttrib4ubvNV", [(GLuint, "index"), (Pointer(Const(GLubyte)), "v")]), + GlxFunction(Void, "glVertexAttribPointerNV", [(GLuint, "index"), (GLint, "size"), (GLenum, "type"), (GLsizei, "stride"), (Pointer(Const(GLvoid)), "pointer")]), + GlxFunction(Void, "glVertexAttribs1dvNV", [(GLuint, "index"), (GLsizei, "n"), (Pointer(Const(GLdouble)), "v")]), + GlxFunction(Void, "glVertexAttribs1fvNV", [(GLuint, "index"), (GLsizei, "n"), (Pointer(Const(GLfloat)), "v")]), + GlxFunction(Void, "glVertexAttribs1svNV", [(GLuint, "index"), (GLsizei, "n"), (Pointer(Const(GLshort)), "v")]), + GlxFunction(Void, "glVertexAttribs2dvNV", [(GLuint, "index"), (GLsizei, "n"), (Pointer(Const(GLdouble)), "v")]), + GlxFunction(Void, "glVertexAttribs2fvNV", [(GLuint, "index"), (GLsizei, "n"), (Pointer(Const(GLfloat)), "v")]), + GlxFunction(Void, "glVertexAttribs2svNV", [(GLuint, "index"), (GLsizei, "n"), (Pointer(Const(GLshort)), "v")]), + GlxFunction(Void, "glVertexAttribs3dvNV", [(GLuint, "index"), (GLsizei, "n"), (Pointer(Const(GLdouble)), "v")]), + GlxFunction(Void, "glVertexAttribs3fvNV", [(GLuint, "index"), (GLsizei, "n"), (Pointer(Const(GLfloat)), "v")]), + GlxFunction(Void, "glVertexAttribs3svNV", [(GLuint, "index"), (GLsizei, "n"), (Pointer(Const(GLshort)), "v")]), + GlxFunction(Void, "glVertexAttribs4dvNV", [(GLuint, "index"), (GLsizei, "n"), (Pointer(Const(GLdouble)), "v")]), + GlxFunction(Void, "glVertexAttribs4fvNV", [(GLuint, "index"), (GLsizei, "n"), (Pointer(Const(GLfloat)), "v")]), + GlxFunction(Void, "glVertexAttribs4svNV", [(GLuint, "index"), (GLsizei, "n"), (Pointer(Const(GLshort)), "v")]), + GlxFunction(Void, "glVertexAttribs4ubvNV", [(GLuint, "index"), (GLsizei, "n"), (Pointer(Const(GLubyte)), "v")]), + GlxFunction(Void, "glGetTexBumpParameterfvATI", [(GLenum, "pname"), (Pointer(GLfloat), "param")]), + GlxFunction(Void, "glGetTexBumpParameterivATI", [(GLenum, "pname"), (Pointer(GLint), "param")]), + GlxFunction(Void, "glTexBumpParameterfvATI", [(GLenum, "pname"), (Pointer(Const(GLfloat)), "param")]), + GlxFunction(Void, "glTexBumpParameterivATI", [(GLenum, "pname"), (Pointer(Const(GLint)), "param")]), + GlxFunction(Void, "glAlphaFragmentOp1ATI", [(GLenum, "op"), (GLuint, "dst"), (GLuint, "dstMod"), (GLuint, "arg1"), (GLuint, "arg1Rep"), (GLuint, "arg1Mod")]), + GlxFunction(Void, "glAlphaFragmentOp2ATI", [(GLenum, "op"), (GLuint, "dst"), (GLuint, "dstMod"), (GLuint, "arg1"), (GLuint, "arg1Rep"), (GLuint, "arg1Mod"), (GLuint, "arg2"), (GLuint, "arg2Rep"), (GLuint, "arg2Mod")]), + GlxFunction(Void, "glAlphaFragmentOp3ATI", [(GLenum, "op"), (GLuint, "dst"), (GLuint, "dstMod"), (GLuint, "arg1"), (GLuint, "arg1Rep"), (GLuint, "arg1Mod"), (GLuint, "arg2"), (GLuint, "arg2Rep"), (GLuint, "arg2Mod"), (GLuint, "arg3"), (GLuint, "arg3Rep"), (GLuint, "arg3Mod")]), + GlxFunction(Void, "glBeginFragmentShaderATI", []), + GlxFunction(Void, "glBindFragmentShaderATI", [(GLuint, "id")]), + GlxFunction(Void, "glColorFragmentOp1ATI", [(GLenum, "op"), (GLuint, "dst"), (GLuint, "dstMask"), (GLuint, "dstMod"), (GLuint, "arg1"), (GLuint, "arg1Rep"), (GLuint, "arg1Mod")]), + GlxFunction(Void, "glColorFragmentOp2ATI", [(GLenum, "op"), (GLuint, "dst"), (GLuint, "dstMask"), (GLuint, "dstMod"), (GLuint, "arg1"), (GLuint, "arg1Rep"), (GLuint, "arg1Mod"), (GLuint, "arg2"), (GLuint, "arg2Rep"), (GLuint, "arg2Mod")]), + GlxFunction(Void, "glColorFragmentOp3ATI", [(GLenum, "op"), (GLuint, "dst"), (GLuint, "dstMask"), (GLuint, "dstMod"), (GLuint, "arg1"), (GLuint, "arg1Rep"), (GLuint, "arg1Mod"), (GLuint, "arg2"), (GLuint, "arg2Rep"), (GLuint, "arg2Mod"), (GLuint, "arg3"), (GLuint, "arg3Rep"), (GLuint, "arg3Mod")]), + GlxFunction(Void, "glDeleteFragmentShaderATI", [(GLuint, "id")]), + GlxFunction(Void, "glEndFragmentShaderATI", []), + GlxFunction(GLuint, "glGenFragmentShadersATI", [(GLuint, "range")]), + GlxFunction(Void, "glPassTexCoordATI", [(GLuint, "dst"), (GLuint, "coord"), (GLenum, "swizzle")]), + GlxFunction(Void, "glSampleMapATI", [(GLuint, "dst"), (GLuint, "interp"), (GLenum, "swizzle")]), + GlxFunction(Void, "glSetFragmentShaderConstantATI", [(GLuint, "dst"), (Pointer(Const(GLfloat)), "value")]), + GlxFunction(Void, "glPointParameteriNV", [(GLenum, "pname"), (GLint, "param")]), + GlxFunction(Void, "glPointParameterivNV", [(GLenum, "pname"), (Pointer(Const(GLint)), "params")]), + GlxFunction(Void, "glActiveStencilFaceEXT", [(GLenum, "face")]), + GlxFunction(Void, "glBindVertexArrayAPPLE", [(GLuint, "array")]), + GlxFunction(Void, "glDeleteVertexArraysAPPLE", [(GLsizei, "n"), (Pointer(Const(GLuint)), "arrays")]), + GlxFunction(Void, "glGenVertexArraysAPPLE", [(GLsizei, "n"), (Pointer(GLuint), "arrays")]), + GlxFunction(GLboolean, "glIsVertexArrayAPPLE", [(GLuint, "array")]), + GlxFunction(Void, "glGetProgramNamedParameterdvNV", [(GLuint, "id"), (GLsizei, "len"), (Pointer(Const(GLubyte)), "name"), (Pointer(GLdouble), "params")]), + GlxFunction(Void, "glGetProgramNamedParameterfvNV", [(GLuint, "id"), (GLsizei, "len"), (Pointer(Const(GLubyte)), "name"), (Pointer(GLfloat), "params")]), + GlxFunction(Void, "glProgramNamedParameter4dNV", [(GLuint, "id"), (GLsizei, "len"), (Pointer(Const(GLubyte)), "name"), (GLdouble, "x"), (GLdouble, "y"), (GLdouble, "z"), (GLdouble, "w")]), + GlxFunction(Void, "glProgramNamedParameter4dvNV", [(GLuint, "id"), (GLsizei, "len"), (Pointer(Const(GLubyte)), "name"), (Pointer(Const(GLdouble)), "v")]), + GlxFunction(Void, "glProgramNamedParameter4fNV", [(GLuint, "id"), (GLsizei, "len"), (Pointer(Const(GLubyte)), "name"), (GLfloat, "x"), (GLfloat, "y"), (GLfloat, "z"), (GLfloat, "w")]), + GlxFunction(Void, "glProgramNamedParameter4fvNV", [(GLuint, "id"), (GLsizei, "len"), (Pointer(Const(GLubyte)), "name"), (Pointer(Const(GLfloat)), "v")]), + GlxFunction(Void, "glDepthBoundsEXT", [(GLclampd, "zmin"), (GLclampd, "zmax")]), + GlxFunction(Void, "glBlendEquationSeparateEXT", [(GLenum, "modeRGB"), (GLenum, "modeA")]), + GlxFunction(Void, "glBindFramebufferEXT", [(GLenum, "target"), (GLuint, "framebuffer")]), + GlxFunction(Void, "glBindRenderbufferEXT", [(GLenum, "target"), (GLuint, "renderbuffer")]), + GlxFunction(GLenum, "glCheckFramebufferStatusEXT", [(GLenum, "target")]), + GlxFunction(Void, "glDeleteFramebuffersEXT", [(GLsizei, "n"), (Pointer(Const(GLuint)), "framebuffers")]), + GlxFunction(Void, "glDeleteRenderbuffersEXT", [(GLsizei, "n"), (Pointer(Const(GLuint)), "renderbuffers")]), + GlxFunction(Void, "glFramebufferRenderbufferEXT", [(GLenum, "target"), (GLenum, "attachment"), (GLenum, "renderbuffertarget"), (GLuint, "renderbuffer")]), + GlxFunction(Void, "glFramebufferTexture1DEXT", [(GLenum, "target"), (GLenum, "attachment"), (GLenum, "textarget"), (GLuint, "texture"), (GLint, "level")]), + GlxFunction(Void, "glFramebufferTexture2DEXT", [(GLenum, "target"), (GLenum, "attachment"), (GLenum, "textarget"), (GLuint, "texture"), (GLint, "level")]), + GlxFunction(Void, "glFramebufferTexture3DEXT", [(GLenum, "target"), (GLenum, "attachment"), (GLenum, "textarget"), (GLuint, "texture"), (GLint, "level"), (GLint, "zoffset")]), + GlxFunction(Void, "glGenFramebuffersEXT", [(GLsizei, "n"), (Pointer(GLuint), "framebuffers")]), + GlxFunction(Void, "glGenRenderbuffersEXT", [(GLsizei, "n"), (Pointer(GLuint), "renderbuffers")]), + GlxFunction(Void, "glGenerateMipmapEXT", [(GLenum, "target")]), + GlxFunction(Void, "glGetFramebufferAttachmentParameterivEXT", [(GLenum, "target"), (GLenum, "attachment"), (GLenum, "pname"), (Pointer(GLint), "params")]), + GlxFunction(Void, "glGetRenderbufferParameterivEXT", [(GLenum, "target"), (GLenum, "pname"), (Pointer(GLint), "params")]), + GlxFunction(GLboolean, "glIsFramebufferEXT", [(GLuint, "framebuffer")]), + GlxFunction(GLboolean, "glIsRenderbufferEXT", [(GLuint, "renderbuffer")]), + GlxFunction(Void, "glRenderbufferStorageEXT", [(GLenum, "target"), (GLenum, "internalformat"), (GLsizei, "width"), (GLsizei, "height")]), + GlxFunction(Void, "glBlitFramebufferEXT", [(GLint, "srcX0"), (GLint, "srcY0"), (GLint, "srcX1"), (GLint, "srcY1"), (GLint, "dstX0"), (GLint, "dstY0"), (GLint, "dstX1"), (GLint, "dstY1"), (GLbitfield, "mask"), (GLenum, "filter")]), + GlxFunction(Void, "glFramebufferTextureLayerEXT", [(GLenum, "target"), (GLenum, "attachment"), (GLuint, "texture"), (GLint, "level"), (GLint, "layer")]), + GlxFunction(Void, "glStencilFuncSeparateATI", [(GLenum, "frontfunc"), (GLenum, "backfunc"), (GLint, "ref"), (GLuint, "mask")]), + GlxFunction(Void, "glProgramEnvParameters4fvEXT", [(GLenum, "target"), (GLuint, "index"), (GLsizei, "count"), (Pointer(Const(GLfloat)), "params")]), + GlxFunction(Void, "glProgramLocalParameters4fvEXT", [(GLenum, "target"), (GLuint, "index"), (GLsizei, "count"), (Pointer(Const(GLfloat)), "params")]), + GlxFunction(Void, "glGetQueryObjecti64vEXT", [(GLuint, "id"), (GLenum, "pname"), (Pointer(GLint64EXT), "params")]), + GlxFunction(Void, "glGetQueryObjectui64vEXT", [(GLuint, "id"), (GLenum, "pname"), (Pointer(GLuint64EXT), "params")]), +] + +if __name__ == '__main__': + print + print '#include ' + print '#include ' + print '#include ' + print '#include ' + print '#include ' + print '#include ' + print '#include ' + print '#include ' + print + print '#include "log.hpp"' + print + print 'extern "C" {' + print + wrap() + print + print '}' diff --git a/log.cpp b/log.cpp index 1e05287..0461794 100644 --- a/log.cpp +++ b/log.cpp @@ -29,7 +29,9 @@ #include #include +#ifdef WIN32 #include +#endif #include @@ -46,21 +48,29 @@ #ifndef vsnprintf #define vsnprintf _vsnprintf #endif -#endif +#endif /* WIN32 */ +#ifndef PATH_MAX +#define PATH_MAX 1024 +#endif namespace Log { static gzFile g_gzFile = NULL; static char g_szFileName[PATH_MAX]; + +#if WIN32 static CRITICAL_SECTION CriticalSection; +#endif /* WIN32 */ static void _Close(void) { if(g_gzFile != NULL) { gzclose(g_gzFile); g_gzFile = NULL; +#if WIN32 DeleteCriticalSection(&CriticalSection); +#endif } } @@ -73,6 +83,7 @@ static void _Open(const char *szName, const char *szExtension) { char *lpProcessName; char *lpProcessExt; +#ifdef WIN32 GetModuleFileNameA(NULL, szProcessPath, sizeof(szProcessPath)/sizeof(szProcessPath[0])); lpProcessName = strrchr(szProcessPath, '\\'); @@ -80,6 +91,10 @@ static void _Open(const char *szName, const char *szExtension) { lpProcessExt = strrchr(lpProcessName, '.'); if(lpProcessExt) *lpProcessExt = '\0'; +#else + // http://stackoverflow.com/questions/1023306/finding-current-executables-path-without-proc-self-exe + lpProcessName = ""; +#endif for(;;) { FILE *file; @@ -99,7 +114,9 @@ static void _Open(const char *szName, const char *szExtension) { } g_gzFile = gzopen(g_szFileName, "wb"); +#ifdef WIN32 InitializeCriticalSection(&CriticalSection); +#endif } static inline void _ReOpen(void) { @@ -293,39 +310,23 @@ void TextF(const char *format, ...) { Escape(szBuffer); } -static LARGE_INTEGER frequency = {0}; -static LARGE_INTEGER startcounter; - void BeginCall(const char *function) { +#ifdef WIN32 EnterCriticalSection(&CriticalSection); +#endif Indent(1); BeginTag("call", "name", function); NewLine(); - - if(!frequency.QuadPart) - QueryPerformanceFrequency(&frequency); - - QueryPerformanceCounter(&startcounter); } void EndCall(void) { - LARGE_INTEGER endcounter; - LONGLONG usecs; - - QueryPerformanceCounter(&endcounter); - usecs = (endcounter.QuadPart - startcounter.QuadPart)*1000000/frequency.QuadPart; - - Indent(2); - BeginTag("duration"); - TextF("%llu", usecs); - EndTag("duration"); - NewLine(); - Indent(1); EndTag("call"); NewLine(); gzflush(g_gzFile, Z_SYNC_FLUSH); +#ifdef WIN32 LeaveCriticalSection(&CriticalSection); +#endif } void BeginArg(const char *type, const char *name) {