]> git.cworth.org Git - apitrace/commitdiff
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 d33f2755b5595e2d0962e9896676cecf1d0342cd..e1665fe167602c7a791920a7d698d0dad84ca350 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 872bc756138c2aee38cbf89e649b6da8dd2add1b..b6a4ab7b4c6dea1483a89b725756a6f10f013c9e 100644 (file)
--- a/bmp.hpp
+++ b/bmp.hpp
  *
  **************************************************************************/
 
+/*
+ * BMP image writing.
+ */
+
 #ifndef _BMP_HPP_
 #define _BMP_HPP_
 
index 2aff63539c7942236027a1b11ffb4178c5b70490..4a6405d4c403178e97877cb7496966a81f555a69 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 d49955bf4d5750a7c58f471b4708f481c15c868f..e98f746b30b65042a54c123bd38757627fd56196 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 5cd28a5f2426a9dfbfaa1718248e07bfa8066713..5e85195c570cdecb5247bf197d70068775455614 100644 (file)
--- a/dump.cpp
+++ b/dump.cpp
  **************************************************************************/
 
 
+/*
+ * Simple utility to dump a trace to standard output.
+ */
+
+
 #include "trace_parser.hpp"
 
 
index 3c9db3ca25a89e318424c438257e2c490d2bdf2c..9f17c006afc05b7ecd309c4adc17013070873c34 100644 (file)
  *
  **************************************************************************/
 
+/*
+ * Helpers for coloring output.
+ */
+
 #ifndef _FORMATTER_HPP_
 #define _FORMATTER_HPP_
 
index b1f35088b16a11e10d560a9ec379933c5572accf..8afb411f77e54b83f5c35ca819d9a9fad6684ac1 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 8844c8fc5b750feee189a012f4400747270a03bf..58d82b17ce5e1819ac2b7b976d39e3f70dd935de 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 46c80693f9a4c6e13719059adfca1db6cb10f232..e8d2c5c6036f86e06fe291090a8ac84f6e2e90c0 100644 (file)
  *
  **************************************************************************/
 
+/*
+ * Central place for all GL includes, and respective OS dependent headers.
+ */
+
 #ifndef _GLIMPORTS_HPP_
 #define _GLIMPORTS_HPP_
 
index c2e5ffcddbdf69e5d22db99229506262cf8f4b13..3945ab6fdd425614198356c15a2f70fc6bf74715 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 2b41f1d554a3962fccacf317c0d27c3f5a15a270..d397a90a7cfb51740d1476cdd43cf3e9912d21f3 100644 (file)
@@ -24,6 +24,9 @@
 ##########################################################################/
 
 
+"""GL retracer generator."""
+
+
 import stdapi
 import glapi
 from retrace import Retracer
index ce2048810d3885705ec96cc8ae93144c290830bf..ead293b5a1ad2ff1d94bbc8e940495939c8bd1c8 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 2c853df07c060e59e5ac740f6690d4b21a7e0640..a99fbd05b793f705ac21fd4425ab3fc680a0dcd2 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 67ce5524fbacdd3247e93bf6ccf0a7896b7efe05..27593199eee08300cc6e25444adccf7eb1b906c5 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 dbe8deb3ec4b3b45b51406880a0878fb37eb941a..eb5d842bc858b7ff40f773e7458f8dfb3e2ba714 100644 (file)
--- a/os.hpp
+++ b/os.hpp
  *
  **************************************************************************/
 
+/*
+ * Simple OS abstraction layer.
+ */
+
 #ifndef _OS_HPP_
 #define _OS_HPP_
 
index b1e72fd01a869b7cef73c9b6765bc7f205993e02..5326457e1963b0490260724081203547bdc5fda7 100644 (file)
@@ -24,6 +24,8 @@
 ##########################################################################/
 
 
+"""Generic retracing code generator."""
+
 import stdapi
 import glapi
 from codegen import *
index 688c65a6ac8f03bac1a222ea266dd5d5f8a03308..ba57a51055a2ae0cad959c5bb06bbf7220ce5d2e 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 e2c0519dda163f7db245d57d9049f480ff164524..f57dc91b31b0c548eaa4566c681a1ff443300929 100644 (file)
  *
  **************************************************************************/
 
+/*
+ * Object hierarchy for describing the traces in memory.
+ */
+
 #ifndef _TRACE_MODEL_HPP_
 #define _TRACE_MODEL_HPP_
 
index ca4addc5f89b567134691d2fb78bd9ae173e071e..1dfa46395aded5e258451251166b7814b4ed3bd9 100644 (file)
  *
  **************************************************************************/
 
+/*
+ * Trace writing functions.
+ */
+
 #ifndef _TRACE_WRITE_HPP_
 #define _TRACE_WRITE_HPP_
 
index 4df7b5180b75f78d3a0f1ea1de934a797d086aee..b8023625161ff48690b00d4321c9394983da963e 100644 (file)
--- a/wglapi.py
+++ b/wglapi.py
@@ -24,6 +24,9 @@
 ##########################################################################/
 
 
+"""WGL API description"""
+
+
 from glapi import *
 from winapi import *
 
index 6474755ea1898cc1a7a52402b5dffb59079e81e2..7dcb85055491c2d16d07f295490ffa86df809efd 100644 (file)
@@ -24,6 +24,9 @@
 ##########################################################################/
 
 
+"""WGL tracing code generator."""
+
+
 from wglapi import wglapi
 from trace import Tracer
 from codegen import *