diff options
-rw-r--r-- | CMakeLists.txt | 7 | ||||
-rw-r--r-- | formatter.hpp | 4 | ||||
-rw-r--r-- | glapi.py | 118 | ||||
-rw-r--r-- | glext.h (renamed from include/GL/glext.h) | 0 | ||||
-rw-r--r-- | glimports.hpp | 8 | ||||
-rw-r--r-- | glsize.hpp | 25 | ||||
-rw-r--r-- | glxext.h (renamed from include/GL/glxext.h) | 0 | ||||
-rw-r--r-- | glxtrace.py | 4 | ||||
-rw-r--r-- | trace_model.cpp | 6 | ||||
-rw-r--r-- | trace_parser.hpp | 6 | ||||
-rw-r--r-- | wglext.h (renamed from include/GL/wglext.h) | 0 |
11 files changed, 99 insertions, 79 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 26d3d023..95f19c67 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,6 +44,8 @@ if (MSVC) add_definitions (-wd4244) # conversion from 'type1' to 'type2', possible loss of data add_definitions (-wd4505) # unreferenced local function has been removed add_definitions (-wd4800) # forcing value to bool 'true' or 'false' (performance warning) + # XXX: it's safer to use ssize_t everywhere instead of disabling warning + add_definitions (-wd4018) # signed/unsigned mismatch # Use static runtime # http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_build_my_MSVC_application_with_a_static_runtime.3F @@ -56,7 +58,10 @@ if (MSVC) endif (${flag_var} MATCHES "/MD") endforeach (flag_var) else () + # Adjust warnings add_definitions (-Wall) + # XXX: it's safer to use ssize_t everywhere instead of disabling warning + add_definitions (-Wno-sign-compare) # comparison between signed and unsigned integer expressions endif () # Use bundled ZLIB if system one can't be found @@ -83,7 +88,7 @@ else (NOT ZLIB_FOUND) link_libraries (${ZLIB_LIBRARIES}) endif (NOT ZLIB_FOUND) -include_directories (${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/include) +include_directories (${CMAKE_CURRENT_SOURCE_DIR}) if (WIN32) # Put wrappers in a separate directory diff --git a/formatter.hpp b/formatter.hpp index c2d3455f..2ae789d4 100644 --- a/formatter.hpp +++ b/formatter.hpp @@ -40,7 +40,7 @@ class Attribute { public: virtual ~Attribute() {} - virtual void apply(std::ostream& os) const {} + virtual void apply(std::ostream &) const {} }; @@ -58,7 +58,7 @@ public: virtual Attribute *normal(void) const { return new Attribute; } virtual Attribute *bold(void) const { return new Attribute; } virtual Attribute *italic(void) const { return new Attribute; } - virtual Attribute *color(Color color) const { return new Attribute; } + virtual Attribute *color(Color) const { return new Attribute; } }; @@ -88,8 +88,8 @@ glapi.add_functions([ GlFunction(Void, "glTexParameterfv", [(GLenum, "target"), (GLenum, "pname"), (Const(Array(GLfloat, "__glTexParameterfv_size(pname)")), "params")]), GlFunction(Void, "glTexParameteri", [(GLenum, "target"), (GLenum, "pname"), (GLint, "param")]), GlFunction(Void, "glTexParameteriv", [(GLenum, "target"), (GLenum, "pname"), (Const(Array(GLint, "__glTexParameteriv_size(pname)")), "params")]), - GlFunction(Void, "glTexImage1D", [(GLenum, "target"), (GLint, "level"), (GLint, "internalformat"), (GLsizei, "width"), (GLint, "border"), (GLenum, "format"), (GLenum, "type"), (Blob(Const(GLvoid), "__gl_image_size(format, type, width, 1, 1, border)"), "pixels")]), - GlFunction(Void, "glTexImage2D", [(GLenum, "target"), (GLint, "level"), (GLint, "internalformat"), (GLsizei, "width"), (GLsizei, "height"), (GLint, "border"), (GLenum, "format"), (GLenum, "type"), (Blob(Const(GLvoid), "__gl_image_size(format, type, width, height, 1, border)"), "pixels")]), + GlFunction(Void, "glTexImage1D", [(GLenum, "target"), (GLint, "level"), (GLint, "internalformat"), (GLsizei, "width"), (GLint, "border"), (GLenum, "format"), (GLenum, "type"), (Blob(Const(GLvoid), "__glTexImage1D_size(format, type, width, border)"), "pixels")]), + GlFunction(Void, "glTexImage2D", [(GLenum, "target"), (GLint, "level"), (GLint, "internalformat"), (GLsizei, "width"), (GLsizei, "height"), (GLint, "border"), (GLenum, "format"), (GLenum, "type"), (Blob(Const(GLvoid), "__glTexImage2D_size(format, type, width, height, border)"), "pixels")]), GlFunction(Void, "glDrawBuffer", [(GLenum, "mode")]), GlFunction(Void, "glClear", [(GLbitfield_attrib, "mask")]), GlFunction(Void, "glClearColor", [(GLclampf, "red"), (GLclampf, "green"), (GLclampf, "blue"), (GLclampf, "alpha")]), @@ -111,17 +111,17 @@ glapi.add_functions([ GlFunction(Void, "glPixelStorei", [(GLenum, "pname"), (GLint, "param")]), GlFunction(Void, "glReadBuffer", [(GLenum, "mode")]), GlFunction(Void, "glReadPixels", [(GLint, "x"), (GLint, "y"), (GLsizei, "width"), (GLsizei, "height"), (GLenum, "format"), (GLenum, "type"), Out(OpaquePointer(GLvoid), "pixels")], sideeffects=False), - GlFunction(Void, "glGetBooleanv", [(GLenum, "pname"), Out(Pointer(GLboolean), "params")], sideeffects=False), - GlFunction(Void, "glGetDoublev", [(GLenum, "pname"), Out(Pointer(GLdouble), "params")], sideeffects=False), + GlFunction(Void, "glGetBooleanv", [(GLenum, "pname"), Out(Array(GLboolean, "__glGetBooleanv_size(pname)"), "params")], sideeffects=False), + GlFunction(Void, "glGetDoublev", [(GLenum, "pname"), Out(Array(GLdouble, "__glGetDoublev_size(pname)"), "params")], sideeffects=False), GlFunction(GLenum, "glGetError", [], sideeffects=False), - GlFunction(Void, "glGetFloatv", [(GLenum, "pname"), Out(Pointer(GLfloat), "params")], sideeffects=False), - GlFunction(Void, "glGetIntegerv", [(GLenum, "pname"), Out(Pointer(GLint), "params")], sideeffects=False), + GlFunction(Void, "glGetFloatv", [(GLenum, "pname"), Out(Array(GLfloat, "__glGetFloatv_size(pname)"), "params")], sideeffects=False), + GlFunction(Void, "glGetIntegerv", [(GLenum, "pname"), Out(Array(GLint, "__glGetIntegerv_size(pname)"), "params")], sideeffects=False), GlFunction(Alias("const GLubyte *", CString), "glGetString", [(GLenum, "name")], sideeffects=False), GlFunction(Void, "glGetTexImage", [(GLenum, "target"), (GLint, "level"), (GLenum, "format"), (GLenum, "type"), Out(OpaquePointer(GLvoid), "pixels")], sideeffects=False), - GlFunction(Void, "glGetTexParameterfv", [(GLenum, "target"), (GLenum, "pname"), Out(Pointer(GLfloat), "params")], sideeffects=False), - GlFunction(Void, "glGetTexParameteriv", [(GLenum, "target"), (GLenum, "pname"), Out(Pointer(GLint), "params")], sideeffects=False), - GlFunction(Void, "glGetTexLevelParameterfv", [(GLenum, "target"), (GLint, "level"), (GLenum, "pname"), Out(Pointer(GLfloat), "params")], sideeffects=False), - GlFunction(Void, "glGetTexLevelParameteriv", [(GLenum, "target"), (GLint, "level"), (GLenum, "pname"), Out(Pointer(GLint), "params")], sideeffects=False), + GlFunction(Void, "glGetTexParameterfv", [(GLenum, "target"), (GLenum, "pname"), Out(Array(GLfloat, "__glGetTexParameterfv_size(pname)"), "params")], sideeffects=False), + GlFunction(Void, "glGetTexParameteriv", [(GLenum, "target"), (GLenum, "pname"), Out(Array(GLint, "__glGetTexParameteriv_size(pname)"), "params")], sideeffects=False), + GlFunction(Void, "glGetTexLevelParameterfv", [(GLenum, "target"), (GLint, "level"), (GLenum, "pname"), Out(Array(GLfloat, "__glGetTexLevelParameterfv_size(pname)"), "params")], sideeffects=False), + GlFunction(Void, "glGetTexLevelParameteriv", [(GLenum, "target"), (GLint, "level"), (GLenum, "pname"), Out(Array(GLint, "__glGetTexLevelParameteriv_size(pname)"), "params")], sideeffects=False), GlFunction(GLboolean, "glIsEnabled", [(GLenum, "cap")]), GlFunction(Void, "glDepthRange", [(GLclampd, "zNear"), (GLclampd, "zFar")]), GlFunction(Void, "glViewport", [(GLint, "x"), (GLint, "y"), (GLsizei, "width"), (GLsizei, "height")]), @@ -135,7 +135,7 @@ glapi.add_functions([ GlFunction(GLlist, "glGenLists", [(GLsizei, "range")]), # XXX GlFunction(Void, "glListBase", [(GLuint, "base")]), GlFunction(Void, "glBegin", [(GLenum_mode, "mode")]), - GlFunction(Void, "glBitmap", [(GLsizei, "width"), (GLsizei, "height"), (GLfloat, "xorig"), (GLfloat, "yorig"), (GLfloat, "xmove"), (GLfloat, "ymove"), (Blob(Const(GLubyte), "__gl_bitmap_size(width, height)"), "bitmap")]), + GlFunction(Void, "glBitmap", [(GLsizei, "width"), (GLsizei, "height"), (GLfloat, "xorig"), (GLfloat, "yorig"), (GLfloat, "xmove"), (GLfloat, "ymove"), (Blob(Const(GLubyte), "__glBitmap_size(width, height)"), "bitmap")]), GlFunction(Void, "glColor3b", [(GLbyte, "red"), (GLbyte, "green"), (GLbyte, "blue")]), GlFunction(Void, "glColor3bv", [(Const(Array(GLbyte, "3")), "v")]), GlFunction(Void, "glColor3d", [(GLdouble, "red"), (GLdouble, "green"), (GLdouble, "blue")]), @@ -280,34 +280,34 @@ glapi.add_functions([ GlFunction(Void, "glClipPlane", [(GLenum, "plane"), (Const(Array(GLdouble, "4")), "equation")]), GlFunction(Void, "glColorMaterial", [(GLenum, "face"), (GLenum, "mode")]), GlFunction(Void, "glFogf", [(GLenum, "pname"), (GLfloat, "param")]), - GlFunction(Void, "glFogfv", [(GLenum, "pname"), (Const(Array(GLfloat, "(pname == GL_FOG_COLOR ? 4 : 1)")), "params")]), + GlFunction(Void, "glFogfv", [(GLenum, "pname"), (Const(Array(GLfloat, "__glFogfv_size(pname)")), "params")]), GlFunction(Void, "glFogi", [(GLenum, "pname"), (GLint, "param")]), - GlFunction(Void, "glFogiv", [(GLenum, "pname"), (Const(Array(GLint, "(pname == GL_FOG_COLOR ? 4 : 1)")), "params")]), + GlFunction(Void, "glFogiv", [(GLenum, "pname"), (Const(Array(GLint, "__glFogiv_size(pname)")), "params")]), GlFunction(Void, "glLightf", [(GLenum, "light"), (GLenum, "pname"), (GLfloat, "param")]), - GlFunction(Void, "glLightfv", [(GLenum, "light"), (GLenum, "pname"), (Const(Array(GLfloat, "4")), "params")]), # XXX + GlFunction(Void, "glLightfv", [(GLenum, "light"), (GLenum, "pname"), (Const(Array(GLfloat, "__glLightfv_size(pname)")), "params")]), GlFunction(Void, "glLighti", [(GLenum, "light"), (GLenum, "pname"), (GLint, "param")]), - GlFunction(Void, "glLightiv", [(GLenum, "light"), (GLenum, "pname"), (Const(Array(GLint, "4")), "params")]), # XXX + GlFunction(Void, "glLightiv", [(GLenum, "light"), (GLenum, "pname"), (Const(Array(GLint, "__glLightiv_size(pname)")), "params")]), GlFunction(Void, "glLightModelf", [(GLenum, "pname"), (GLfloat, "param")]), - GlFunction(Void, "glLightModelfv", [(GLenum, "pname"), (Const(Array(GLfloat, "4")), "params")]), # XXX + GlFunction(Void, "glLightModelfv", [(GLenum, "pname"), (Const(Array(GLfloat, "__glLightModelfv_size(pname)")), "params")]), GlFunction(Void, "glLightModeli", [(GLenum, "pname"), (GLint, "param")]), - GlFunction(Void, "glLightModeliv", [(GLenum, "pname"), (Const(Array(GLint, "4")), "params")]), # XXX + GlFunction(Void, "glLightModeliv", [(GLenum, "pname"), (Const(Array(GLint, "__glLightModeliv_size(pname)")), "params")]), GlFunction(Void, "glLineStipple", [(GLint, "factor"), (GLushort, "pattern")]), GlFunction(Void, "glMaterialf", [(GLenum, "face"), (GLenum, "pname"), (GLfloat, "param")]), - GlFunction(Void, "glMaterialfv", [(GLenum, "face"), (GLenum, "pname"), (Const(Array(GLfloat, "4")), "params")]), # XXX + GlFunction(Void, "glMaterialfv", [(GLenum, "face"), (GLenum, "pname"), (Const(Array(GLfloat, "__glMaterialfv_size(pname)")), "params")]), GlFunction(Void, "glMateriali", [(GLenum, "face"), (GLenum, "pname"), (GLint, "param")]), - GlFunction(Void, "glMaterialiv", [(GLenum, "face"), (GLenum, "pname"), (Const(Array(GLint, "4")), "params")]), # XXX - GlFunction(Void, "glPolygonStipple", [(Blob(Const(GLubyte), "__gl_bitmap_size(32, 32)"), "mask")]), + GlFunction(Void, "glMaterialiv", [(GLenum, "face"), (GLenum, "pname"), (Const(Array(GLint, "__glMaterialiv_size(pname)")), "params")]), + GlFunction(Void, "glPolygonStipple", [(Const(Array(GLubyte, "__glPolygonStipple_size()")), "mask")]), GlFunction(Void, "glShadeModel", [(GLenum, "mode")]), GlFunction(Void, "glTexEnvf", [(GLenum, "target"), (GLenum, "pname"), (GLfloat, "param")]), - GlFunction(Void, "glTexEnvfv", [(GLenum, "target"), (GLenum, "pname"), (Const(Array(GLfloat, "(pname == GL_TEXTURE_ENV_COLOR ? 4 : 1)")), "params")]), + GlFunction(Void, "glTexEnvfv", [(GLenum, "target"), (GLenum, "pname"), (Const(Array(GLfloat, "__glTexEnvfv_size(pname)")), "params")]), GlFunction(Void, "glTexEnvi", [(GLenum, "target"), (GLenum, "pname"), (GLint, "param")]), - GlFunction(Void, "glTexEnviv", [(GLenum, "target"), (GLenum, "pname"), (Const(Array(GLint, "(pname == GL_TEXTURE_ENV_COLOR ? 4 : 1)")), "params")]), + GlFunction(Void, "glTexEnviv", [(GLenum, "target"), (GLenum, "pname"), (Const(Array(GLint, "__glTexEnviv_size(pname)")), "params")]), GlFunction(Void, "glTexGend", [(GLenum, "coord"), (GLenum, "pname"), (GLdouble, "param")]), - GlFunction(Void, "glTexGendv", [(GLenum, "coord"), (GLenum, "pname"), (Pointer(Const(GLdouble)), "params")]), + GlFunction(Void, "glTexGendv", [(GLenum, "coord"), (GLenum, "pname"), (Const(Array(GLdouble, "__glTexGendv_size(pname)")), "params")]), GlFunction(Void, "glTexGenf", [(GLenum, "coord"), (GLenum, "pname"), (GLfloat, "param")]), - GlFunction(Void, "glTexGenfv", [(GLenum, "coord"), (GLenum, "pname"), (Pointer(Const(GLfloat)), "params")]), + GlFunction(Void, "glTexGenfv", [(GLenum, "coord"), (GLenum, "pname"), (Const(Array(GLfloat, "__glTexGenfv_size(pname)")), "params")]), GlFunction(Void, "glTexGeni", [(GLenum, "coord"), (GLenum, "pname"), (GLint, "param")]), - GlFunction(Void, "glTexGeniv", [(GLenum, "coord"), (GLenum, "pname"), (Pointer(Const(GLint)), "params")]), + GlFunction(Void, "glTexGeniv", [(GLenum, "coord"), (GLenum, "pname"), (Const(Array(GLint, "__glTexGeniv_size(pname)")), "params")]), GlFunction(Void, "glFeedbackBuffer", [(GLsizei, "size"), (GLenum, "type"), Out(Array(GLfloat, "size"), "buffer")]), GlFunction(Void, "glSelectBuffer", [(GLsizei, "size"), Out(Array(GLuint, "size"), "buffer")]), GlFunction(GLint, "glRenderMode", [(GLenum, "mode")]), @@ -350,24 +350,24 @@ glapi.add_functions([ GlFunction(Void, "glPixelMapuiv", [(GLenum, "map"), (GLsizei, "mapsize"), (Const(Array(GLuint, "mapsize")), "values")]), GlFunction(Void, "glPixelMapusv", [(GLenum, "map"), (GLsizei, "mapsize"), (Const(Array(GLushort, "mapsize")), "values")]), GlFunction(Void, "glCopyPixels", [(GLint, "x"), (GLint, "y"), (GLsizei, "width"), (GLsizei, "height"), (GLenum, "type")]), - GlFunction(Void, "glDrawPixels", [(GLsizei, "width"), (GLsizei, "height"), (GLenum, "format"), (GLenum, "type"), (Blob(Const(GLvoid), "__gl_image_size(format, type, width, height, 1, 0)"), "pixels")]), + GlFunction(Void, "glDrawPixels", [(GLsizei, "width"), (GLsizei, "height"), (GLenum, "format"), (GLenum, "type"), (Blob(Const(GLvoid), "__glDrawPixels_size(format, type, width, height)"), "pixels")]), GlFunction(Void, "glGetClipPlane", [(GLenum, "plane"), Out(Array(GLdouble, "4"), "equation")], sideeffects=False), - GlFunction(Void, "glGetLightfv", [(GLenum, "light"), (GLenum, "pname"), Out(Pointer(GLfloat), "params")], sideeffects=False), - GlFunction(Void, "glGetLightiv", [(GLenum, "light"), (GLenum, "pname"), Out(Pointer(GLint), "params")], sideeffects=False), + GlFunction(Void, "glGetLightfv", [(GLenum, "light"), (GLenum, "pname"), Out(Array(GLfloat, "__glGetLightfv_size(pname)"), "params")], sideeffects=False), + GlFunction(Void, "glGetLightiv", [(GLenum, "light"), (GLenum, "pname"), Out(Array(GLint, "__glGetLightiv_size(pname)"), "params")], sideeffects=False), GlFunction(Void, "glGetMapdv", [(GLenum, "target"), (GLenum, "query"), Out(Pointer(GLdouble), "v")], sideeffects=False), GlFunction(Void, "glGetMapfv", [(GLenum, "target"), (GLenum, "query"), Out(Pointer(GLfloat), "v")], sideeffects=False), GlFunction(Void, "glGetMapiv", [(GLenum, "target"), (GLenum, "query"), Out(Pointer(GLint), "v")], sideeffects=False), - GlFunction(Void, "glGetMaterialfv", [(GLenum, "face"), (GLenum, "pname"), Out(Pointer(GLfloat), "params")], sideeffects=False), - GlFunction(Void, "glGetMaterialiv", [(GLenum, "face"), (GLenum, "pname"), Out(Pointer(GLint), "params")], sideeffects=False), + GlFunction(Void, "glGetMaterialfv", [(GLenum, "face"), (GLenum, "pname"), Out(Array(GLfloat, "__glGetMaterialfv_size(pname)"), "params")], sideeffects=False), + GlFunction(Void, "glGetMaterialiv", [(GLenum, "face"), (GLenum, "pname"), Out(Array(GLint, "__glGetMaterialiv_size(pname)"), "params")], sideeffects=False), GlFunction(Void, "glGetPixelMapfv", [(GLenum, "map"), Out(Pointer(GLfloat), "values")], sideeffects=False), GlFunction(Void, "glGetPixelMapuiv", [(GLenum, "map"), Out(Pointer(GLuint), "values")], sideeffects=False), GlFunction(Void, "glGetPixelMapusv", [(GLenum, "map"), Out(Pointer(GLushort), "values")], sideeffects=False), GlFunction(Void, "glGetPolygonStipple", [Out(OpaquePointer(GLubyte), "mask")], sideeffects=False), - GlFunction(Void, "glGetTexEnvfv", [(GLenum, "target"), (GLenum, "pname"), Out(OpaquePointer(GLfloat), "params")], sideeffects=False), - GlFunction(Void, "glGetTexEnviv", [(GLenum, "target"), (GLenum, "pname"), Out(OpaquePointer(GLint), "params")], sideeffects=False), - GlFunction(Void, "glGetTexGendv", [(GLenum, "coord"), (GLenum, "pname"), Out(OpaquePointer(GLdouble), "params")], sideeffects=False), - GlFunction(Void, "glGetTexGenfv", [(GLenum, "coord"), (GLenum, "pname"), Out(OpaquePointer(GLfloat), "params")], sideeffects=False), - GlFunction(Void, "glGetTexGeniv", [(GLenum, "coord"), (GLenum, "pname"), Out(OpaquePointer(GLint), "params")], sideeffects=False), + GlFunction(Void, "glGetTexEnvfv", [(GLenum, "target"), (GLenum, "pname"), Out(Array(GLfloat, "__glGetTexEnvfv_size(pname)"), "params")], sideeffects=False), + GlFunction(Void, "glGetTexEnviv", [(GLenum, "target"), (GLenum, "pname"), Out(Array(GLint, "__glGetTexEnviv_size(pname)"), "params")], sideeffects=False), + GlFunction(Void, "glGetTexGendv", [(GLenum, "coord"), (GLenum, "pname"), Out(Array(GLdouble, "__glGetTexGendv_size(pname)"), "params")], sideeffects=False), + GlFunction(Void, "glGetTexGenfv", [(GLenum, "coord"), (GLenum, "pname"), Out(Array(GLfloat, "__glGetTexGenfv_size(pname)"), "params")], sideeffects=False), + GlFunction(Void, "glGetTexGeniv", [(GLenum, "coord"), (GLenum, "pname"), Out(Array(GLint, "__glGetTexGeniv_size(pname)"), "params")], sideeffects=False), GlFunction(GLboolean, "glIsList", [(GLuint, "list")]), GlFunction(Void, "glFrustum", [(GLdouble, "left"), (GLdouble, "right"), (GLdouble, "bottom"), (GLdouble, "top"), (GLdouble, "zNear"), (GLdouble, "zFar")]), GlFunction(Void, "glLoadIdentity", []), @@ -395,8 +395,8 @@ glapi.add_functions([ GlFunction(Void, "glCopyTexImage2D", [(GLenum, "target"), (GLint, "level"), (GLenum, "internalformat"), (GLint, "x"), (GLint, "y"), (GLsizei, "width"), (GLsizei, "height"), (GLint, "border")]), GlFunction(Void, "glCopyTexSubImage1D", [(GLenum, "target"), (GLint, "level"), (GLint, "xoffset"), (GLint, "x"), (GLint, "y"), (GLsizei, "width")]), GlFunction(Void, "glCopyTexSubImage2D", [(GLenum, "target"), (GLint, "level"), (GLint, "xoffset"), (GLint, "yoffset"), (GLint, "x"), (GLint, "y"), (GLsizei, "width"), (GLsizei, "height")]), - GlFunction(Void, "glTexSubImage1D", [(GLenum, "target"), (GLint, "level"), (GLint, "xoffset"), (GLsizei, "width"), (GLenum, "format"), (GLenum, "type"), (Blob(Const(GLvoid), "__gl_image_size(format, type, width, 1, 1, 0)"), "pixels")]), - GlFunction(Void, "glTexSubImage2D", [(GLenum, "target"), (GLint, "level"), (GLint, "xoffset"), (GLint, "yoffset"), (GLsizei, "width"), (GLsizei, "height"), (GLenum, "format"), (GLenum, "type"), (Blob(Const(GLvoid), "__gl_image_size(format, type, width, height, 1, 0)"), "pixels")]), + GlFunction(Void, "glTexSubImage1D", [(GLenum, "target"), (GLint, "level"), (GLint, "xoffset"), (GLsizei, "width"), (GLenum, "format"), (GLenum, "type"), (Blob(Const(GLvoid), "__glTexSubImage1D_size(format, type, width)"), "pixels")]), + GlFunction(Void, "glTexSubImage2D", [(GLenum, "target"), (GLint, "level"), (GLint, "xoffset"), (GLint, "yoffset"), (GLsizei, "width"), (GLsizei, "height"), (GLenum, "format"), (GLenum, "type"), (Blob(Const(GLvoid), "__glTexSubImage2D_size(format, type, width, height)"), "pixels")]), GlFunction(Void, "glBindTexture", [(GLenum, "target"), (GLtexture, "texture")]), GlFunction(Void, "glDeleteTextures", [(GLsizei, "n"), (Const(Array(GLtexture, "n")), "textures")]), GlFunction(Void, "glGenTextures", [(GLsizei, "n"), Out(Array(GLtexture, "n"), "textures")]), @@ -424,39 +424,39 @@ glapi.add_functions([ GlFunction(Void, "glBlendColor", [(GLclampf, "red"), (GLclampf, "green"), (GLclampf, "blue"), (GLclampf, "alpha")]), GlFunction(Void, "glBlendEquation", [(GLenum, "mode")]), GlFunction(Void, "glDrawRangeElements", [(GLenum_mode, "mode"), (GLuint, "start"), (GLuint, "end"), (GLsizei, "count"), (GLenum, "type"), (Blob(Const(GLvoid), "__glCallLists_size(count, type)"), "indices")]), - GlFunction(Void, "glTexImage3D", [(GLenum, "target"), (GLint, "level"), (GLint, "internalformat"), (GLsizei, "width"), (GLsizei, "height"), (GLsizei, "depth"), (GLint, "border"), (GLenum, "format"), (GLenum, "type"), (Blob(Const(GLvoid), "__gl_image_size(format, type, width, height, depth, border)"), "pixels")]), - GlFunction(Void, "glTexSubImage3D", [(GLenum, "target"), (GLint, "level"), (GLint, "xoffset"), (GLint, "yoffset"), (GLint, "zoffset"), (GLsizei, "width"), (GLsizei, "height"), (GLsizei, "depth"), (GLenum, "format"), (GLenum, "type"), (Blob(Const(GLvoid), "__gl_image_size(format, type, width, height, depth, 0)"), "pixels")]), + GlFunction(Void, "glTexImage3D", [(GLenum, "target"), (GLint, "level"), (GLint, "internalformat"), (GLsizei, "width"), (GLsizei, "height"), (GLsizei, "depth"), (GLint, "border"), (GLenum, "format"), (GLenum, "type"), (Blob(Const(GLvoid), "__glTexImage3D_size(format, type, width, height, depth, border)"), "pixels")]), + GlFunction(Void, "glTexSubImage3D", [(GLenum, "target"), (GLint, "level"), (GLint, "xoffset"), (GLint, "yoffset"), (GLint, "zoffset"), (GLsizei, "width"), (GLsizei, "height"), (GLsizei, "depth"), (GLenum, "format"), (GLenum, "type"), (Blob(Const(GLvoid), "__glTexSubImage3D_size(format, type, width, height, depth)"), "pixels")]), GlFunction(Void, "glCopyTexSubImage3D", [(GLenum, "target"), (GLint, "level"), (GLint, "xoffset"), (GLint, "yoffset"), (GLint, "zoffset"), (GLint, "x"), (GLint, "y"), (GLsizei, "width"), (GLsizei, "height")]), # GL_VERSION_1_2_DEPRECATED GlFunction(Void, "glColorTable", [(GLenum, "target"), (GLenum, "internalformat"), (GLsizei, "width"), (GLenum, "format"), (GLenum, "type"), (Const(OpaquePointer(GLvoid)), "table")]), - GlFunction(Void, "glColorTableParameterfv", [(GLenum, "target"), (GLenum, "pname"), (Const(OpaquePointer(GLfloat)), "params")]), - GlFunction(Void, "glColorTableParameteriv", [(GLenum, "target"), (GLenum, "pname"), (Const(OpaquePointer(GLint)), "params")]), + GlFunction(Void, "glColorTableParameterfv", [(GLenum, "target"), (GLenum, "pname"), (Const(Array(GLfloat, "__glColorTableParameterfv_size(pname)")), "params")]), + GlFunction(Void, "glColorTableParameteriv", [(GLenum, "target"), (GLenum, "pname"), (Const(Array(GLint, "__glColorTableParameteriv_size(pname)")), "params")]), GlFunction(Void, "glCopyColorTable", [(GLenum, "target"), (GLenum, "internalformat"), (GLint, "x"), (GLint, "y"), (GLsizei, "width")]), GlFunction(Void, "glGetColorTable", [(GLenum, "target"), (GLenum, "format"), (GLenum, "type"), (OpaquePointer(GLvoid), "table")], sideeffects=False), - GlFunction(Void, "glGetColorTableParameterfv", [(GLenum, "target"), (GLenum, "pname"), Out(Pointer(GLfloat), "params")], sideeffects=False), - GlFunction(Void, "glGetColorTableParameteriv", [(GLenum, "target"), (GLenum, "pname"), Out(Pointer(GLint), "params")], sideeffects=False), + GlFunction(Void, "glGetColorTableParameterfv", [(GLenum, "target"), (GLenum, "pname"), Out(Array(GLfloat, "__glGetColorTableParameterfv_size(pname)"), "params")], sideeffects=False), + GlFunction(Void, "glGetColorTableParameteriv", [(GLenum, "target"), (GLenum, "pname"), Out(Array(GLint, "__glGetColorTableParameteriv_size(pname)"), "params")], sideeffects=False), GlFunction(Void, "glColorSubTable", [(GLenum, "target"), (GLsizei, "start"), (GLsizei, "count"), (GLenum, "format"), (GLenum, "type"), (Const(OpaquePointer(GLvoid)), "data")]), GlFunction(Void, "glCopyColorSubTable", [(GLenum, "target"), (GLsizei, "start"), (GLint, "x"), (GLint, "y"), (GLsizei, "width")]), GlFunction(Void, "glConvolutionFilter1D", [(GLenum, "target"), (GLenum, "internalformat"), (GLsizei, "width"), (GLenum, "format"), (GLenum, "type"), (Const(OpaquePointer(GLvoid)), "image")]), GlFunction(Void, "glConvolutionFilter2D", [(GLenum, "target"), (GLenum, "internalformat"), (GLsizei, "width"), (GLsizei, "height"), (GLenum, "format"), (GLenum, "type"), (Const(OpaquePointer(GLvoid)), "image")]), GlFunction(Void, "glConvolutionParameterf", [(GLenum, "target"), (GLenum, "pname"), (GLfloat, "params")]), - GlFunction(Void, "glConvolutionParameterfv", [(GLenum, "target"), (GLenum, "pname"), (Const(OpaquePointer(GLfloat)), "params")]), + GlFunction(Void, "glConvolutionParameterfv", [(GLenum, "target"), (GLenum, "pname"), (Const(Array(GLfloat, "__glConvolutionParameterfv_size(pname)")), "params")]), GlFunction(Void, "glConvolutionParameteri", [(GLenum, "target"), (GLenum, "pname"), (GLint, "params")]), - GlFunction(Void, "glConvolutionParameteriv", [(GLenum, "target"), (GLenum, "pname"), (Const(OpaquePointer(GLint)), "params")]), + GlFunction(Void, "glConvolutionParameteriv", [(GLenum, "target"), (GLenum, "pname"), (Const(Array(GLint, "__glConvolutionParameteriv_size(pname)")), "params")]), GlFunction(Void, "glCopyConvolutionFilter1D", [(GLenum, "target"), (GLenum, "internalformat"), (GLint, "x"), (GLint, "y"), (GLsizei, "width")]), GlFunction(Void, "glCopyConvolutionFilter2D", [(GLenum, "target"), (GLenum, "internalformat"), (GLint, "x"), (GLint, "y"), (GLsizei, "width"), (GLsizei, "height")]), GlFunction(Void, "glGetConvolutionFilter", [(GLenum, "target"), (GLenum, "format"), (GLenum, "type"), (OpaquePointer(GLvoid), "image")], sideeffects=False), - GlFunction(Void, "glGetConvolutionParameterfv", [(GLenum, "target"), (GLenum, "pname"), Out(Pointer(GLfloat), "params")], sideeffects=False), - GlFunction(Void, "glGetConvolutionParameteriv", [(GLenum, "target"), (GLenum, "pname"), Out(Pointer(GLint), "params")], sideeffects=False), + GlFunction(Void, "glGetConvolutionParameterfv", [(GLenum, "target"), (GLenum, "pname"), Out(Array(GLfloat, "__glGetConvolutionParameterfv_size(pname)"), "params")], sideeffects=False), + GlFunction(Void, "glGetConvolutionParameteriv", [(GLenum, "target"), (GLenum, "pname"), Out(Array(GLint, "__glGetConvolutionParameteriv_size(pname)"), "params")], sideeffects=False), GlFunction(Void, "glGetSeparableFilter", [(GLenum, "target"), (GLenum, "format"), (GLenum, "type"), (OpaquePointer(GLvoid), "row"), (OpaquePointer(GLvoid), "column"), (OpaquePointer(GLvoid), "span")], sideeffects=False), GlFunction(Void, "glSeparableFilter2D", [(GLenum, "target"), (GLenum, "internalformat"), (GLsizei, "width"), (GLsizei, "height"), (GLenum, "format"), (GLenum, "type"), (Const(OpaquePointer(GLvoid)), "row"), (Const(OpaquePointer(GLvoid)), "column")]), GlFunction(Void, "glGetHistogram", [(GLenum, "target"), (GLboolean, "reset"), (GLenum, "format"), (GLenum, "type"), (OpaquePointer(GLvoid), "values")], sideeffects=False), - GlFunction(Void, "glGetHistogramParameterfv", [(GLenum, "target"), (GLenum, "pname"), Out(Pointer(GLfloat), "params")], sideeffects=False), - GlFunction(Void, "glGetHistogramParameteriv", [(GLenum, "target"), (GLenum, "pname"), Out(Pointer(GLint), "params")], sideeffects=False), + GlFunction(Void, "glGetHistogramParameterfv", [(GLenum, "target"), (GLenum, "pname"), Out(Array(GLfloat, "__glGetHistogramParameterfv_size(pname)"), "params")], sideeffects=False), + GlFunction(Void, "glGetHistogramParameteriv", [(GLenum, "target"), (GLenum, "pname"), Out(Array(GLint, "__glGetHistogramParameteriv_size(pname)"), "params")], sideeffects=False), GlFunction(Void, "glGetMinmax", [(GLenum, "target"), (GLboolean, "reset"), (GLenum, "format"), (GLenum, "type"), (OpaquePointer(GLvoid), "values")], sideeffects=False), - GlFunction(Void, "glGetMinmaxParameterfv", [(GLenum, "target"), (GLenum, "pname"), Out(Pointer(GLfloat), "params")], sideeffects=False), - GlFunction(Void, "glGetMinmaxParameteriv", [(GLenum, "target"), (GLenum, "pname"), Out(Pointer(GLint), "params")], sideeffects=False), + GlFunction(Void, "glGetMinmaxParameterfv", [(GLenum, "target"), (GLenum, "pname"), Out(Array(GLfloat, "__glGetMinmaxParameterfv_size(pname)"), "params")], sideeffects=False), + GlFunction(Void, "glGetMinmaxParameteriv", [(GLenum, "target"), (GLenum, "pname"), Out(Array(GLint, "__glGetMinmaxParameteriv_size(pname)"), "params")], sideeffects=False), GlFunction(Void, "glHistogram", [(GLenum, "target"), (GLsizei, "width"), (GLenum, "internalformat"), (GLboolean, "sink")]), GlFunction(Void, "glMinmax", [(GLenum, "target"), (GLenum, "internalformat"), (GLboolean, "sink")]), GlFunction(Void, "glResetHistogram", [(GLenum, "target")]), @@ -517,9 +517,9 @@ glapi.add_functions([ GlFunction(Void, "glMultiDrawArrays", [(GLenum_mode, "mode"), (OpaquePointer(GLint), "first"), (OpaquePointer(GLsizei), "count"), (GLsizei, "primcount")]), GlFunction(Void, "glMultiDrawElements", [(GLenum_mode, "mode"), (Const(Array(GLsizei, "primcount")), "count"), (GLenum, "type"), (Array(Const(Const(OpaquePointer(GLvoid))), "primcount"), "indices"), (GLsizei, "primcount")]), GlFunction(Void, "glPointParameterf", [(GLenum, "pname"), (GLfloat, "param")]), - GlFunction(Void, "glPointParameterfv", [(GLenum, "pname"), (Const(OpaquePointer(GLfloat)), "params")]), + GlFunction(Void, "glPointParameterfv", [(GLenum, "pname"), (Const(Array(GLfloat, "__glPointParameterfv_size(pname)")), "params")]), GlFunction(Void, "glPointParameteri", [(GLenum, "pname"), (GLint, "param")]), - GlFunction(Void, "glPointParameteriv", [(GLenum, "pname"), (Const(OpaquePointer(GLint)), "params")]), + GlFunction(Void, "glPointParameteriv", [(GLenum, "pname"), (Const(Array(GLint, "__glPointParameteriv_size(pname)")), "params")]), # GL_VERSION_1_4_DEPRECATED GlFunction(Void, "glFogCoordf", [(GLfloat, "coord")]), @@ -923,7 +923,7 @@ glapi.add_functions([ GlFunction(Void, "glFramebufferTexture2D", [(GLenum, "target"), (GLenum, "attachment"), (GLenum, "textarget"), (GLtexture, "texture"), (GLint, "level")]), GlFunction(Void, "glFramebufferTexture3D", [(GLenum, "target"), (GLenum, "attachment"), (GLenum, "textarget"), (GLtexture, "texture"), (GLint, "level"), (GLint, "zoffset")]), GlFunction(Void, "glFramebufferRenderbuffer", [(GLenum, "target"), (GLenum, "attachment"), (GLenum, "renderbuffertarget"), (GLuint, "renderbuffer")]), - GlFunction(Void, "glGetFramebufferAttachmentParameteriv", [(GLenum, "target"), (GLenum, "attachment"), (GLenum, "pname"), (OpaquePointer(GLint), "params")], sideeffects=False), + GlFunction(Void, "glGetFramebufferAttachmentParameteriv", [(GLenum, "target"), (GLenum, "attachment"), (GLenum, "pname"), Out(Array(GLint, "__glGetFramebufferAttachmentParameteriv_size(pname)"), "params")], sideeffects=False), GlFunction(Void, "glGenerateMipmap", [(GLenum, "target")]), GlFunction(Void, "glBlitFramebuffer", [(GLint, "srcX0"), (GLint, "srcY0"), (GLint, "srcX1"), (GLint, "srcY1"), (GLint, "dstX0"), (GLint, "dstY0"), (GLint, "dstX1"), (GLint, "dstY1"), (GLbitfield_attrib, "mask"), (GLenum, "filter")]), GlFunction(Void, "glRenderbufferStorageMultisample", [(GLenum, "target"), (GLsizei, "samples"), (GLenum, "internalformat"), (GLsizei, "width"), (GLsizei, "height")]), @@ -937,11 +937,11 @@ glapi.add_functions([ # GL_SGIS_pixel_texture #GlFunction(Void, "glPixelTexGenParameteriSGIS", [(GLenum, "pname"), (GLint, "param")]), - #GlFunction(Void, "glPixelTexGenParameterivSGIS", [(GLenum, "pname"), (Const(OpaquePointer(GLint)), "params")]), + #GlFunction(Void, "glPixelTexGenParameterivSGIS", [(GLenum, "pname"), (Const(Array(GLint, "__glPixelTexGenParameterivSGIS_size(pname)")), "params")]), #GlFunction(Void, "glPixelTexGenParameterfSGIS", [(GLenum, "pname"), (GLfloat, "param")]), - #GlFunction(Void, "glPixelTexGenParameterfvSGIS", [(GLenum, "pname"), (Const(OpaquePointer(GLfloat)), "params")]), - #GlFunction(Void, "glGetPixelTexGenParameterivSGIS", [(GLenum, "pname"), Out(OpaquePointer(GLint), "params")], sideeffects=False), - #GlFunction(Void, "glGetPixelTexGenParameterfvSGIS", [(GLenum, "pname"), Out(OpaquePointer(GLfloat), "params")], sideeffects=False), + #GlFunction(Void, "glPixelTexGenParameterfvSGIS", [(GLenum, "pname"), (Const(Array(GLfloat, "__glPixelTexGenParameterfvSGIS_size(pname)")), "params")]), + #GlFunction(Void, "glGetPixelTexGenParameterivSGIS", [(GLenum, "pname"), Out(Array(GLint, "__glGetPixelTexGenParameterivSGIS_size(pname)"), "params")], sideeffects=False), + #GlFunction(Void, "glGetPixelTexGenParameterfvSGIS", [(GLenum, "pname"), Out(Array(GLfloat, "__glGetPixelTexGenParameterfvSGIS_size(pname)"), "params")], sideeffects=False), # GL_SGIS_multisample #GlFunction(Void, "glSampleMaskSGIS", [(GLclampf, "value"), (GLboolean, "invert")]), @@ -960,7 +960,7 @@ glapi.add_functions([ # GL_EXT_point_parameters GlFunction(Void, "glPointParameterfEXT", [(GLenum, "pname"), (GLfloat, "param")]), - GlFunction(Void, "glPointParameterfvEXT", [(GLenum, "pname"), (Const(OpaquePointer(GLfloat)), "params")]), + GlFunction(Void, "glPointParameterfvEXT", [(GLenum, "pname"), (Const(Array(GLfloat, "__glPointParameterfvEXT_size(pname)")), "params")]), # GL_EXT_compiled_vertex_array GlFunction(Void, "glLockArraysEXT", [(GLint, "first"), (GLsizei, "count")]), diff --git a/include/GL/glext.h b/glext.h index 9818cbc9..9818cbc9 100644 --- a/include/GL/glext.h +++ b/glext.h diff --git a/glimports.hpp b/glimports.hpp index f5397719..9c5492ae 100644 --- a/glimports.hpp +++ b/glimports.hpp @@ -35,10 +35,14 @@ #include <GL/gl.h> -#include <GL/glext.h> +#include "glext.h" + +#ifndef GL_TEXTURE_INDEX_SIZE_EXT +#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED +#endif #ifdef WIN32 -#include <GL/wglext.h> +#include "wglext.h" #endif /* WIN32 */ #endif /* _GLIMPORTS_HPP_ */ @@ -1230,6 +1230,10 @@ __glPointParameterfvEXT_size(GLenum pname) } } +#define __glPointParameterfv_size __glPointParameterfvEXT_size +#define __glPointParameteriv_size __glPointParameterfvEXT_size +#define __glPointParameterivNV_size __glPointParameterfvEXT_size + static inline size_t __glGetProgramivNV_size(GLenum pname) { @@ -1263,8 +1267,6 @@ __glGetVertexAttribdvNV_size(GLenum pname) #define __glGetVertexAttribivNV_size __glGetVertexAttribdvNV_size -#define __glPointParameterivNV_size __glPointParameterfvEXT_size - static inline size_t __glGetFramebufferAttachmentParameterivEXT_size(GLenum pname) { @@ -1281,8 +1283,10 @@ __glGetFramebufferAttachmentParameterivEXT_size(GLenum pname) } } +#define __glGetFramebufferAttachmentParameteriv_size __glGetFramebufferAttachmentParameterivEXT_size + static inline size_t -__gl_image_size(GLenum format, GLenum type, GLsizei width, GLsizei height, GLsizei depth, GLint border) { +__glTexImage3D_size(GLenum format, GLenum type, GLsizei width, GLsizei height, GLsizei depth, GLint border) { size_t num_channels; switch (format) { case GL_COLOR_INDEX: @@ -1363,9 +1367,16 @@ __gl_image_size(GLenum format, GLenum type, GLsizei width, GLsizei height, GLsiz return depth*slice_stride; } -static inline size_t -__gl_bitmap_size(GLsizei width, GLsizei height) { - return __gl_image_size(GL_COLOR_INDEX, GL_BITMAP, width, height, 1, 0); -} +#define __glTexImage2D_size(format, type, width, height, border) __glTexImage3D_size(format, type, width, height, 1, border) +#define __glTexImage1D_size(format, type, width, border) __glTexImage3D_size(format, type, width, 1, 1, border) + +#define __glTexSubImage3D_size(format, type, width, height, depth) __glTexImage3D_size(format, type, width, height, depth, 0) +#define __glTexSubImage2D_size(format, type, width, height) __glTexImage2D_size(format, type, width, height, 0) +#define __glTexSubImage1D_size(format, type, width) __glTexImage1D_size(format, type, width, 0) + +#define __glDrawPixels_size(format, type, width, height) __glTexImage2D_size(format, type, width, height, 0) + +#define __glBitmap_size(width, height) __glTexImage2D_size(GL_COLOR_INDEX, GL_BITMAP, width, height, 0) +#define __glPolygonStipple_size() __glBitmap_size(32, 32) #endif /* _GL_HELPERS_HPP_ */ diff --git a/include/GL/glxext.h b/glxext.h index 3c47dc36..3c47dc36 100644 --- a/include/GL/glxext.h +++ b/glxext.h diff --git a/glxtrace.py b/glxtrace.py index 39dd3379..27298447 100644 --- a/glxtrace.py +++ b/glxtrace.py @@ -73,9 +73,9 @@ if __name__ == '__main__': print '#include <dlfcn.h>' print '#include <X11/Xlib.h>' print '#include <GL/gl.h>' - print '#include <GL/glext.h>' + print '#include "glext.h"' print '#include <GL/glx.h>' - print '#include <GL/glxext.h>' + print '#include "glxext.h"' print print '#include "log.hpp"' print '#include "glsize.hpp"' diff --git a/trace_model.cpp b/trace_model.cpp index 74f9c9fb..760093c7 100644 --- a/trace_model.cpp +++ b/trace_model.cpp @@ -101,7 +101,7 @@ public: delete formatter; } - void visit(Null *node) { + void visit(Null *) { os << "NULL"; } @@ -236,7 +236,7 @@ void * Value::blob(void) const { if (blob) return blob->buf; const Null *null = dynamic_cast<const Null *>(unwrap(this)); - if (null); + if (null) return NULL; assert(0); return NULL; @@ -247,7 +247,7 @@ const char * Value::string(void) const { if (string) return string->value.c_str(); const Null *null = dynamic_cast<const Null *>(unwrap(this)); - if (null); + if (null) return NULL; assert(0); return NULL; diff --git a/trace_parser.hpp b/trace_parser.hpp index 39fcfda9..ed9fc7ec 100644 --- a/trace_parser.hpp +++ b/trace_parser.hpp @@ -158,7 +158,7 @@ public: } Value *parse_sint() { - return new SInt(-read_uint()); + return new SInt(-(signed long long)read_uint()); } Value *parse_uint() { @@ -194,7 +194,7 @@ public: c = read_byte(); switch(c) { case Trace::TYPE_SINT: - value |= -read_uint(); + value |= -(signed long long)read_uint(); break; case Trace::TYPE_UINT: value |= read_uint(); @@ -235,7 +235,7 @@ done: Value *parse_struct() { size_t length = read_uint(); /* XXX */ - for (size_t i; i < length; ++i) { + for (size_t i = 0; i < length; ++i) { std::string name = read_name(); Value *value = parse_value(); std::cout << " " << name << " = " << value << "\n"; diff --git a/include/GL/wglext.h b/wglext.h index e60c6527..e60c6527 100644 --- a/include/GL/wglext.h +++ b/wglext.h |