Add brief comments.
authorJosé Fonseca <jfonseca@vmware.com>
Tue, 30 Nov 2010 16:58:22 +0000 (16:58 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Tue, 30 Nov 2010 16:58:22 +0000 (16:58 +0000)
21 files changed:
TODO
bmp.hpp
codegen.py
compat.h
dump.cpp
formatter.hpp
glapi.py
glenum.py
glimports.hpp
glproc.py
glretrace.py
glsize.hpp
glxapi.py
glxtrace.py
os.hpp
retrace.py
trace_format.hpp
trace_model.hpp
trace_write.hpp
wglapi.py
wgltrace.py

diff --git a/TODO b/TODO
index d33f275..e1665fe 100644 (file)
--- a/TODO
+++ b/TODO
@@ -33,3 +33,5 @@
 * Write snapshots as PNGs instead of BMPs
 
 * Add new mode to compare with previous snapshots instead of writing.
+
+* Plug memory leaks.
diff --git a/bmp.hpp b/bmp.hpp
index 872bc75..b6a4ab7 100644 (file)
--- a/bmp.hpp
+++ b/bmp.hpp
  *
  **************************************************************************/
 
+/*
+ * BMP image writing.
+ */
+
 #ifndef _BMP_HPP_
 #define _BMP_HPP_
 
index 2aff635..4a6405d 100644 (file)
@@ -24,6 +24,9 @@
 ##########################################################################/
 
 
+"""C code generation helpers."""
+
+
 def _string_switch(var, prefix, suffixes, case, default):
     index = len(prefix)
     indent = '    '*(index + 1)
@@ -72,6 +75,7 @@ def _noop(*args, **kwargs):
 
 
 def string_switch(var, values, case=_noop, default=None):
+    """Product a switch of strings, using a tree character switches."""
     values = list(values)
     values.sort()
     _string_switch(var, '', values, case, default)
index d49955b..e98f746 100644 (file)
--- a/compat.h
+++ b/compat.h
  *
  **************************************************************************/
 
+/*
+ * MinGW compatability macros to allow using recent's DXSDK headers.
+ */
+
 #ifdef __MINGW32__
 #define __in /**/
 #define __out /**/
index 5cd28a5..5e85195 100644 (file)
--- a/dump.cpp
+++ b/dump.cpp
  **************************************************************************/
 
 
+/*
+ * Simple utility to dump a trace to standard output.
+ */
+
+
 #include "trace_parser.hpp"
 
 
index 3c9db3c..9f17c00 100644 (file)
  *
  **************************************************************************/
 
+/*
+ * Helpers for coloring output.
+ */
+
 #ifndef _FORMATTER_HPP_
 #define _FORMATTER_HPP_
 
index b1f3508..8afb411 100644 (file)
--- a/glapi.py
+++ b/glapi.py
 ##########################################################################/
 
 
+"""GL API description.
+
+Most of these were automatically generated with the apigen/glspec.py script
+from Khronos OpenGL spec files, and then manually edited to cover the corner
+cases correctly.
+
+"""
+
+
 from stdapi import *
 from glenum import *
 
index 8844c8f..58d82b1 100644 (file)
--- a/glenum.py
+++ b/glenum.py
 ##########################################################################/
 
 
+"""GLenum description.
+
+This was semi-automatically generated from glext headers, with vim.  An
+automated procedure to generate it would be nice.
+
+"""
+
+
 from stdapi import *
 
 
index 46c8069..e8d2c5c 100644 (file)
  *
  **************************************************************************/
 
+/*
+ * Central place for all GL includes, and respective OS dependent headers.
+ */
+
 #ifndef _GLIMPORTS_HPP_
 #define _GLIMPORTS_HPP_
 
index c2e5ffc..3945ab6 100644 (file)
--- a/glproc.py
+++ b/glproc.py
 ##########################################################################/
 
 
+"""Generated an header, glproc.hpp, which does pretty much what GLEW does, but
+covers all the functions we support.
+""" 
+
+
 import stdapi
 from glapi import glapi
 from glxapi import glxapi
index 2b41f1d..d397a90 100644 (file)
@@ -24,6 +24,9 @@
 ##########################################################################/
 
 
+"""GL retracer generator."""
+
+
 import stdapi
 import glapi
 from retrace import Retracer
index ce20488..ead293b 100644 (file)
  *
  **************************************************************************/
 
+/*
+ * Auxiliary functions to compute the size of array/blob arguments, depending.
+ *
+ * Some of these functions were semi-automatically generated with
+ * apigen/glsize.py script from Mesa's XML description of the GL enums.
+ *
+ * Other functions were done by hand.
+ */
+
 #ifndef _GL_HELPERS_HPP_
 #define _GL_HELPERS_HPP_
 
index 2c853df..a99fbd0 100644 (file)
--- a/glxapi.py
+++ b/glxapi.py
@@ -23,6 +23,8 @@
 #
 ##########################################################################/
 
+"""GLX API description."""
+
 
 from stdapi import *
 from glapi import glapi
@@ -55,7 +57,9 @@ PROC = Opaque("__GLXextFuncPtr")
 glxapi.add_functions(glapi.functions)
 glxapi.add_functions([
     Function(GLXContext, "glXCreateContext", [(Display, "dpy"), (Pointer(XVisualInfo), "vis"), (GLXContext, "shareList"), (Bool_, "direct")]),
+    # TODO: the rest
 
+    # Must be last
     Function(PROC, "glXGetProcAddressARB", [(Alias("const GLubyte *", CString), "procName")]),
     Function(PROC, "glXGetProcAddress", [(Alias("const GLubyte *", CString), "procName")]),
 ])
index 67ce552..2759319 100644 (file)
@@ -24,6 +24,9 @@
 ##########################################################################/
 
 
+"""GLX tracing generator."""
+
+
 from glxapi import glxapi
 from trace import Tracer
 
diff --git a/os.hpp b/os.hpp
index dbe8deb..eb5d842 100644 (file)
--- a/os.hpp
+++ b/os.hpp
  *
  **************************************************************************/
 
+/*
+ * Simple OS abstraction layer.
+ */
+
 #ifndef _OS_HPP_
 #define _OS_HPP_
 
index b1e72fd..5326457 100644 (file)
@@ -24,6 +24,8 @@
 ##########################################################################/
 
 
+"""Generic retracing code generator."""
+
 import stdapi
 import glapi
 from codegen import *
index 688c65a..ba57a51 100644 (file)
  *
  **************************************************************************/
 
+/*
+ * Binary trace format decription.
+ */
+
 #ifndef _TRACE_FORMAT_HPP_
 #define _TRACE_FORMAT_HPP_
 
@@ -61,6 +65,8 @@ enum Type {
 };
 
 /*
+ * XXX: Update grammar.
+ *
  * trace = call* EOF
  *
  * call = name (detail)* END
index e2c0519..f57dc91 100644 (file)
  *
  **************************************************************************/
 
+/*
+ * Object hierarchy for describing the traces in memory.
+ */
+
 #ifndef _TRACE_MODEL_HPP_
 #define _TRACE_MODEL_HPP_
 
index ca4addc..1dfa463 100644 (file)
  *
  **************************************************************************/
 
+/*
+ * Trace writing functions.
+ */
+
 #ifndef _TRACE_WRITE_HPP_
 #define _TRACE_WRITE_HPP_
 
index 4df7b51..b802362 100644 (file)
--- a/wglapi.py
+++ b/wglapi.py
@@ -24,6 +24,9 @@
 ##########################################################################/
 
 
+"""WGL API description"""
+
+
 from glapi import *
 from winapi import *
 
index 6474755..7dcb850 100644 (file)
@@ -24,6 +24,9 @@
 ##########################################################################/
 
 
+"""WGL tracing code generator."""
+
+
 from wglapi import wglapi
 from trace import Tracer
 from codegen import *