[PATCH] Rename everything from "retrace" to "replay"

Carl Worth cworth at cworth.org
Sat Jan 26 16:22:32 PST 2013


The word "replay" more correctly captures what operation is being
performed, (the traced commands are played again—we are not performing
tracing again).

Note that the user documentation was already using "replay" in its
decription of this operation, ("Replay an OpenGL trace with..."). This
change makes all of the interfaces and internals consistent with that
natural usage in the documentation.
---
 .gitignore                                         |    4 +-
 BUGS.markdown                                      |    8 +-
 CMakeLists.txt                                     |    4 +-
 DEVELOPMENT.markdown                               |    2 +-
 NEWS.markdown                                      |    4 +-
 README.markdown                                    |   20 +-
 cli/CMakeLists.txt                                 |    2 +-
 cli/cli.hpp                                        |    2 +-
 cli/cli_diff_state.cpp                             |    2 +-
 cli/cli_dump_images.cpp                            |    4 +-
 cli/cli_main.cpp                                   |    2 +-
 cli/{cli_retrace.cpp => cli_replay.cpp}            |   34 +--
 cli/{cli_retrace.hpp => cli_replay.hpp}            |   10 +-
 common/trace_format.hpp                            |    4 +-
 common/trace_model.hpp                             |    4 +-
 common/trace_parser.cpp                            |    2 +-
 dispatch/dispatch.py                               |    4 +-
 gui/CMakeLists.txt                                 |    4 +-
 gui/mainwindow.cpp                                 |   54 ++--
 gui/mainwindow.h                                   |    6 +-
 gui/{retracer.cpp => replayer.cpp}                 |   54 ++--
 gui/{retracer.h => replayer.h}                     |   10 +-
 gui/ui/{retracerdialog.ui => replayerdialog.ui}    |   10 +-
 replay/.gitignore                                  |    4 +
 {retrace => replay}/CMakeLists.txt                 |  128 ++++----
 {retrace => replay}/d3d10state.cpp                 |    0
 {retrace => replay}/d3d10state.hpp                 |    0
 {retrace => replay}/d3d10state_images.cpp          |    0
 {retrace => replay}/d3d11state.cpp                 |    0
 {retrace => replay}/d3d11state_images.cpp          |    0
 {retrace => replay}/d3d8state.cpp                  |    0
 {retrace => replay}/d3d8state_images.cpp           |    0
 retrace/d3d9retrace.py => replay/d3d9replay.py     |   58 ++--
 {retrace => replay}/d3d9state.cpp                  |    0
 {retrace => replay}/d3d9state_images.cpp           |    0
 retrace/d3dretrace.hpp => replay/d3dreplay.hpp     |   22 +-
 .../d3dreplay_main.cpp                             |   20 +-
 .../d3dretrace_ws.cpp => replay/d3dreplay_ws.cpp   |   10 +-
 {retrace => replay}/d3dstate.hpp                   |    0
 retrace/dllretrace.py => replay/dllreplay.py       |    8 +-
 retrace/dxgiretrace.py => replay/dxgireplay.py     |   76 ++---
 retrace/glretrace.hpp => replay/glreplay.hpp       |   22 +-
 retrace/glretrace.py => replay/glreplay.py         |  106 +++----
 .../glretrace_cgl.cpp => replay/glreplay_cgl.cpp   |   88 +++---
 .../glretrace_egl.cpp => replay/glreplay_egl.cpp   |  114 +++----
 replay/glreplay_glx.cpp                            |  258 ++++++++++++++++
 .../glretrace_main.cpp => replay/glreplay_main.cpp |  100 +++----
 replay/glreplay_wgl.cpp                            |  311 ++++++++++++++++++++
 retrace/glretrace_ws.cpp => replay/glreplay_ws.cpp |   18 +-
 {retrace => replay}/glstate.cpp                    |    0
 {retrace => replay}/glstate.hpp                    |    0
 {retrace => replay}/glstate_images.cpp             |    0
 {retrace => replay}/glstate_internal.hpp           |    0
 {retrace => replay}/glstate_params.py              |    2 +-
 {retrace => replay}/glstate_shaders.cpp            |    0
 {retrace => replay}/glws.cpp                       |    0
 {retrace => replay}/glws.hpp                       |    0
 {retrace => replay}/glws_cocoa.mm                  |    4 +-
 {retrace => replay}/glws_egl_xlib.cpp              |    2 +-
 {retrace => replay}/glws_glx.cpp                   |    2 +-
 {retrace => replay}/glws_wgl.cpp                   |    4 +-
 {retrace => replay}/json.cpp                       |    0
 {retrace => replay}/json.hpp                       |    0
 retrace/retrace.cpp => replay/replay.cpp           |   12 +-
 retrace/retrace.hpp => replay/replay.hpp           |   20 +-
 retrace/retrace.py => replay/replay.py             |   76 ++---
 retrace/retrace_main.cpp => replay/replay_main.cpp |   82 +++---
 retrace/retrace_stdc.cpp => replay/replay_stdc.cpp |   20 +-
 .../replay_swizzle.cpp                             |   18 +-
 .../replay_swizzle.hpp                             |   10 +-
 {retrace => replay}/scoped_allocator.hpp           |    0
 retrace/.gitignore                                 |    4 -
 retrace/glretrace_glx.cpp                          |  258 ----------------
 retrace/glretrace_wgl.cpp                          |  311 --------------------
 scripts/convert.py                                 |    8 +-
 scripts/{retracediff.py => replaydiff.py}          |   28 +-
 scripts/tracecheck.py                              |   12 +-
 specs/gltypes.py                                   |    2 +-
 wrappers/gltrace.hpp                               |    2 +-
 79 files changed, 1235 insertions(+), 1235 deletions(-)
 rename cli/{cli_retrace.cpp => cli_replay.cpp} (83%)
 rename cli/{cli_retrace.hpp => cli_replay.hpp} (88%)
 rename gui/{retracer.cpp => replayer.cpp} (91%)
 rename gui/{retracer.h => replayer.h} (89%)
 rename gui/ui/{retracerdialog.ui => replayerdialog.ui} (94%)
 create mode 100644 replay/.gitignore
 rename {retrace => replay}/CMakeLists.txt (71%)
 rename {retrace => replay}/d3d10state.cpp (100%)
 rename {retrace => replay}/d3d10state.hpp (100%)
 rename {retrace => replay}/d3d10state_images.cpp (100%)
 rename {retrace => replay}/d3d11state.cpp (100%)
 rename {retrace => replay}/d3d11state_images.cpp (100%)
 rename {retrace => replay}/d3d8state.cpp (100%)
 rename {retrace => replay}/d3d8state_images.cpp (100%)
 rename retrace/d3d9retrace.py => replay/d3d9replay.py (75%)
 rename {retrace => replay}/d3d9state.cpp (100%)
 rename {retrace => replay}/d3d9state_images.cpp (100%)
 rename retrace/d3dretrace.hpp => replay/d3dreplay.hpp (85%)
 rename retrace/d3dretrace_main.cpp => replay/d3dreplay_main.cpp (79%)
 rename retrace/d3dretrace_ws.cpp => replay/d3dreplay_ws.cpp (95%)
 rename {retrace => replay}/d3dstate.hpp (100%)
 rename retrace/dllretrace.py => replay/dllreplay.py (95%)
 rename retrace/dxgiretrace.py => replay/dxgireplay.py (80%)
 rename retrace/glretrace.hpp => replay/glreplay.hpp (87%)
 rename retrace/glretrace.py => replay/glreplay.py (85%)
 rename retrace/glretrace_cgl.cpp => replay/glreplay_cgl.cpp (78%)
 rename retrace/glretrace_egl.cpp => replay/glreplay_egl.cpp (69%)
 create mode 100644 replay/glreplay_glx.cpp
 rename retrace/glretrace_main.cpp => replay/glreplay_main.cpp (79%)
 create mode 100644 replay/glreplay_wgl.cpp
 rename retrace/glretrace_ws.cpp => replay/glreplay_ws.cpp (95%)
 rename {retrace => replay}/glstate.cpp (100%)
 rename {retrace => replay}/glstate.hpp (100%)
 rename {retrace => replay}/glstate_images.cpp (100%)
 rename {retrace => replay}/glstate_internal.hpp (100%)
 rename {retrace => replay}/glstate_params.py (99%)
 rename {retrace => replay}/glstate_shaders.cpp (100%)
 rename {retrace => replay}/glws.cpp (100%)
 rename {retrace => replay}/glws.hpp (100%)
 rename {retrace => replay}/glws_cocoa.mm (99%)
 rename {retrace => replay}/glws_egl_xlib.cpp (99%)
 rename {retrace => replay}/glws_glx.cpp (99%)
 rename {retrace => replay}/glws_wgl.cpp (98%)
 rename {retrace => replay}/json.cpp (100%)
 rename {retrace => replay}/json.hpp (100%)
 rename retrace/retrace.cpp => replay/replay.cpp (92%)
 rename retrace/retrace.hpp => replay/replay.hpp (93%)
 rename retrace/retrace.py => replay/replay.py (86%)
 rename retrace/retrace_main.cpp => replay/replay_main.cpp (90%)
 rename retrace/retrace_stdc.cpp => replay/replay_stdc.cpp (81%)
 rename retrace/retrace_swizzle.cpp => replay/replay_swizzle.cpp (96%)
 rename retrace/retrace_swizzle.hpp => replay/replay_swizzle.hpp (95%)
 rename {retrace => replay}/scoped_allocator.hpp (100%)
 delete mode 100644 retrace/.gitignore
 delete mode 100644 retrace/glretrace_glx.cpp
 delete mode 100644 retrace/glretrace_wgl.cpp
 rename scripts/{retracediff.py => replaydiff.py} (93%)

diff --git a/.gitignore b/.gitignore
index 1e6d570..a98f55a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -31,8 +31,8 @@ Makefile
 apitrace
 build
 dxsdk
-eglretrace
-glretrace
+eglreplay
+glreplay
 install_manifest.txt
 qapitrace
 traces
diff --git a/BUGS.markdown b/BUGS.markdown
index 0981133..b0f1ca6 100644
--- a/BUGS.markdown
+++ b/BUGS.markdown
@@ -56,18 +56,18 @@ Tracing
 Retracing
 ---------
 
-* glretrace needs to infer window sizes from glViewport calls, because calls
+* glreplay needs to infer window sizes from glViewport calls, because calls
   that create/resize windows happen outside of OpenGL and are not traced.
   Therefore window will be missing if the application relies on the default
   viewport instead of explicitly invoking glViewport; or it will to too big if
   the window is shrunk.  Most apps call glViewport before rendering.
 
-* OS specific OpenGL APIs (WGL, GLX, CGL, etc), are not retraced literally, but
+* OS specific OpenGL APIs (WGL, GLX, CGL, etc), are not replayed literally, but
   instead partially emulated.  This is by design, to allow traces to be
-  retraced on any OS, as the focus is on the OS-independent parts of OpenGL API.
+  replayed on any OS, as the focus is on the OS-independent parts of OpenGL API.
 
 * There is no guarantee that the same visual that was used on tracing will be
-  used for retracing OpenGL.  Actually currently, glretrace will always choose
+  used for retracing OpenGL.  Actually currently, glreplay will always choose
   a standard 32bit RGBA, 24bit depth, 8bit alpha, double buffer visual.  Unless
   overridden on command line.
 
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 91f1b87..c6f6d68 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -330,7 +330,7 @@ add_subdirectory (dispatch)
 add_subdirectory (helpers)
 add_subdirectory (wrappers)
 add_subdirectory (image)
-add_subdirectory (retrace)
+add_subdirectory (replay)
 
 
 ##############################################################################
@@ -351,7 +351,7 @@ install (
         scripts/highlight.py
         scripts/jsondiff.py
         scripts/profileshader.py
-        scripts/retracediff.py
+        scripts/replaydiff.py
         scripts/snapdiff.py
         scripts/tracecheck.py
         scripts/tracediff.py
diff --git a/DEVELOPMENT.markdown b/DEVELOPMENT.markdown
index 5af6ed6..a7d9408 100644
--- a/DEVELOPMENT.markdown
+++ b/DEVELOPMENT.markdown
@@ -65,7 +65,7 @@ Feature development:
 Backwards compatibility:
 
 * Backwards binary compatibility with old traces must be always maintained: all
-  tools, including glretrace, must handle old traces without regressions.
+  tools, including glreplay, must handle old traces without regressions.
 
 * No backwards compatibility guarantees for derived data (ASCII dumps, state,
   images, etc).
diff --git a/NEWS.markdown b/NEWS.markdown
index 53a3f0f..736ec34 100644
--- a/NEWS.markdown
+++ b/NEWS.markdown
@@ -17,7 +17,7 @@ Version 3.0
 
 * Top-level `apitrace` command.
 
-* Trace and retrace support for EGL, GLES1, and GLES2 APIs on Linux.
+* Trace and replay support for EGL, GLES1, and GLES2 APIs on Linux.
 
 * Ability to trim traces.
 
@@ -57,4 +57,4 @@ Version 1.0
 Pre-history
 ===========
 
-* OpenGL retrace support.
+* OpenGL replay support.
diff --git a/README.markdown b/README.markdown
index 685f221..00b4298 100644
--- a/README.markdown
+++ b/README.markdown
@@ -5,7 +5,7 @@ About **apitrace**
 
 * trace OpenGL, OpenGL ES, Direct3D, and DirectDraw APIs calls to a file;
 
-* retrace OpenGL and OpenGL ES calls from a file;
+* replay OpenGL and OpenGL ES calls from a file;
 
 * inspect OpenGL state at any call while retracing;
 
@@ -49,10 +49,10 @@ View the trace with
 
 Replay an OpenGL trace with
 
-    apitrace retrace application.trace
+    apitrace replay application.trace
 
 Pass the `--sb` option to use a single buffered visual.  Pass `--help` to
-`apitrace retrace` for more options.
+`apitrace replay` for more options.
 
 
 Basic GUI usage
@@ -302,7 +302,7 @@ Dump GL state at a particular call
 
 You can get a dump of the bound GL state at call 12345 by doing:
 
-    apitrace retrace -D 12345 application.trace > 12345.json
+    apitrace replay -D 12345 application.trace > 12345.json
 
 This is precisely the mechanism the GUI obtains its own state.
 
@@ -359,7 +359,7 @@ table which displays profiling results per shader.
 
 For example, to record all profiling data and utilise the per shader script:
 
-    apitrace retrace --pgpu --pcpu --ppd foo.trace | ./scripts/profileshader.py
+    apitrace replay --pgpu --pcpu --ppd foo.trace | ./scripts/profileshader.py
 
 
 Advanced usage for OpenGL implementors
@@ -427,7 +427,7 @@ Then do:
         --precision-threshold 8.0 \
         --build /path/to/build-script.sh \
         --gl-renderer '.*Mesa.*Intel.*' \
-        --retrace=/path/to/glretrace \
+        --replay=/path/to/glreplay \
         -c /path/to/reference/snapshots/ \
         topogun-1.06-orc-84k.trace
 
@@ -451,22 +451,22 @@ A faster approach is to run both the bad and a good GL driver side-by-side.
 The latter can be either a previously known good build of the GL driver, or a
 reference software renderer.
 
-This can be achieved with retracediff.py script, which invokes glretrace with
+This can be achieved with replayediff.py script, which invokes glreplay with
 different environments, allowing to choose the desired GL driver by
 manipulating variables such as `LD_LIBRARY_PATH`, `LIBGL_DRIVERS_DIR`, or
 `TRACE_LIBGL`.
 
 For example, on Linux:
 
-    ./scripts/retracediff.py \
+    ./scripts/replayediff.py \
         --ref-env LD_LIBRARY_PATH=/path/to/reference/GL/implementation \
-        --retrace /path/to/glretrace \
+        --replay /path/to/glreplay \
         --diff-prefix=/path/to/output/diffs \
         application.trace
 
 Or on Windows:
 
-    python scripts\retracediff.py --retrace \path\to\glretrace.exe --ref-env TRACE_LIBGL=\path\to\reference\opengl32.dll application.trace
+    python scripts\replayediff.py --replay \path\to\glreplay.exe --ref-env TRACE_LIBGL=\path\to\reference\opengl32.dll application.trace
 
 
 [![githalytics.com alpha](https://cruel-carlota.pagodabox.com/c1062ad633aa7a458e9d7520021307e4 "githalytics.com")](http://githalytics.com/apitrace/apitrace)
diff --git a/cli/CMakeLists.txt b/cli/CMakeLists.txt
index 5f8e116..b4f92b8 100644
--- a/cli/CMakeLists.txt
+++ b/cli/CMakeLists.txt
@@ -19,7 +19,7 @@ add_executable (apitrace
     cli_pager.cpp
     cli_pickle.cpp
     cli_repack.cpp
-    cli_retrace.cpp
+    cli_replay.cpp
     cli_trace.cpp
     cli_trim.cpp
     cli_resources.cpp
diff --git a/cli/cli.hpp b/cli/cli.hpp
index c35cb3a..c701f52 100644
--- a/cli/cli.hpp
+++ b/cli/cli.hpp
@@ -47,7 +47,7 @@ extern const Command dump_command;
 extern const Command dump_images_command;
 extern const Command pickle_command;
 extern const Command repack_command;
-extern const Command retrace_command;
+extern const Command replay_command;
 extern const Command trace_command;
 extern const Command trim_command;
 
diff --git a/cli/cli_diff_state.cpp b/cli/cli_diff_state.cpp
index 341d244..c1d7d63 100644
--- a/cli/cli_diff_state.cpp
+++ b/cli/cli_diff_state.cpp
@@ -44,7 +44,7 @@ usage(void)
         << "usage: apitrace diff-state <state-1> <state-2>\n"
         << synopsis << "\n"
         "\n"
-        "    Both input files should be the result of running 'glretrace -D XYZ <trace>'.\n";
+        "    Both input files should be the result of running 'glreplay -D XYZ <trace>'.\n";
 }
 
 const static char *
diff --git a/cli/cli_dump_images.cpp b/cli/cli_dump_images.cpp
index 86cf75c..1e52bb7 100644
--- a/cli/cli_dump_images.cpp
+++ b/cli/cli_dump_images.cpp
@@ -36,7 +36,7 @@
 #include "os_string.hpp"
 
 #include "cli.hpp"
-#include "cli_retrace.hpp"
+#include "cli_replay.hpp"
 
 static const char *synopsis = "Dump frame images obtained from a trace.";
 
@@ -141,7 +141,7 @@ command(int argc, char *argv[])
         opts.push_back(call_nos.c_str());
     }
 
-    return executeRetrace(opts, traceName);
+    return executeReplay(opts, traceName);
 }
 
 const Command dump_images_command = {
diff --git a/cli/cli_main.cpp b/cli/cli_main.cpp
index 040adcf..6682717 100644
--- a/cli/cli_main.cpp
+++ b/cli/cli_main.cpp
@@ -73,7 +73,7 @@ static const Command * commands[] = {
     &dump_images_command,
     &pickle_command,
     &repack_command,
-    &retrace_command,
+    &replay_command,
     &trace_command,
     &trim_command,
     &help_command
diff --git a/cli/cli_retrace.cpp b/cli/cli_replay.cpp
similarity index 83%
rename from cli/cli_retrace.cpp
rename to cli/cli_replay.cpp
index d22f719..10c5c00 100644
--- a/cli/cli_retrace.cpp
+++ b/cli/cli_replay.cpp
@@ -38,7 +38,7 @@
 #include "cli_resources.hpp"
 
 #include "cli.hpp"
-#include "cli_retrace.hpp"
+#include "cli_replay.hpp"
 
 
 static trace::API
@@ -62,16 +62,16 @@ guessApi(const char *filename)
 }
 
 int
-executeRetrace(const std::vector<const char *> & opts,
+executeReplay(const std::vector<const char *> & opts,
                const char *traceName,
                trace::API api) {
-    const char *retraceName;
+    const char *replayName;
     switch (api) {
     case trace::API_GL:
-        retraceName = "glretrace";
+        replayName = "glreplay";
         break;
     case trace::API_EGL:
-        retraceName = "eglretrace";
+        replayName = "eglreplay";
         break;
     case trace::API_DX:
     case trace::API_D3D7:
@@ -79,20 +79,20 @@ executeRetrace(const std::vector<const char *> & opts,
     case trace::API_D3D9:
     case trace::API_DXGI:
         // Use prefix so that it can be used with WINE
-        retraceName = "d3dretrace.exe";
+        replayName = "d3dreplay.exe";
         break;
     default:
         std::cerr << "warning: could not guess trace's API\n";
-        retraceName = "glretrace";
+        replayName = "glreplay";
         break;
     }
 
     std::vector<const char *> command;
-    os::String retracePath = findProgram(retraceName);
-    if (retracePath.length()) {
-        command.push_back(retracePath);
+    os::String replayPath = findProgram(replayName);
+    if (replayPath.length()) {
+        command.push_back(replayPath);
     } else {
-        command.push_back(retraceName);
+        command.push_back(replayName);
     }
 
     command.insert(command.end(), opts.begin(), opts.end());
@@ -106,10 +106,10 @@ executeRetrace(const std::vector<const char *> & opts,
 }
 
 int
-executeRetrace(const std::vector<const char *> & opts,
+executeReplay(const std::vector<const char *> & opts,
                const char *traceName) {
     trace::API api = guessApi(traceName);
-    return executeRetrace(opts, traceName, api);
+    return executeReplay(opts, traceName, api);
 }
 
 
@@ -121,7 +121,7 @@ usage(void)
     std::vector<const char *>opts;
     opts.push_back("--help");
     trace::API api = trace::API_GL;
-    executeRetrace(opts, NULL, api);
+    executeReplay(opts, NULL, api);
 }
 
 static int
@@ -140,11 +140,11 @@ command(int argc, char *argv[])
         }
     }
 
-    return executeRetrace(opts, NULL, api);
+    return executeReplay(opts, NULL, api);
 }
 
-const Command retrace_command = {
-    "retrace",
+const Command replay_command = {
+    "replay",
     synopsis,
     usage,
     command
diff --git a/cli/cli_retrace.hpp b/cli/cli_replay.hpp
similarity index 88%
rename from cli/cli_retrace.hpp
rename to cli/cli_replay.hpp
index 0dfa823..301156d 100644
--- a/cli/cli_retrace.hpp
+++ b/cli/cli_replay.hpp
@@ -25,8 +25,8 @@
  *
  *********************************************************************/
 
-#ifndef _CLI_RETRACE_HPP_
-#define _CLI_RETRACE_HPP_
+#ifndef _CLI_REPLAY_HPP_
+#define _CLI_REPLAY_HPP_
 
 
 #include <vector>
@@ -34,13 +34,13 @@
 
 
 int
-executeRetrace(const std::vector<const char *> & opts,
+executeReplay(const std::vector<const char *> & opts,
                const char *traceName,
                trace::API api);
 
 int
-executeRetrace(const std::vector<const char *> & opts,
+executeReplay(const std::vector<const char *> & opts,
                const char *traceName);
 
 
-#endif /* _CLI_RETRACE_HPP_ */
+#endif /* _CLI_REPLAY_HPP_ */
diff --git a/common/trace_format.hpp b/common/trace_format.hpp
index d5fd81b..3400445 100644
--- a/common/trace_format.hpp
+++ b/common/trace_format.hpp
@@ -39,11 +39,11 @@ namespace trace {
  * Trace file version number.
  *
  * We keep backwards compatability reading old traces, i.e., it should always be
- * possible to parse and retrace old trace files.
+ * possible to parse and replay old trace files.
  *
  * So the trace version number refers not only to changes in the binary format
  * representation, but also semantic changes in the way certain functions
- * should be retraced.
+ * should be replayed.
  *
  * Writing/editing old traces will not be supported however.  An older version
  * of apitrace should be used in such circunstances.
diff --git a/common/trace_model.hpp b/common/trace_model.hpp
index bb8936e..917ba19 100644
--- a/common/trace_model.hpp
+++ b/common/trace_model.hpp
@@ -398,7 +398,7 @@ enum {
     CALL_FLAG_FAKE                      = (1 << 0),
 
     /**
-     * Whether this call should be retraced or ignored.
+     * Whether this call should be replayed or ignored.
      *
      * This flag is set for calls which can't be safely replayed (due to incomplete
      * information) or that have no sideffects.
@@ -409,7 +409,7 @@ enum {
     
     /**
      * Whether this call has no side-effects, therefore don't need to be
-     * retraced.
+     * replayed.
      *
      * This flag is set for calls that merely query information which is not
      * needed for posterior calls.
diff --git a/common/trace_parser.cpp b/common/trace_parser.cpp
index f3aea7e..c53eb2f 100644
--- a/common/trace_parser.cpp
+++ b/common/trace_parser.cpp
@@ -238,7 +238,7 @@ Parser::parse_function_sig(void) {
          * Try to autodetect the API.
          *
          * XXX: Ideally we would allow to mix multiple APIs in a single trace,
-         * but as it stands today, retrace is done separately for each API.
+         * but as it stands today, replay is done separately for each API.
          */
         if (api == API_UNKNOWN) {
             const char *n = sig->name;
diff --git a/dispatch/dispatch.py b/dispatch/dispatch.py
index 60f9507..32b2933 100644
--- a/dispatch/dispatch.py
+++ b/dispatch/dispatch.py
@@ -65,10 +65,10 @@ class Dispatcher:
         # define standard name aliases for convenience, but only when not
         # tracing, as that would cause symbol clashing with the tracing
         # functions
-        print '#ifdef RETRACE'
+        print '#ifdef REPLAY'
         for function in module.functions:
             print '#define %s _%s' % (function.name, function.name)
-        print '#endif /* RETRACE */'
+        print '#endif /* REPLAY */'
         print
 
     def dispatchFunction(self, module, function):
diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt
index 773d344..f82142f 100644
--- a/gui/CMakeLists.txt
+++ b/gui/CMakeLists.txt
@@ -16,7 +16,7 @@ set(qapitrace_SRCS
    main.cpp
    profiledialog.cpp
    profiletablemodel.cpp
-   retracer.cpp
+   replayer.cpp
    saverthread.cpp
    searchwidget.cpp
    settingsdialog.cpp
@@ -47,7 +47,7 @@ set(qapitrace_UIS
    ui/mainwindow.ui
    ui/profiledialog.ui
    ui/profilereplaydialog.ui
-   ui/retracerdialog.ui
+   ui/replayerdialog.ui
    ui/settings.ui
    ui/tracedialog.ui
    ui/searchwidget.ui
diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp
index d6ebd2f..48fef01 100644
--- a/gui/mainwindow.cpp
+++ b/gui/mainwindow.cpp
@@ -9,7 +9,7 @@
 #include "imageviewer.h"
 #include "jumpwidget.h"
 #include "profiledialog.h"
-#include "retracer.h"
+#include "replayer.h"
 #include "searchwidget.h"
 #include "settingsdialog.h"
 #include "shaderssourcewidget.h"
@@ -17,7 +17,7 @@
 #include "traceprocess.h"
 #include "trimprocess.h"
 #include "thumbnail.h"
-#include "ui_retracerdialog.h"
+#include "ui_replayerdialog.h"
 #include "ui_profilereplaydialog.h"
 #include "vertexdatainterpreter.h"
 #include "trace_profiler.hpp"
@@ -179,23 +179,23 @@ void MainWindow::replayStart()
     }
 
     QDialog dlg;
-    Ui_RetracerDialog dlgUi;
+    Ui_ReplayerDialog dlgUi;
     dlgUi.setupUi(&dlg);
 
     dlgUi.doubleBufferingCB->setChecked(
-        m_retracer->isDoubleBuffered());
+        m_replayer->isDoubleBuffered());
 
     dlgUi.errorCheckCB->setChecked(
-        !m_retracer->isBenchmarking());
+        !m_replayer->isBenchmarking());
 
     if (dlg.exec() == QDialog::Accepted) {
-        m_retracer->setDoubleBuffered(
+        m_replayer->setDoubleBuffered(
             dlgUi.doubleBufferingCB->isChecked());
 
-        m_retracer->setBenchmarking(
+        m_replayer->setBenchmarking(
             !dlgUi.errorCheckCB->isChecked());
 
-        m_retracer->setProfiling(false, false, false);
+        m_replayer->setProfiling(false, false, false);
 
         replayTrace(false, false);
     }
@@ -217,7 +217,7 @@ void MainWindow::replayProfile()
     dlgUi.setupUi(&dlg);
 
     if (dlg.exec() == QDialog::Accepted) {
-        m_retracer->setProfiling(
+        m_replayer->setProfiling(
             dlgUi.gpuTimesCB->isChecked(),
             dlgUi.cpuTimesCB->isChecked(),
             dlgUi.pixelsDrawnCB->isChecked());
@@ -228,7 +228,7 @@ void MainWindow::replayProfile()
 
 void MainWindow::replayStop()
 {
-    m_retracer->quit();
+    m_replayer->quit();
     updateActionsState(true, true);
 }
 
@@ -307,11 +307,11 @@ void MainWindow::replayTrace(bool dumpState, bool dumpThumbnails)
         return;
     }
 
-    m_retracer->setFileName(m_trace->fileName());
-    m_retracer->setAPI(m_api);
-    m_retracer->setCaptureState(dumpState);
-    m_retracer->setCaptureThumbnails(dumpThumbnails);
-    if (m_retracer->captureState() && m_selectedEvent) {
+    m_replayer->setFileName(m_trace->fileName());
+    m_replayer->setAPI(m_api);
+    m_replayer->setCaptureState(dumpState);
+    m_replayer->setCaptureThumbnails(dumpThumbnails);
+    if (m_replayer->captureState() && m_selectedEvent) {
         int index = 0;
         if (m_selectedEvent->type() == ApiTraceEvent::Call) {
             index = static_cast<ApiTraceCall*>(m_selectedEvent)->index();
@@ -328,9 +328,9 @@ void MainWindow::replayTrace(bool dumpState, bool dumpThumbnails)
             qDebug()<<"Unknown event type";
             return;
         }
-        m_retracer->setCaptureAtCallNumber(index);
+        m_replayer->setCaptureAtCallNumber(index);
     }
-    m_retracer->start();
+    m_replayer->start();
 
     m_ui.actionStop->setEnabled(true);
     m_progressBar->show();
@@ -345,7 +345,7 @@ void MainWindow::replayTrace(bool dumpState, bool dumpThumbnails)
             statusBar()->showMessage(
                 tr("Capturing thumbnails..."));
         }
-    } else if (m_retracer->isProfiling()) {
+    } else if (m_replayer->isProfiling()) {
         statusBar()->showMessage(
                     tr("Profiling draw calls in trace file..."));
     } else {
@@ -724,7 +724,7 @@ void MainWindow::initObjects()
     m_ui.shadersTab->setLayout(layout);
 
     m_trace = new ApiTrace();
-    m_retracer = new Retracer(this);
+    m_replayer = new Replayer(this);
 
     m_vdataInterpreter = new VertexDataInterpreter(this);
     m_vdataInterpreter->setListWidget(m_ui.vertexDataListWidget);
@@ -807,18 +807,18 @@ void MainWindow::initConnections()
     connect(m_trace, SIGNAL(foundCallIndex(ApiTraceCall*)),
             this, SLOT(slotJumpToResult(ApiTraceCall*)));
 
-    connect(m_retracer, SIGNAL(finished(const QString&)),
+    connect(m_replayer, SIGNAL(finished(const QString&)),
             this, SLOT(replayFinished(const QString&)));
-    connect(m_retracer, SIGNAL(error(const QString&)),
+    connect(m_replayer, SIGNAL(error(const QString&)),
             this, SLOT(replayError(const QString&)));
-    connect(m_retracer, SIGNAL(foundState(ApiTraceState*)),
+    connect(m_replayer, SIGNAL(foundState(ApiTraceState*)),
             this, SLOT(replayStateFound(ApiTraceState*)));
-    connect(m_retracer, SIGNAL(foundProfile(trace::Profile*)),
+    connect(m_replayer, SIGNAL(foundProfile(trace::Profile*)),
             this, SLOT(replayProfileFound(trace::Profile*)));
-    connect(m_retracer, SIGNAL(foundThumbnails(const QList<QImage>&)),
+    connect(m_replayer, SIGNAL(foundThumbnails(const QList<QImage>&)),
             this, SLOT(replayThumbnailsFound(const QList<QImage>&)));
-    connect(m_retracer, SIGNAL(retraceErrors(const QList<ApiTraceError>&)),
-            this, SLOT(slotRetraceErrors(const QList<ApiTraceError>&)));
+    connect(m_replayer, SIGNAL(replayErrors(const QList<ApiTraceError>&)),
+            this, SLOT(slotReplayErrors(const QList<ApiTraceError>&)));
 
     connect(m_ui.vertexInterpretButton, SIGNAL(clicked()),
             m_vdataInterpreter, SLOT(interpretData()));
@@ -1193,7 +1193,7 @@ void MainWindow::slotTraceChanged(ApiTraceEvent *event)
     }
 }
 
-void MainWindow::slotRetraceErrors(const QList<ApiTraceError> &errors)
+void MainWindow::slotReplayErrors(const QList<ApiTraceError> &errors)
 {
     m_ui.errorsTreeWidget->clear();
 
diff --git a/gui/mainwindow.h b/gui/mainwindow.h
index 78267ef..2a87a6f 100644
--- a/gui/mainwindow.h
+++ b/gui/mainwindow.h
@@ -25,7 +25,7 @@ class QProgressBar;
 class QTreeWidgetItem;
 class QUrl;
 struct ApiTraceError;
-class Retracer;
+class Replayer;
 class SearchWidget;
 class ShadersSourceWidget;
 class TraceProcess;
@@ -86,7 +86,7 @@ private slots:
     void slotGoFrameStart();
     void slotGoFrameEnd();
     void slotTraceChanged(ApiTraceEvent *event);
-    void slotRetraceErrors(const QList<ApiTraceError> &errors);
+    void slotReplayErrors(const QList<ApiTraceError> &errors);
     void slotErrorSelected(QTreeWidgetItem *current);
     void slotSearchResult(const ApiTrace::SearchRequest &request,
                           ApiTrace::SearchResult result,
@@ -135,7 +135,7 @@ private:
 
     ApiTraceEvent *m_trimEvent;
 
-    Retracer *m_retracer;
+    Replayer *m_replayer;
 
     VertexDataInterpreter *m_vdataInterpreter;
 
diff --git a/gui/retracer.cpp b/gui/replayer.cpp
similarity index 91%
rename from gui/retracer.cpp
rename to gui/replayer.cpp
index 2928ed6..653cfc5 100644
--- a/gui/retracer.cpp
+++ b/gui/replayer.cpp
@@ -1,4 +1,4 @@
-#include "retracer.h"
+#include "replayer.h"
 
 #include "apitracecall.h"
 #include "thumbnail.h"
@@ -126,7 +126,7 @@ qint64 BlockingIODevice::writeData(const char * data, qint64 maxSize)
 
 Q_DECLARE_METATYPE(QList<ApiTraceError>);
 
-Retracer::Retracer(QObject *parent)
+Replayer::Replayer(QObject *parent)
     : QThread(parent),
       m_benchmarking(false),
       m_doubleBuffered(true),
@@ -139,94 +139,94 @@ Retracer::Retracer(QObject *parent)
     qRegisterMetaType<QList<ApiTraceError> >();
 }
 
-QString Retracer::fileName() const
+QString Replayer::fileName() const
 {
     return m_fileName;
 }
 
-void Retracer::setFileName(const QString &name)
+void Replayer::setFileName(const QString &name)
 {
     m_fileName = name;
 }
 
-void Retracer::setAPI(trace::API api)
+void Replayer::setAPI(trace::API api)
 {
     m_api = api;
 }
 
-bool Retracer::isBenchmarking() const
+bool Replayer::isBenchmarking() const
 {
     return m_benchmarking;
 }
 
-void Retracer::setBenchmarking(bool bench)
+void Replayer::setBenchmarking(bool bench)
 {
     m_benchmarking = bench;
 }
 
-bool Retracer::isDoubleBuffered() const
+bool Replayer::isDoubleBuffered() const
 {
     return m_doubleBuffered;
 }
 
-void Retracer::setDoubleBuffered(bool db)
+void Replayer::setDoubleBuffered(bool db)
 {
     m_doubleBuffered = db;
 }
 
-bool Retracer::isProfilingGpu() const
+bool Replayer::isProfilingGpu() const
 {
     return m_profileGpu;
 }
 
-bool Retracer::isProfilingCpu() const
+bool Replayer::isProfilingCpu() const
 {
     return m_profileCpu;
 }
 
-bool Retracer::isProfilingPixels() const
+bool Replayer::isProfilingPixels() const
 {
     return m_profilePixels;
 }
 
-bool Retracer::isProfiling() const
+bool Replayer::isProfiling() const
 {
     return m_profileGpu || m_profileCpu || m_profilePixels;
 }
 
-void Retracer::setProfiling(bool gpu, bool cpu, bool pixels)
+void Replayer::setProfiling(bool gpu, bool cpu, bool pixels)
 {
     m_profileGpu = gpu;
     m_profileCpu = cpu;
     m_profilePixels = pixels;
 }
 
-void Retracer::setCaptureAtCallNumber(qlonglong num)
+void Replayer::setCaptureAtCallNumber(qlonglong num)
 {
     m_captureCall = num;
 }
 
-qlonglong Retracer::captureAtCallNumber() const
+qlonglong Replayer::captureAtCallNumber() const
 {
     return m_captureCall;
 }
 
-bool Retracer::captureState() const
+bool Replayer::captureState() const
 {
     return m_captureState;
 }
 
-void Retracer::setCaptureState(bool enable)
+void Replayer::setCaptureState(bool enable)
 {
     m_captureState = enable;
 }
 
-bool Retracer::captureThumbnails() const
+bool Replayer::captureThumbnails() const
 {
     return m_captureThumbnails;
 }
 
-void Retracer::setCaptureThumbnails(bool enable)
+void Replayer::setCaptureThumbnails(bool enable)
 {
     m_captureThumbnails = enable;
 }
@@ -236,7 +236,7 @@ void Retracer::setCaptureThumbnails(bool enable)
  *
  * Overrides QThread::run().
  */
-void Retracer::run()
+void Replayer::run()
 {
     QString msg = QLatin1String("Replay finished!");
 
@@ -249,10 +249,10 @@ void Retracer::run()
 
     switch (m_api) {
     case trace::API_GL:
-        prog = QLatin1String("glretrace");
+        prog = QLatin1String("glreplay");
         break;
     case trace::API_EGL:
-        prog = QLatin1String("eglretrace");
+        prog = QLatin1String("eglreplay");
         break;
     case trace::API_DX:
     case trace::API_D3D7:
@@ -260,10 +260,10 @@ void Retracer::run()
     case trace::API_D3D9:
     case trace::API_DXGI:
 #ifdef Q_OS_WIN
-        prog = QLatin1String("d3dretrace");
+        prog = QLatin1String("d3dreplay");
 #else
         prog = QLatin1String("wine");
-        arguments << QLatin1String("d3dretrace.exe");
+        arguments << QLatin1String("d3dreplay.exe");
 #endif
         break;
     default:
@@ -484,10 +484,10 @@ void Retracer::run()
     }
 
     if (!errors.isEmpty()) {
-        emit retraceErrors(errors);
+        emit replayErrors(errors);
     }
 
     emit finished(msg);
 }
 
-#include "retracer.moc"
+#include "replayer.moc"
diff --git a/gui/retracer.h b/gui/replayer.h
similarity index 89%
rename from gui/retracer.h
rename to gui/replayer.h
index af1a3d9..d9f2437 100644
--- a/gui/retracer.h
+++ b/gui/replayer.h
@@ -1,5 +1,5 @@
-#ifndef RETRACER_H
-#define RETRACER_H
+#ifndef REPLAYER_H
+#define REPLAYER_H
 
 #include "trace_api.hpp"
 #include "apitracecall.h"
@@ -11,11 +11,11 @@ class ApiTraceState;
 
 namespace trace { struct Profile; }
 
-class Retracer : public QThread
+class Replayer : public QThread
 {
     Q_OBJECT
 public:
-    Retracer(QObject *parent=0);
+    Replayer(QObject *parent=0);
 
     QString fileName() const;
     void setFileName(const QString &name);
@@ -49,7 +49,7 @@ signals:
     void foundProfile(trace::Profile *profile);
     void foundThumbnails(const QList<QImage> &thumbnails);
     void error(const QString &msg);
-    void retraceErrors(const QList<ApiTraceError> &errors);
+    void replayErrors(const QList<ApiTraceError> &errors);
 
 protected:
     virtual void run();
diff --git a/gui/ui/retracerdialog.ui b/gui/ui/replayerdialog.ui
similarity index 94%
rename from gui/ui/retracerdialog.ui
rename to gui/ui/replayerdialog.ui
index 8df9960..4ca1952 100644
--- a/gui/ui/retracerdialog.ui
+++ b/gui/ui/replayerdialog.ui
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
- <class>RetracerDialog</class>
- <widget class="QDialog" name="RetracerDialog">
+ <class>ReplayerDialog</class>
+ <widget class="QDialog" name="ReplayerDialog">
   <property name="windowModality">
    <enum>Qt::ApplicationModal</enum>
   </property>
@@ -14,7 +14,7 @@
    </rect>
   </property>
   <property name="windowTitle">
-   <string>Retracer Configuration</string>
+   <string>Replayer Configuration</string>
   </property>
   <property name="whatsThis">
    <string>Allows setting options on the retracing process.</string>
@@ -117,7 +117,7 @@
   <connection>
    <sender>buttonBox</sender>
    <signal>accepted()</signal>
-   <receiver>RetracerDialog</receiver>
+   <receiver>ReplayerDialog</receiver>
    <slot>accept()</slot>
    <hints>
     <hint type="sourcelabel">
@@ -133,7 +133,7 @@
   <connection>
    <sender>buttonBox</sender>
    <signal>rejected()</signal>
-   <receiver>RetracerDialog</receiver>
+   <receiver>ReplayerDialog</receiver>
    <slot>reject()</slot>
    <hints>
     <hint type="sourcelabel">
diff --git a/replay/.gitignore b/replay/.gitignore
new file mode 100644
index 0000000..fb6ef1f
--- /dev/null
+++ b/replay/.gitignore
@@ -0,0 +1,4 @@
+d3dreplay_d3d9.cpp
+d3dreplay_dxgi.cpp
+glreplay_gl.cpp
+glstate_params.cpp
diff --git a/retrace/CMakeLists.txt b/replay/CMakeLists.txt
similarity index 71%
rename from retrace/CMakeLists.txt
rename to replay/CMakeLists.txt
index b271727..d96c6be 100644
--- a/retrace/CMakeLists.txt
+++ b/replay/CMakeLists.txt
@@ -1,5 +1,5 @@
 ##############################################################################
-# API retracers
+# API replayers
 
 include_directories (
     ${CMAKE_CURRENT_SOURCE_DIR}
@@ -9,14 +9,14 @@ include_directories (
     ${CMAKE_SOURCE_DIR}/image
 )
 
-add_definitions (-DRETRACE)
+add_definitions (-DREPLAY)
 
 add_custom_command (
-    OUTPUT glretrace_gl.cpp
-    COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glretrace.py > ${CMAKE_CURRENT_BINARY_DIR}/glretrace_gl.cpp
+    OUTPUT glreplay_gl.cpp
+    COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glreplay.py > ${CMAKE_CURRENT_BINARY_DIR}/glreplay_gl.cpp
     DEPENDS
-                glretrace.py
-                retrace.py
+                glreplay.py
+                replay.py
                 ${CMAKE_SOURCE_DIR}/specs/glapi.py
                 ${CMAKE_SOURCE_DIR}/specs/gltypes.py
                 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
@@ -32,14 +32,14 @@ add_custom_command (
                 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
 )
 
-add_library (retrace_common STATIC
-    retrace.cpp
-    retrace_main.cpp
-    retrace_stdc.cpp
-    retrace_swizzle.cpp
+add_library (replay_common STATIC
+    replay.cpp
+    replay_main.cpp
+    replay_stdc.cpp
+    replay_swizzle.cpp
     json.cpp
 )
-target_link_libraries (retrace_common
+target_link_libraries (replay_common
     image
     common
     ${ZLIB_LIBRARIES}
@@ -47,52 +47,52 @@ target_link_libraries (retrace_common
     ${GETOPT_LIBRARIES}
 )
 
-add_library (glretrace_common STATIC
-    glretrace_gl.cpp
-    glretrace_cgl.cpp
-    glretrace_glx.cpp
-    glretrace_wgl.cpp
-    glretrace_egl.cpp
-    glretrace_main.cpp
-    glretrace_ws.cpp
+add_library (glreplay_common STATIC
+    glreplay_gl.cpp
+    glreplay_cgl.cpp
+    glreplay_glx.cpp
+    glreplay_wgl.cpp
+    glreplay_egl.cpp
+    glreplay_main.cpp
+    glreplay_ws.cpp
     glstate.cpp
     glstate_images.cpp
     glstate_params.cpp
     glstate_shaders.cpp
     glws.cpp
 )
-add_dependencies (glretrace_common glproc)
-target_link_libraries (glretrace_common
-    retrace_common
+add_dependencies (glreplay_common glproc)
+target_link_libraries (glreplay_common
+    replay_common
 )
 
 
 if (WIN32 OR APPLE OR X11_FOUND)
-    add_executable (glretrace
+    add_executable (glreplay
         ${glws_os}
     )
 
-    add_dependencies (glretrace glproc)
+    add_dependencies (glreplay glproc)
 
-    target_link_libraries (glretrace
-        retrace_common
-        glretrace_common
+    target_link_libraries (glreplay
+        replay_common
+        glreplay_common
         glproc_gl
     )
 
     if (WIN32)
     else ()
         if (APPLE)
-            target_link_libraries (glretrace
+            target_link_libraries (glreplay
                 "-framework Cocoa"
                 "-framework ApplicationServices" # CGS*
                 #"-framework OpenGL" # CGL*
             )
         else ()
-            target_link_libraries (glretrace ${X11_X11_LIB})
+            target_link_libraries (glreplay ${X11_X11_LIB})
         endif ()
 
-        target_link_libraries (glretrace
+        target_link_libraries (glreplay
             # gdb doesn't like when pthreads is loaded through dlopen (which happens
             # when dlopen'ing libGL), so link pthreads to avoid this issue.  See also
             # http://stackoverflow.com/questions/2702628/gdb-cannot-find-new-threads-generic-error
@@ -101,24 +101,24 @@ if (WIN32 OR APPLE OR X11_FOUND)
         )
 
         if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
-            target_link_libraries (glretrace rt)
+            target_link_libraries (glreplay rt)
         endif ()
 
     endif ()
 
-    install (TARGETS glretrace RUNTIME DESTINATION bin) 
+    install (TARGETS glreplay RUNTIME DESTINATION bin) 
 endif ()
 
 if (ENABLE_EGL AND X11_FOUND AND NOT WIN32 AND NOT APPLE)
-    add_executable (eglretrace
+    add_executable (eglreplay
         glws_egl_xlib.cpp
     )
 
-    add_dependencies (eglretrace glproc)
+    add_dependencies (eglreplay glproc)
 
-    target_link_libraries (eglretrace
-        retrace_common
-        glretrace_common
+    target_link_libraries (eglreplay
+        replay_common
+        glreplay_common
         glproc_egl
         ${X11_X11_LIB}
         ${CMAKE_THREAD_LIBS_INIT}
@@ -126,10 +126,10 @@ if (ENABLE_EGL AND X11_FOUND AND NOT WIN32 AND NOT APPLE)
     )
 
     if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
-        target_link_libraries (eglretrace rt)
+        target_link_libraries (eglreplay rt)
     endif ()
 
-    install (TARGETS eglretrace RUNTIME DESTINATION bin) 
+    install (TARGETS eglreplay RUNTIME DESTINATION bin) 
 endif ()
 
 if (WIN32)
@@ -144,12 +144,12 @@ if (WIN32)
         set (HAVE_D3D8 0)
     endif ()
     add_custom_command (
-        OUTPUT d3dretrace_d3d8.cpp
-        COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d9retrace.py d3d8 ${HAVE_D3D8} > ${CMAKE_CURRENT_BINARY_DIR}/d3dretrace_d3d8.cpp
+        OUTPUT d3dreplay_d3d8.cpp
+        COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d9replay.py d3d8 ${HAVE_D3D8} > ${CMAKE_CURRENT_BINARY_DIR}/d3dreplay_d3d8.cpp
         DEPENDS
-                d3d9retrace.py
-                dllretrace.py
-                retrace.py
+                d3d9replay.py
+                dllreplay.py
+                replay.py
                 ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
                 ${CMAKE_SOURCE_DIR}/specs/d3d8.py
                 ${CMAKE_SOURCE_DIR}/specs/d3d8types.py
@@ -165,12 +165,12 @@ if (WIN32)
         set (HAVE_D3D9 0)
     endif ()
     add_custom_command (
-        OUTPUT d3dretrace_d3d9.cpp
-        COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d9retrace.py d3d9 ${HAVE_D3D9} > ${CMAKE_CURRENT_BINARY_DIR}/d3dretrace_d3d9.cpp
+        OUTPUT d3dreplay_d3d9.cpp
+        COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d9replay.py d3d9 ${HAVE_D3D9} > ${CMAKE_CURRENT_BINARY_DIR}/d3dreplay_d3d9.cpp
         DEPENDS
-                d3d9retrace.py
-                dllretrace.py
-                retrace.py
+                d3d9replay.py
+                dllreplay.py
+                replay.py
                 ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
                 ${CMAKE_SOURCE_DIR}/specs/d3d9.py
                 ${CMAKE_SOURCE_DIR}/specs/d3d9types.py
@@ -206,12 +206,12 @@ if (WIN32)
     endif ()
 
     add_custom_command (
-        OUTPUT d3dretrace_dxgi.cpp
-        COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/dxgiretrace.py ${DXGI_MODULES} > ${CMAKE_CURRENT_BINARY_DIR}/d3dretrace_dxgi.cpp
+        OUTPUT d3dreplay_dxgi.cpp
+        COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/dxgireplay.py ${DXGI_MODULES} > ${CMAKE_CURRENT_BINARY_DIR}/d3dreplay_dxgi.cpp
         DEPENDS
-                dxgiretrace.py
-                dllretrace.py
-                retrace.py
+                dxgireplay.py
+                dllreplay.py
+                replay.py
                 ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
                 ${CMAKE_SOURCE_DIR}/specs/d3d11_1.py
                 ${CMAKE_SOURCE_DIR}/specs/d3d11.py
@@ -228,20 +228,20 @@ if (WIN32)
                 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
     )
 
-    add_executable (d3dretrace
-        d3dretrace_main.cpp
-        d3dretrace_d3d8.cpp
-        d3dretrace_d3d9.cpp
-        d3dretrace_dxgi.cpp
-        d3dretrace_ws.cpp
+    add_executable (d3dreplay
+        d3dreplay_main.cpp
+        d3dreplay_d3d8.cpp
+        d3dreplay_d3d9.cpp
+        d3dreplay_dxgi.cpp
+        d3dreplay_ws.cpp
         d3d9state.cpp
         d3d9state_images.cpp
         ${D3DSTATE_SOURCES}
     )
-    target_link_libraries (d3dretrace
-        retrace_common
+    target_link_libraries (d3dreplay
+        replay_common
         d3dhelpers
     )
 
-    install (TARGETS d3dretrace RUNTIME DESTINATION bin)
+    install (TARGETS d3dreplay RUNTIME DESTINATION bin)
 endif ()
diff --git a/retrace/d3d10state.cpp b/replay/d3d10state.cpp
similarity index 100%
rename from retrace/d3d10state.cpp
rename to replay/d3d10state.cpp
diff --git a/retrace/d3d10state.hpp b/replay/d3d10state.hpp
similarity index 100%
rename from retrace/d3d10state.hpp
rename to replay/d3d10state.hpp
diff --git a/retrace/d3d10state_images.cpp b/replay/d3d10state_images.cpp
similarity index 100%
rename from retrace/d3d10state_images.cpp
rename to replay/d3d10state_images.cpp
diff --git a/retrace/d3d11state.cpp b/replay/d3d11state.cpp
similarity index 100%
rename from retrace/d3d11state.cpp
rename to replay/d3d11state.cpp
diff --git a/retrace/d3d11state_images.cpp b/replay/d3d11state_images.cpp
similarity index 100%
rename from retrace/d3d11state_images.cpp
rename to replay/d3d11state_images.cpp
diff --git a/retrace/d3d8state.cpp b/replay/d3d8state.cpp
similarity index 100%
rename from retrace/d3d8state.cpp
rename to replay/d3d8state.cpp
diff --git a/retrace/d3d8state_images.cpp b/replay/d3d8state_images.cpp
similarity index 100%
rename from retrace/d3d8state_images.cpp
rename to replay/d3d8state_images.cpp
diff --git a/retrace/d3d9retrace.py b/replay/d3d9replay.py
similarity index 75%
rename from retrace/d3d9retrace.py
rename to replay/d3d9replay.py
index db92377..c986a30 100644
--- a/retrace/d3d9retrace.py
+++ b/replay/d3d9replay.py
@@ -24,26 +24,26 @@
 ##########################################################################/
 
 
-"""D3D retracer generator."""
+"""D3D replayer generator."""
 
 
 import sys
-from dllretrace import DllRetracer as Retracer
+from dllreplay import DllReplayer as Replayer
 from specs.stdapi import API
 
 
-class D3DRetracer(Retracer):
+class D3DReplayer(Replayer):
 
-    def retraceApi(self, api):
+    def replayApi(self, api):
         print '// Swizzling mapping for lock addresses'
         print 'static std::map<void *, void *> _maps;'
         print
 
-        Retracer.retraceApi(self, api)
+        Replayer.replayApi(self, api)
 
     def invokeFunction(self, function):
         if function.name in ('Direct3DCreate9', 'Direct3DCreate9Ex'):
-            print 'if (retrace::debug && !g_szD3D9DllName) {'
+            print 'if (replay::debug && !g_szD3D9DllName) {'
             print '    /* '
             print '     * XXX: D3D9D only works for simple things, it often introduces errors'
             print '     * on complex traces, or traces which use unofficial D3D9 features.'
@@ -53,7 +53,7 @@ class D3DRetracer(Retracer):
             print '    }'
             print '}'
 
-        Retracer.invokeFunction(self, function)
+        Replayer.invokeFunction(self, function)
 
     def invokeInterfaceMethod(self, interface, method):
         # keep track of the last used device for state dumping
@@ -70,57 +70,57 @@ class D3DRetracer(Retracer):
 
         # create windows as neccessary
         if method.name in ('CreateDevice', 'CreateDeviceEx', 'CreateAdditionalSwapChain'):
-            print r'    HWND hWnd = d3dretrace::createWindow(pPresentationParameters->BackBufferWidth, pPresentationParameters->BackBufferHeight);'
+            print r'    HWND hWnd = d3dreplay::createWindow(pPresentationParameters->BackBufferWidth, pPresentationParameters->BackBufferHeight);'
             print r'    pPresentationParameters->hDeviceWindow = hWnd;'
             if 'hFocusWindow' in method.argNames():
                 print r'    hFocusWindow = hWnd;'
         
         if method.name in ('CreateDevice', 'CreateDeviceEx'):
-            print r'    switch (retrace::driver) {'
-            print r'    case retrace::DRIVER_HARDWARE:'
+            print r'    switch (replay::driver) {'
+            print r'    case replay::DRIVER_HARDWARE:'
             print r'        DeviceType = D3DDEVTYPE_HAL;'
             print r'        break;'
-            print r'    case retrace::DRIVER_SOFTWARE:'
-            print r'    case retrace::DRIVER_REFERENCE:'
+            print r'    case replay::DRIVER_SOFTWARE:'
+            print r'    case replay::DRIVER_REFERENCE:'
             print r'        DeviceType = D3DDEVTYPE_REF;'
             print r'        break;'
-            print r'    case retrace::DRIVER_NULL:'
+            print r'    case replay::DRIVER_NULL:'
             if interface.name.startswith('IDirect3D9'):
                 print r'        DeviceType = D3DDEVTYPE_NULLREF;'
             else:
-                print r'        retrace::warning(call) << "null driver not supported\n";'
+                print r'        replay::warning(call) << "null driver not supported\n";'
             print r'        break;'
-            print r'    case retrace::DRIVER_MODULE:'
-            print r'        retrace::warning(call) << "driver module not supported\n";'
+            print r'    case replay::DRIVER_MODULE:'
+            print r'        replay::warning(call) << "driver module not supported\n";'
             print r'        break;'
             print r'    default:'
             print r'        assert(0);'
             print r'        /* fall-through */'
-            print r'    case retrace::DRIVER_DEFAULT:'
+            print r'    case replay::DRIVER_DEFAULT:'
             print r'        break;'
             print r'    }'
 
         if method.name in ('Reset', 'ResetEx'):
             print r'    if (pPresentationParameters->Windowed) {'
-            print r'        d3dretrace::resizeWindow(pPresentationParameters->hDeviceWindow, pPresentationParameters->BackBufferWidth, pPresentationParameters->BackBufferHeight);'
+            print r'        d3dreplay::resizeWindow(pPresentationParameters->hDeviceWindow, pPresentationParameters->BackBufferWidth, pPresentationParameters->BackBufferHeight);'
             print r'    }'
 
         # notify frame has been completed
         if method.name == 'Present':
-            print r'    retrace::frameComplete(call);'
+            print r'    replay::frameComplete(call);'
             print r'    hDestWindowOverride = NULL;'
 
         if 'pSharedHandle' in method.argNames():
             print r'    if (pSharedHandle) {'
-            print r'        retrace::warning(call) << "shared surfaces unsupported\n";'
+            print r'        replay::warning(call) << "shared surfaces unsupported\n";'
             print r'        pSharedHandle = NULL;'
             print r'    }'
 
-        Retracer.invokeInterfaceMethod(self, interface, method)
+        Replayer.invokeInterfaceMethod(self, interface, method)
 
         # process events after presents
         if method.name == 'Present':
-            print r'    d3dretrace::processEvents();'
+            print r'    d3dreplay::processEvents();'
             print r'    Sleep(500);'
 
         if method.name in ('Lock', 'LockRect', 'LockBox'):
@@ -137,7 +137,7 @@ class D3DRetracer(Retracer):
             print '    VOID *_pbData = 0;'
             print '    _pbData = _maps[_this];'
             print '    if (_pbData) {'
-            print '        retrace::delRegionByPointer(_pbData);'
+            print '        replay::delRegionByPointer(_pbData);'
             print '        _maps[_this] = 0;'
             print '    }'
 
@@ -147,7 +147,7 @@ def main():
     print
     print r'#include <iostream>'
     print
-    print r'#include "d3dretrace.hpp"'
+    print r'#include "d3dreplay.hpp"'
     print
 
     moduleName = sys.argv[1]
@@ -162,7 +162,7 @@ def main():
             print r'#include "d3d9size.hpp"'
             api.addModule(d3d9)
             print
-            print '''static d3dretrace::D3DDumper<IDirect3DDevice9> d3d9Dumper;'''
+            print '''static d3dreplay::D3DDumper<IDirect3DDevice9> d3d9Dumper;'''
             print
         elif moduleName == 'd3d8':
             from specs.d3d8 import d3d8
@@ -170,14 +170,14 @@ def main():
             print r'#include "d3d8size.hpp"'
             api.addModule(d3d8)
             print
-            print '''static d3dretrace::D3DDumper<IDirect3DDevice8> d3d8Dumper;'''
+            print '''static d3dreplay::D3DDumper<IDirect3DDevice8> d3d8Dumper;'''
             print
         else:
             assert False
 
-    retracer = D3DRetracer()
-    retracer.table_name = 'd3dretrace::%s_callbacks' % moduleName
-    retracer.retraceApi(api)
+    replayer = D3DReplayer()
+    replayer.table_name = 'd3dreplay::%s_callbacks' % moduleName
+    replayer.replayApi(api)
 
 
 if __name__ == '__main__':
diff --git a/retrace/d3d9state.cpp b/replay/d3d9state.cpp
similarity index 100%
rename from retrace/d3d9state.cpp
rename to replay/d3d9state.cpp
diff --git a/retrace/d3d9state_images.cpp b/replay/d3d9state_images.cpp
similarity index 100%
rename from retrace/d3d9state_images.cpp
rename to replay/d3d9state_images.cpp
diff --git a/retrace/d3dretrace.hpp b/replay/d3dreplay.hpp
similarity index 85%
rename from retrace/d3dretrace.hpp
rename to replay/d3dreplay.hpp
index 41cc1c5..9c4f62b 100644
--- a/retrace/d3dretrace.hpp
+++ b/replay/d3dreplay.hpp
@@ -23,26 +23,26 @@
  *
  **************************************************************************/
 
-#ifndef _D3DRETRACE_HPP_
-#define _D3DRETRACE_HPP_
+#ifndef _D3DREPLAY_HPP_
+#define _D3DREPLAY_HPP_
 
 
 #include <windows.h>
 
-#include "retrace.hpp"
+#include "replay.hpp"
 #include "d3dstate.hpp"
 
 
-namespace d3dretrace {
+namespace d3dreplay {
 
 
-extern const retrace::Entry d3d8_callbacks[];
-extern const retrace::Entry d3d9_callbacks[];
-extern const retrace::Entry dxgi_callbacks[];
+extern const replay::Entry d3d8_callbacks[];
+extern const replay::Entry d3d9_callbacks[];
+extern const replay::Entry dxgi_callbacks[];
 
 
 template< class Device >
-class D3DDumper : public retrace::Dumper {
+class D3DDumper : public replay::Dumper {
 public:
     Device *pLastDevice;
 
@@ -70,7 +70,7 @@ public:
     inline void
     bindDevice(Device *pDevice) {
         pLastDevice = pDevice;
-        retrace::dumper = this;
+        replay::dumper = this;
     }
     
     inline void
@@ -92,7 +92,7 @@ bool
 processEvents(void);
 
 
-} /* namespace d3dretrace */
+} /* namespace d3dreplay */
 
 
-#endif /* _D3DRETRACE_HPP_ */
+#endif /* _D3DREPLAY_HPP_ */
diff --git a/retrace/d3dretrace_main.cpp b/replay/d3dreplay_main.cpp
similarity index 79%
rename from retrace/d3dretrace_main.cpp
rename to replay/d3dreplay_main.cpp
index 3de6daa..fbbe018 100644
--- a/retrace/d3dretrace_main.cpp
+++ b/replay/d3dreplay_main.cpp
@@ -29,33 +29,33 @@
 #include "os_string.hpp"
 
 #include "d3dstate.hpp"
-#include "retrace.hpp"
-#include "d3dretrace.hpp"
+#include "replay.hpp"
+#include "d3dreplay.hpp"
 
 
 void
-retrace::setUp(void) {
+replay::setUp(void) {
 }
 
 
 void
-retrace::addCallbacks(retrace::Retracer &retracer)
+replay::addCallbacks(replay::Replayer &replayer)
 {
-    retracer.addCallbacks(d3dretrace::d3d8_callbacks);
-    retracer.addCallbacks(d3dretrace::d3d9_callbacks);
-    retracer.addCallbacks(d3dretrace::dxgi_callbacks);
+    replayer.addCallbacks(d3dreplay::d3d8_callbacks);
+    replayer.addCallbacks(d3dreplay::d3d9_callbacks);
+    replayer.addCallbacks(d3dreplay::dxgi_callbacks);
 }
 
 
 void
-retrace::flushRendering(void) {
+replay::flushRendering(void) {
 }
 
 void
-retrace::waitForInput(void) {
+replay::waitForInput(void) {
     /* TODO */
 }
 
 void
-retrace::cleanUp(void) {
+replay::cleanUp(void) {
 }
diff --git a/retrace/d3dretrace_ws.cpp b/replay/d3dreplay_ws.cpp
similarity index 95%
rename from retrace/d3dretrace_ws.cpp
rename to replay/d3dreplay_ws.cpp
index 42bd0ab..3c1d63b 100644
--- a/retrace/d3dretrace_ws.cpp
+++ b/replay/d3dreplay_ws.cpp
@@ -24,10 +24,10 @@
  **************************************************************************/
 
 
-#include "d3dretrace.hpp"
+#include "d3dreplay.hpp"
 
 
-namespace d3dretrace {
+namespace d3dreplay {
 
 
 // XXX: Don't duplicate this code.
@@ -75,7 +75,7 @@ createWindow(int width, int height) {
         wc.hCursor = LoadCursor(NULL, IDC_ARROW);
         wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
         wc.lpfnWndProc = WndProc;
-        wc.lpszClassName = "d3dretrace";
+        wc.lpszClassName = "d3dreplay";
         wc.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW;
         RegisterClass(&wc);
         first = FALSE;
@@ -98,7 +98,7 @@ createWindow(int width, int height) {
     AdjustWindowRectEx(&rect, dwStyle, FALSE, dwExStyle);
 
     hWnd = CreateWindowEx(dwExStyle,
-                          "d3dretrace", /* wc.lpszClassName */
+                          "d3dreplay", /* wc.lpszClassName */
                           NULL,
                           dwStyle,
                           0, /* x */
@@ -148,4 +148,4 @@ processEvents(void) {
 }
 
 
-} /* namespace d3dretrace */
+} /* namespace d3dreplay */
diff --git a/retrace/d3dstate.hpp b/replay/d3dstate.hpp
similarity index 100%
rename from retrace/d3dstate.hpp
rename to replay/d3dstate.hpp
diff --git a/retrace/dllretrace.py b/replay/dllreplay.py
similarity index 95%
rename from retrace/dllretrace.py
rename to replay/dllreplay.py
index aa7ed45..c10c996 100644
--- a/retrace/dllretrace.py
+++ b/replay/dllreplay.py
@@ -24,7 +24,7 @@
 ##########################################################################/
 
 
-from retrace import Retracer
+from replay import Replayer
 from dispatch import Dispatcher
 from specs.stdapi import API
 
@@ -64,11 +64,11 @@ class DllDispatcher(Dispatcher):
         return '_get%sProcAddress' % (module.name.upper())
 
 
-class DllRetracer(Retracer):
+class DllReplayer(Replayer):
 
-    def retraceApi(self, api):
+    def replayApi(self, api):
         for module in api.modules:
             dispatcher = DllDispatcher()
             dispatcher.dispatchModule(module)
 
-        Retracer.retraceApi(self, api)
+        Replayer.replayApi(self, api)
diff --git a/retrace/dxgiretrace.py b/replay/dxgireplay.py
similarity index 80%
rename from retrace/dxgiretrace.py
rename to replay/dxgireplay.py
index 8de3c98..db92bf5 100644
--- a/retrace/dxgiretrace.py
+++ b/replay/dxgireplay.py
@@ -24,11 +24,11 @@
 ##########################################################################/
 
 
-"""D3D retracer generator."""
+"""D3D replayer generator."""
 
 
 import sys
-from dllretrace import DllRetracer as Retracer
+from dllreplay import DllReplayer as Replayer
 from specs.stdapi import API
 from specs.dxgi import dxgi
 from specs.d3d10 import d3d10
@@ -36,9 +36,9 @@ from specs.d3d10_1 import d3d10_1
 from specs.d3d11 import d3d11
 
 
-class D3DRetracer(Retracer):
+class D3DReplayer(Replayer):
 
-    def retraceApi(self, api):
+    def replayApi(self, api):
         print '// Swizzling mapping for lock addresses'
         print 'static std::map<void *, void *> _maps;'
         print
@@ -50,14 +50,14 @@ createWindow(DXGI_SWAP_CHAIN_DESC *pSwapChainDesc) {
         UINT Height = pSwapChainDesc->BufferDesc.Height;
         if (!Width)  Width = 1024;
         if (!Height) Height = 768;
-        pSwapChainDesc->OutputWindow = d3dretrace::createWindow(Width, Height);
+        pSwapChainDesc->OutputWindow = d3dreplay::createWindow(Width, Height);
     }
 }
 '''
 
-        self.table_name = 'd3dretrace::dxgi_callbacks'
+        self.table_name = 'd3dreplay::dxgi_callbacks'
 
-        Retracer.retraceApi(self, api)
+        Replayer.replayApi(self, api)
 
     createDeviceFunctionNames = [
         "D3D10CreateDevice",
@@ -83,7 +83,7 @@ createWindow(DXGI_SWAP_CHAIN_DESC *pSwapChainDesc) {
             if function.name.startswith('D3D10CreateDevice'):
                 # Toggle debugging
                 print r'    Flags &= ~D3D10_CREATE_DEVICE_DEBUG;'
-                print r'    if (retrace::debug) {'
+                print r'    if (replay::debug) {'
                 print r'        if (LoadLibraryA("d3d10sdklayers")) {'
                 print r'            Flags |= D3D10_CREATE_DEVICE_DEBUG;'
                 print r'        }'
@@ -95,7 +95,7 @@ createWindow(DXGI_SWAP_CHAIN_DESC *pSwapChainDesc) {
             if function.name.startswith('D3D11CreateDevice'):
                 # Toggle debugging
                 print r'    Flags &= ~D3D11_CREATE_DEVICE_DEBUG;'
-                print r'    if (retrace::debug) {'
+                print r'    if (replay::debug) {'
                 print r'        if (LoadLibraryA("d3d11sdklayers")) {'
                 print r'            Flags |= D3D11_CREATE_DEVICE_DEBUG;'
                 print r'        }'
@@ -104,44 +104,44 @@ createWindow(DXGI_SWAP_CHAIN_DESC *pSwapChainDesc) {
                 # Force driver
                 self.forceDriver('D3D_DRIVER_TYPE')
 
-        Retracer.invokeFunction(self, function)
+        Replayer.invokeFunction(self, function)
 
     def forceDriver(self, enum):
         # This can only work when pAdapter is NULL. For non-NULL pAdapter we
         # need to override inside the EnumAdapters call below
         print r'    if (pAdapter == NULL) {'
-        print r'        switch (retrace::driver) {'
-        print r'        case retrace::DRIVER_HARDWARE:'
+        print r'        switch (replay::driver) {'
+        print r'        case replay::DRIVER_HARDWARE:'
         print r'            DriverType = %s_HARDWARE;' % enum
         print r'            Software = NULL;'
         print r'            break;'
-        print r'        case retrace::DRIVER_SOFTWARE:'
+        print r'        case replay::DRIVER_SOFTWARE:'
         print r'            DriverType = %s_WARP;' % enum
         print r'            Software = NULL;'
         print r'            break;'
-        print r'        case retrace::DRIVER_REFERENCE:'
+        print r'        case replay::DRIVER_REFERENCE:'
         print r'            DriverType = %s_REFERENCE;' % enum
         print r'            Software = NULL;'
         print r'            break;'
-        print r'        case retrace::DRIVER_NULL:'
+        print r'        case replay::DRIVER_NULL:'
         print r'            DriverType = %s_NULL;' % enum
         print r'            Software = NULL;'
         print r'            break;'
-        print r'        case retrace::DRIVER_MODULE:'
+        print r'        case replay::DRIVER_MODULE:'
         print r'            DriverType = %s_SOFTWARE;' % enum
-        print r'            Software = LoadLibraryA(retrace::driverModule);'
+        print r'            Software = LoadLibraryA(replay::driverModule);'
         print r'            if (!Software) {'
-        print r'                retrace::warning(call) << "failed to load " << retrace::driverModule << "\n";'
+        print r'                replay::warning(call) << "failed to load " << replay::driverModule << "\n";'
         print r'            }'
         print r'            break;'
         print r'        default:'
         print r'            assert(0);'
         print r'            /* fall-through */'
-        print r'        case retrace::DRIVER_DEFAULT:'
+        print r'        case replay::DRIVER_DEFAULT:'
         print r'            if (DriverType == %s_SOFTWARE) {' % enum
         print r'                Software = LoadLibraryA("d3d10warp");'
         print r'                if (!Software) {'
-        print r'                    retrace::warning(call) << "failed to load d3d10warp.dll\n";'
+        print r'                    replay::warning(call) << "failed to load d3d10warp.dll\n";'
         print r'                }'
         print r'            }'
         print r'            break;'
@@ -169,24 +169,24 @@ createWindow(DXGI_SWAP_CHAIN_DESC *pSwapChainDesc) {
 
         # notify frame has been completed
         if method.name == 'Present':
-            print r'    retrace::frameComplete(call);'
+            print r'    replay::frameComplete(call);'
 
         if 'pSharedResource' in method.argNames():
             print r'    if (pSharedResource) {'
-            print r'        retrace::warning(call) << "shared surfaces unsupported\n";'
+            print r'        replay::warning(call) << "shared surfaces unsupported\n";'
             print r'        pSharedResource = NULL;'
             print r'    }'
 
         # Force driver
         if interface.name.startswith('IDXGIFactory') and method.name == 'EnumAdapters':
             print r'    const char *szSoftware = NULL;'
-            print r'    switch (retrace::driver) {'
-            print r'    case retrace::DRIVER_REFERENCE:'
-            print r'    case retrace::DRIVER_SOFTWARE:'
+            print r'    switch (replay::driver) {'
+            print r'    case replay::DRIVER_REFERENCE:'
+            print r'    case replay::DRIVER_SOFTWARE:'
             print r'        szSoftware = "d3d10warp.dll";'
             print r'        break;'
-            print r'    case retrace::DRIVER_MODULE:'
-            print r'        szSoftware = retrace::driverModule;'
+            print r'    case replay::DRIVER_MODULE:'
+            print r'        szSoftware = replay::driverModule;'
             print r'        break;'
             print r'    default:'
             print r'        break;'
@@ -195,21 +195,21 @@ createWindow(DXGI_SWAP_CHAIN_DESC *pSwapChainDesc) {
             print r'    if (szSoftware) {'
             print r'        hSoftware = LoadLibraryA(szSoftware);'
             print r'        if (!hSoftware) {'
-            print r'            retrace::warning(call) << "failed to load " << szSoftware << "\n";'
+            print r'            replay::warning(call) << "failed to load " << szSoftware << "\n";'
             print r'        }'
             print r'    }'
             print r'    if (hSoftware) {'
             print r'        _result = _this->CreateSoftwareAdapter(hSoftware, ppAdapter);'
             print r'    } else {'
-            Retracer.invokeInterfaceMethod(self, interface, method)
+            Replayer.invokeInterfaceMethod(self, interface, method)
             print r'    }'
             return
 
-        Retracer.invokeInterfaceMethod(self, interface, method)
+        Replayer.invokeInterfaceMethod(self, interface, method)
 
         # process events after presents
         if method.name == 'Present':
-            print r'    d3dretrace::processEvents();'
+            print r'    d3dreplay::processEvents();'
 
         if method.name == 'Map':
             print '    VOID *_pbData = NULL;'
@@ -225,7 +225,7 @@ createWindow(DXGI_SWAP_CHAIN_DESC *pSwapChainDesc) {
             print '    VOID *_pbData = 0;'
             print '    _pbData = _maps[_this];'
             print '    if (_pbData) {'
-            print '        retrace::delRegionByPointer(_pbData);'
+            print '        replay::delRegionByPointer(_pbData);'
             print '        _maps[_this] = 0;'
             print '    }'
 
@@ -233,7 +233,7 @@ createWindow(DXGI_SWAP_CHAIN_DESC *pSwapChainDesc) {
         if 'pShaderBytecode' in method.argNames():
             ppShader = method.args[-1]
             assert ppShader.output
-            print r'    if (retrace::dumpingState && SUCCEEDED(_result)) {'
+            print r'    if (replay::dumpingState && SUCCEEDED(_result)) {'
             print r'        (*%s)->SetPrivateData(d3dstate::GUID_D3DSTATE, BytecodeLength, pShaderBytecode);' % ppShader.name
             print r'    }'
 
@@ -243,7 +243,7 @@ def main():
     print
     print r'#include <iostream>'
     print
-    print r'#include "d3dretrace.hpp"'
+    print r'#include "d3dreplay.hpp"'
     print
 
     moduleNames = sys.argv[1:]
@@ -262,7 +262,7 @@ def main():
         print r'#include "d3d10size.hpp"'
         api.addModule(d3d10)
         print
-        print '''static d3dretrace::D3DDumper<ID3D10Device> d3d10Dumper;'''
+        print '''static d3dreplay::D3DDumper<ID3D10Device> d3d10Dumper;'''
         print
 
     if 'd3d11' in moduleNames:
@@ -275,11 +275,11 @@ def main():
         api.addModule(d3d11)
         
         print
-        print '''static d3dretrace::D3DDumper<ID3D11DeviceContext> d3d11Dumper;'''
+        print '''static d3dreplay::D3DDumper<ID3D11DeviceContext> d3d11Dumper;'''
         print
 
-    retracer = D3DRetracer()
-    retracer.retraceApi(api)
+    replayer = D3DReplayer()
+    replayer.replayApi(api)
 
 
 if __name__ == '__main__':
diff --git a/retrace/glretrace.hpp b/replay/glreplay.hpp
similarity index 87%
rename from retrace/glretrace.hpp
rename to replay/glreplay.hpp
index 95a6d75..9d28051 100644
--- a/retrace/glretrace.hpp
+++ b/replay/glreplay.hpp
@@ -23,14 +23,14 @@
  *
  **************************************************************************/
 
-#ifndef _GLRETRACE_HPP_
-#define _GLRETRACE_HPP_
+#ifndef _GLREPLAY_HPP_
+#define _GLREPLAY_HPP_
 
 #include "glws.hpp"
-#include "retrace.hpp"
+#include "replay.hpp"
 
 
-namespace glretrace {
+namespace glreplay {
 
 struct Context {
     Context(glws::Context* context)
@@ -92,11 +92,11 @@ makeCurrent(trace::Call &call, glws::Drawable *drawable, Context *context);
 void
 checkGlError(trace::Call &call);
 
-extern const retrace::Entry gl_callbacks[];
-extern const retrace::Entry cgl_callbacks[];
-extern const retrace::Entry glx_callbacks[];
-extern const retrace::Entry wgl_callbacks[];
-extern const retrace::Entry egl_callbacks[];
+extern const replay::Entry gl_callbacks[];
+extern const replay::Entry cgl_callbacks[];
+extern const replay::Entry glx_callbacks[];
+extern const replay::Entry wgl_callbacks[];
+extern const replay::Entry egl_callbacks[];
 
 void frame_complete(trace::Call &call);
 void initContext();
@@ -108,7 +108,7 @@ void flushQueries();
 void beginProfile(trace::Call &call, bool isDraw);
 void endProfile(trace::Call &call, bool isDraw);
 
-} /* namespace glretrace */
+} /* namespace glreplay */
 
 
-#endif /* _GLRETRACE_HPP_ */
+#endif /* _GLREPLAY_HPP_ */
diff --git a/retrace/glretrace.py b/replay/glreplay.py
similarity index 85%
rename from retrace/glretrace.py
rename to replay/glreplay.py
index 6fdeffe..97fa9a2 100644
--- a/retrace/glretrace.py
+++ b/replay/glreplay.py
@@ -24,21 +24,21 @@
 ##########################################################################/
 
 
-"""GL retracer generator."""
+"""GL replayer generator."""
 
 
-from retrace import Retracer
+from replay import Replayer
 import specs.stdapi as stdapi
 import specs.glapi as glapi
 import specs.glesapi as glesapi
 
 
-class GlRetracer(Retracer):
+class GlReplayer(Replayer):
 
-    table_name = 'glretrace::gl_callbacks'
+    table_name = 'glreplay::gl_callbacks'
 
-    def retraceFunction(self, function):
-        Retracer.retraceFunction(self, function)
+    def replayFunction(self, function):
+        Replayer.replayFunction(self, function)
 
     array_pointer_function_names = set((
         "glVertexPointer",
@@ -171,14 +171,14 @@ class GlRetracer(Retracer):
         'glUnmapObjectBufferATI',
     ])
 
-    def retraceFunctionBody(self, function):
+    def replayFunctionBody(self, function):
         is_array_pointer = function.name in self.array_pointer_function_names
         is_draw_array = function.name in self.draw_array_function_names
         is_draw_elements = function.name in self.draw_elements_function_names
         is_misc_draw = function.name in self.misc_draw_function_names
 
         if is_array_pointer or is_draw_array or is_draw_elements:
-            print '    if (retrace::parser.version < 1) {'
+            print '    if (replay::parser.version < 1) {'
 
             if is_array_pointer or is_draw_array:
                 print '        GLint _array_buffer = 0;'
@@ -208,15 +208,15 @@ class GlRetracer(Retracer):
         if function.name in self.bind_framebuffer_function_names:
             print '    assert(call.flags & trace::CALL_FLAG_SWAP_RENDERTARGET);'
         if function.name == 'glFrameTerminatorGREMEDY':
-            print '    glretrace::frame_complete(call);'
+            print '    glreplay::frame_complete(call);'
             return
 
-        Retracer.retraceFunctionBody(self, function)
+        Replayer.replayFunctionBody(self, function)
 
         # Post-snapshots
         if function.name in ('glFlush', 'glFinish'):
-            print '    if (!retrace::doubleBuffer) {'
-            print '        glretrace::frame_complete(call);'
+            print '    if (!replay::doubleBuffer) {'
+            print '        glreplay::frame_complete(call);'
             print '    }'
         if is_draw_array or is_draw_elements or is_misc_draw:
             print '    assert(call.flags & trace::CALL_FLAG_RENDER);'
@@ -225,33 +225,33 @@ class GlRetracer(Retracer):
     def invokeFunction(self, function):
         # Infer the drawable size from GL calls
         if function.name == "glViewport":
-            print '    glretrace::updateDrawable(x + width, y + height);'
+            print '    glreplay::updateDrawable(x + width, y + height);'
         if function.name == "glViewportArray":
             # We are concerned about drawables so only care for the first viewport
             print '    if (first == 0 && count > 0) {'
             print '        GLfloat x = v[0], y = v[1], w = v[2], h = v[3];'
-            print '        glretrace::updateDrawable(x + w, y + h);'
+            print '        glreplay::updateDrawable(x + w, y + h);'
             print '    }'
         if function.name == "glViewportIndexedf":
             print '    if (index == 0) {'
-            print '        glretrace::updateDrawable(x + w, y + h);'
+            print '        glreplay::updateDrawable(x + w, y + h);'
             print '    }'
         if function.name == "glViewportIndexedfv":
             print '    if (index == 0) {'
             print '        GLfloat x = v[0], y = v[1], w = v[2], h = v[3];'
-            print '        glretrace::updateDrawable(x + w, y + h);'
+            print '        glreplay::updateDrawable(x + w, y + h);'
             print '    }'
         if function.name in ('glBlitFramebuffer', 'glBlitFramebufferEXT'):
             # Some applications do all their rendering in a framebuffer, and
             # then just blit to the drawable without ever calling glViewport.
-            print '    glretrace::updateDrawable(std::max(dstX0, dstX1), std::max(dstY0, dstY1));'
+            print '    glreplay::updateDrawable(std::max(dstX0, dstX1), std::max(dstY0, dstY1));'
 
         if function.name == "glEnd":
-            print '    glretrace::insideGlBeginEnd = false;'
+            print '    glreplay::insideGlBeginEnd = false;'
 
         if function.name.startswith('gl') and not function.name.startswith('glX'):
-            print r'    if (retrace::debug && !glretrace::getCurrentContext()) {'
-            print r'        retrace::warning(call) << "no current context\n";'
+            print r'    if (replay::debug && !glreplay::getCurrentContext()) {'
+            print r'        replay::warning(call) << "no current context\n";'
             print r'    }'
 
         if function.name == 'memcpy':
@@ -279,9 +279,9 @@ class GlRetracer(Retracer):
             else:
                 assert False
             print r'        if (ptr) {'
-            print r'            retrace::delRegionByPointer(ptr);'
+            print r'            replay::delRegionByPointer(ptr);'
             print r'        } else {'
-            print r'            retrace::warning(call) << "no current context\n";'
+            print r'            replay::warning(call) << "no current context\n";'
             print r'        }'
 
         if function.name in ('glBindProgramPipeline', 'glBindProgramPipelineEXT'):
@@ -299,30 +299,30 @@ class GlRetracer(Retracer):
         )
 
         if function.name in ('glUseProgram', 'glUseProgramObjectARB'):
-            print r'    glretrace::Context *currentContext = glretrace::getCurrentContext();'
+            print r'    glreplay::Context *currentContext = glreplay::getCurrentContext();'
             print r'    if (currentContext) {'
             print r'        currentContext->activeProgram = call.arg(0).toUInt();'
             print r'    }'
 
         # Only profile if not inside a list as the queries get inserted into list
         if function.name == 'glNewList':
-            print r'    glretrace::insideList = true;'
+            print r'    glreplay::insideList = true;'
 
         if function.name == 'glEndList':
-            print r'    glretrace::insideList = false;'
+            print r'    glreplay::insideList = false;'
 
         if function.name != 'glEnd':
-            print r'    if (!glretrace::insideList && !glretrace::insideGlBeginEnd && retrace::profiling) {'
+            print r'    if (!glreplay::insideList && !glreplay::insideGlBeginEnd && replay::profiling) {'
             if profileDraw:
-                print r'        glretrace::beginProfile(call, true);'
+                print r'        glreplay::beginProfile(call, true);'
             else:
-                print r'        glretrace::beginProfile(call, false);'
+                print r'        glreplay::beginProfile(call, false);'
             print r'    }'
 
         if function.name == 'glCreateShaderProgramv':
             # When dumping state, break down glCreateShaderProgramv so that the
             # shader source can be recovered.
-            print r'    if (retrace::dumpingState) {'
+            print r'    if (replay::dumpingState) {'
             print r'        GLuint _shader = glCreateShader(type);'
             print r'        if (_shader) {'
             print r'            glShaderSource(_shader, count, strings, NULL);'
@@ -345,32 +345,32 @@ class GlRetracer(Retracer):
             print r'            _result = 0;'
             print r'        }'
             print r'    } else {'
-            Retracer.invokeFunction(self, function)
+            Replayer.invokeFunction(self, function)
             print r'    }'
         else:
-            Retracer.invokeFunction(self, function)
+            Replayer.invokeFunction(self, function)
 
         if function.name == "glBegin":
-            print '    glretrace::insideGlBeginEnd = true;'
+            print '    glreplay::insideGlBeginEnd = true;'
 
-        print r'    if (!glretrace::insideList && !glretrace::insideGlBeginEnd && retrace::profiling) {'
+        print r'    if (!glreplay::insideList && !glreplay::insideGlBeginEnd && replay::profiling) {'
         if profileDraw:
-            print r'        glretrace::endProfile(call, true);'
+            print r'        glreplay::endProfile(call, true);'
         else:
-            print r'        glretrace::endProfile(call, false);'
+            print r'        glreplay::endProfile(call, false);'
         print r'    }'
 
         # Error checking
         if function.name.startswith('gl'):
             # glGetError is not allowed inside glBegin/glEnd
-            print '    if (retrace::debug && !glretrace::insideGlBeginEnd && glretrace::getCurrentContext()) {'
-            print '        glretrace::checkGlError(call);'
+            print '    if (replay::debug && !glreplay::insideGlBeginEnd && glreplay::getCurrentContext()) {'
+            print '        glreplay::checkGlError(call);'
             if function.name in ('glProgramStringARB', 'glProgramStringNV'):
                 print r'        GLint error_position = -1;'
                 print r'        glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &error_position);'
                 print r'        if (error_position != -1) {'
                 print r'            const char *error_string = (const char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB);'
-                print r'            retrace::warning(call) << error_string << "\n";'
+                print r'            replay::warning(call) << error_string << "\n";'
                 print r'        }'
             if function.name == 'glCompileShader':
                 print r'        GLint compile_status = 0;'
@@ -380,7 +380,7 @@ class GlRetracer(Retracer):
                 print r'             glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &info_log_length);'
                 print r'             GLchar *infoLog = new GLchar[info_log_length];'
                 print r'             glGetShaderInfoLog(shader, info_log_length, NULL, infoLog);'
-                print r'             retrace::warning(call) << infoLog << "\n";'
+                print r'             replay::warning(call) << infoLog << "\n";'
                 print r'             delete [] infoLog;'
                 print r'        }'
             if function.name in ('glLinkProgram', 'glCreateShaderProgramv', 'glCreateShaderProgramEXT'):
@@ -393,7 +393,7 @@ class GlRetracer(Retracer):
                 print r'             glGetProgramiv(program, GL_INFO_LOG_LENGTH, &info_log_length);'
                 print r'             GLchar *infoLog = new GLchar[info_log_length];'
                 print r'             glGetProgramInfoLog(program, info_log_length, NULL, infoLog);'
-                print r'             retrace::warning(call) << infoLog << "\n";'
+                print r'             replay::warning(call) << infoLog << "\n";'
                 print r'             delete [] infoLog;'
                 print r'        }'
             if function.name == 'glCompileShaderARB':
@@ -404,7 +404,7 @@ class GlRetracer(Retracer):
                 print r'             glGetObjectParameterivARB(shaderObj, GL_OBJECT_INFO_LOG_LENGTH_ARB, &info_log_length);'
                 print r'             GLchar *infoLog = new GLchar[info_log_length];'
                 print r'             glGetInfoLogARB(shaderObj, info_log_length, NULL, infoLog);'
-                print r'             retrace::warning(call) << infoLog << "\n";'
+                print r'             replay::warning(call) << infoLog << "\n";'
                 print r'             delete [] infoLog;'
                 print r'        }'
             if function.name == 'glLinkProgramARB':
@@ -415,27 +415,27 @@ class GlRetracer(Retracer):
                 print r'             glGetObjectParameterivARB(programObj, GL_OBJECT_INFO_LOG_LENGTH_ARB, &info_log_length);'
                 print r'             GLchar *infoLog = new GLchar[info_log_length];'
                 print r'             glGetInfoLogARB(programObj, info_log_length, NULL, infoLog);'
-                print r'             retrace::warning(call) << infoLog << "\n";'
+                print r'             replay::warning(call) << infoLog << "\n";'
                 print r'             delete [] infoLog;'
                 print r'        }'
             if function.name in self.map_function_names:
                 print r'        if (!_result) {'
-                print r'             retrace::warning(call) << "failed to map buffer\n";'
+                print r'             replay::warning(call) << "failed to map buffer\n";'
                 print r'        }'
             if function.name in self.unmap_function_names and function.type is not stdapi.Void:
                 print r'        if (!_result) {'
-                print r'             retrace::warning(call) << "failed to unmap buffer\n";'
+                print r'             replay::warning(call) << "failed to unmap buffer\n";'
                 print r'        }'
             if function.name in ('glGetAttribLocation', 'glGetAttribLocationARB'):
                 print r'    GLint _origResult = call.ret->toSInt();'
                 print r'    if (_result != _origResult) {'
-                print r'        retrace::warning(call) << "vertex attrib location mismatch " << _origResult << " -> " << _result << "\n";'
+                print r'        replay::warning(call) << "vertex attrib location mismatch " << _origResult << " -> " << _result << "\n";'
                 print r'    }'
             if function.name in ('glCheckFramebufferStatus', 'glCheckFramebufferStatusEXT', 'glCheckNamedFramebufferStatusEXT'):
                 print r'    GLint _origResult = call.ret->toSInt();'
                 print r'    if (_origResult == GL_FRAMEBUFFER_COMPLETE &&'
                 print r'        _result != GL_FRAMEBUFFER_COMPLETE) {'
-                print r'        retrace::warning(call) << "incomplete framebuffer (" << glstate::enumToString(_result) << ")\n";'
+                print r'        replay::warning(call) << "incomplete framebuffer (" << glstate::enumToString(_result) << ")\n";'
                 print r'    }'
             print '    }'
 
@@ -459,7 +459,7 @@ class GlRetracer(Retracer):
 
     def extractArg(self, function, arg, arg_type, lvalue, rvalue):
         if function.name in self.array_pointer_function_names and arg.name == 'pointer':
-            print '    %s = static_cast<%s>(retrace::toPointer(%s, true));' % (lvalue, arg_type, rvalue)
+            print '    %s = static_cast<%s>(replay::toPointer(%s, true));' % (lvalue, arg_type, rvalue)
             return
 
         if function.name in self.draw_elements_function_names and arg.name == 'indices' or\
@@ -478,9 +478,9 @@ class GlRetracer(Retracer):
            and 'program' not in function.argNames():
             # Determine the active program for uniforms swizzling
             print '    GLint program = -1;'
-            print '    if (glretrace::insideList) {'
+            print '    if (glreplay::insideList) {'
             print '        // glUseProgram & glUseProgramObjectARB are display-list-able'
-            print r'    glretrace::Context *currentContext = glretrace::getCurrentContext();'
+            print r'    glreplay::Context *currentContext = glreplay::getCurrentContext();'
             print '        program = _program_map[currentContext->activeProgram];'
             print '    } else {'
             print '        GLint pipeline = 0;'
@@ -499,7 +499,7 @@ class GlRetracer(Retracer):
            and 'programObj' not in function.argNames():
             print '    GLhandleARB programObj = glGetHandleARB(GL_PROGRAM_OBJECT_ARB);'
 
-        Retracer.extractArg(self, function, arg, arg_type, lvalue, rvalue)
+        Replayer.extractArg(self, function, arg, arg_type, lvalue, rvalue)
 
         # Don't try to use more samples than the implementation supports
         if arg.name == 'samples':
@@ -522,7 +522,7 @@ if __name__ == '__main__':
 #include <string.h>
 
 #include "glproc.hpp"
-#include "glretrace.hpp"
+#include "glreplay.hpp"
 #include "glstate.hpp"
 
 
@@ -531,5 +531,5 @@ static bool _pipelineHasBeenBound = false;
     api = stdapi.API()
     api.addModule(glapi.glapi)
     api.addModule(glesapi.glesapi)
-    retracer = GlRetracer()
-    retracer.retraceApi(api)
+    replayer = GlReplayer()
+    replayer.replayApi(api)
diff --git a/retrace/glretrace_cgl.cpp b/replay/glreplay_cgl.cpp
similarity index 78%
rename from retrace/glretrace_cgl.cpp
rename to replay/glreplay_cgl.cpp
index f0d0e2d..8f06ffe 100644
--- a/retrace/glretrace_cgl.cpp
+++ b/replay/glreplay_cgl.cpp
@@ -27,8 +27,8 @@
 #include <string.h>
 
 #include "glproc.hpp"
-#include "retrace.hpp"
-#include "glretrace.hpp"
+#include "replay.hpp"
+#include "glreplay.hpp"
 
 
 #define kCGLPFAAllRenderers            1
@@ -74,7 +74,7 @@
 #define kCGLOGLPVersion_3_2_Core 0x3200
 
 
-using namespace glretrace;
+using namespace glreplay;
 
 
 typedef std::map<unsigned long long, glws::Drawable *> DrawableMap;
@@ -96,7 +96,7 @@ getDrawable(unsigned long drawable_id) {
     DrawableMap::const_iterator it;
     it = drawable_map.find(drawable_id);
     if (it == drawable_map.end()) {
-        return (drawable_map[drawable_id] = glretrace::createDrawable());
+        return (drawable_map[drawable_id] = glreplay::createDrawable());
     }
 
     return it->second;
@@ -113,7 +113,7 @@ getContext(unsigned long long ctx) {
     it = context_map.find(ctx);
     if (it == context_map.end()) {
         Context *context;
-        context_map[ctx] = context = glretrace::createContext(sharedContext);
+        context_map[ctx] = context = glreplay::createContext(sharedContext);
         if (!sharedContext) {
             sharedContext = context;
         }
@@ -124,7 +124,7 @@ getContext(unsigned long long ctx) {
 }
 
 
-static void retrace_CGLChoosePixelFormat(trace::Call &call) {
+static void replay_CGLChoosePixelFormat(trace::Call &call) {
     int profile = kCGLOGLPVersion_Legacy;
 
     const trace::Array * attribs = dynamic_cast<const trace::Array *>(&call.arg(0));
@@ -184,7 +184,7 @@ static void retrace_CGLChoosePixelFormat(trace::Call &call) {
                 break;
 
             default:
-                retrace::warning(call) << "unexpected attribute " << param << "\n";
+                replay::warning(call) << "unexpected attribute " << param << "\n";
                 break;
             }
         }
@@ -192,24 +192,24 @@ static void retrace_CGLChoosePixelFormat(trace::Call &call) {
 
     if (profile == kCGLOGLPVersion_3_2_Core) {
         // TODO: Do this on a per visual basis
-        retrace::coreProfile = true;
+        replay::coreProfile = true;
     }
 }
 
 
-static void retrace_CGLCreateContext(trace::Call &call) {
+static void replay_CGLCreateContext(trace::Call &call) {
     unsigned long long share = call.arg(1).toUIntPtr();
     Context *sharedContext = getContext(share);
 
     const trace::Array *ctx_ptr = dynamic_cast<const trace::Array *>(&call.arg(2));
     unsigned long long ctx = ctx_ptr->values[0]->toUIntPtr();
 
-    Context *context = glretrace::createContext(sharedContext);
+    Context *context = glreplay::createContext(sharedContext);
     context_map[ctx] = context;
 }
 
 
-static void retrace_CGLDestroyContext(trace::Call &call) {
+static void replay_CGLDestroyContext(trace::Call &call) {
     unsigned long long ctx = call.arg(0).toUIntPtr();
 
     ContextMap::iterator it;
@@ -224,31 +224,31 @@ static void retrace_CGLDestroyContext(trace::Call &call) {
 }
 
 
-static void retrace_CGLSetCurrentContext(trace::Call &call) {
+static void replay_CGLSetCurrentContext(trace::Call &call) {
     unsigned long long ctx = call.arg(0).toUIntPtr();
 
     glws::Drawable *new_drawable = getDrawable(ctx);
     Context *new_context = getContext(ctx);
 
-    glretrace::makeCurrent(call, new_drawable, new_context);
+    glreplay::makeCurrent(call, new_drawable, new_context);
 }
 
 
-static void retrace_CGLFlushDrawable(trace::Call &call) {
+static void replay_CGLFlushDrawable(trace::Call &call) {
     unsigned long long ctx = call.arg(0).toUIntPtr();
     Context *context = getContext(ctx);
 
     if (context) {
         if (context->drawable) {
-            if (retrace::doubleBuffer) {
+            if (replay::doubleBuffer) {
                 context->drawable->swapBuffers();
             } else {
                 glFlush();
             }
             frame_complete(call);
         } else {
-            if (retrace::debug) {
-                retrace::warning(call) << "context has no drawable\n";
+            if (replay::debug) {
+                replay::warning(call) << "context has no drawable\n";
             }
         }
     }
@@ -263,9 +263,9 @@ static void retrace_CGLFlushDrawable(trace::Call &call) {
  * See also:
  * - /System/Library/Frameworks/OpenGL.framework/Headers/CGLIOSurface.h
  */
-static void retrace_CGLTexImageIOSurface2D(trace::Call &call) {
-    if (retrace::debug) {
-        retrace::warning(call) << "external IOSurface not supported\n";
+static void replay_CGLTexImageIOSurface2D(trace::Call &call) {
+    if (replay::debug) {
+        replay::warning(call) << "external IOSurface not supported\n";
     }
 
     unsigned long long ctx = call.arg(0).toUIntPtr();
@@ -295,39 +295,39 @@ static void retrace_CGLTexImageIOSurface2D(trace::Call &call) {
 
     GLvoid * pixels = NULL;
 
-    if (glretrace::getCurrentContext() != context) {
-        if (retrace::debug) {
-            retrace::warning(call) << "current context mismatch\n";
+    if (glreplay::getCurrentContext() != context) {
+        if (replay::debug) {
+            replay::warning(call) << "current context mismatch\n";
         }
     }
 
     glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
 
-    if (retrace::debug && !glretrace::insideGlBeginEnd) {
-        glretrace::checkGlError(call);
+    if (replay::debug && !glreplay::insideGlBeginEnd) {
+        glreplay::checkGlError(call);
     }
 }
 
 
-const retrace::Entry glretrace::cgl_callbacks[] = {
-    {"CGLChoosePixelFormat", &retrace_CGLChoosePixelFormat},
-    {"CGLCreateContext", &retrace_CGLCreateContext},
-    {"CGLDestroyContext", &retrace_CGLDestroyContext},
-    {"CGLDestroyPixelFormat", &retrace::ignore},
-    {"CGLDisable", &retrace::ignore},
-    {"CGLEnable", &retrace::ignore},
-    {"CGLErrorString", &retrace::ignore},
-    {"CGLFlushDrawable", &retrace_CGLFlushDrawable},
-    {"CGLGetCurrentContext", &retrace::ignore},
-    {"CGLGetOption", &retrace::ignore},
-    {"CGLGetParameter", &retrace::ignore},
-    {"CGLGetVersion", &retrace::ignore},
-    {"CGLGetVirtualScreen", &retrace::ignore},
-    {"CGLIsEnabled", &retrace::ignore},
-    {"CGLSetCurrentContext", &retrace_CGLSetCurrentContext},
-    {"CGLSetParameter", &retrace::ignore},
-    {"CGLTexImageIOSurface2D", &retrace_CGLTexImageIOSurface2D},
-    {"CGLUpdateContext", &retrace::ignore},
+const replay::Entry glreplay::cgl_callbacks[] = {
+    {"CGLChoosePixelFormat", &replay_CGLChoosePixelFormat},
+    {"CGLCreateContext", &replay_CGLCreateContext},
+    {"CGLDestroyContext", &replay_CGLDestroyContext},
+    {"CGLDestroyPixelFormat", &replay::ignore},
+    {"CGLDisable", &replay::ignore},
+    {"CGLEnable", &replay::ignore},
+    {"CGLErrorString", &replay::ignore},
+    {"CGLFlushDrawable", &replay_CGLFlushDrawable},
+    {"CGLGetCurrentContext", &replay::ignore},
+    {"CGLGetOption", &replay::ignore},
+    {"CGLGetParameter", &replay::ignore},
+    {"CGLGetVersion", &replay::ignore},
+    {"CGLGetVirtualScreen", &replay::ignore},
+    {"CGLIsEnabled", &replay::ignore},
+    {"CGLSetCurrentContext", &replay_CGLSetCurrentContext},
+    {"CGLSetParameter", &replay::ignore},
+    {"CGLTexImageIOSurface2D", &replay_CGLTexImageIOSurface2D},
+    {"CGLUpdateContext", &replay::ignore},
     {NULL, NULL},
 };
 
diff --git a/retrace/glretrace_egl.cpp b/replay/glreplay_egl.cpp
similarity index 69%
rename from retrace/glretrace_egl.cpp
rename to replay/glreplay_egl.cpp
index 4585564..5a2575f 100644
--- a/retrace/glretrace_egl.cpp
+++ b/replay/glreplay_egl.cpp
@@ -3,7 +3,7 @@
  * Copyright 2011 LunarG, Inc.
  * All Rights Reserved.
  *
- * Based on glretrace_glx.cpp, which has
+ * Based on glreplay_glx.cpp, which has
  *
  *   Copyright 2011 Jose Fonseca
  *
@@ -29,8 +29,8 @@
 
 
 #include "glproc.hpp"
-#include "retrace.hpp"
-#include "glretrace.hpp"
+#include "replay.hpp"
+#include "glreplay.hpp"
 #include "os.hpp"
 #include "eglsize.hpp"
 
@@ -42,7 +42,7 @@
 #endif
 
 
-using namespace glretrace;
+using namespace glreplay;
 
 
 typedef std::map<unsigned long long, glws::Drawable *> DrawableMap;
@@ -103,31 +103,31 @@ static void createDrawable(unsigned long long orig_config, unsigned long long or
         profile = last_profile;
     }
 
-    glws::Drawable *drawable = glretrace::createDrawable(profile);
+    glws::Drawable *drawable = glreplay::createDrawable(profile);
     drawable_map[orig_surface] = drawable;
 }
 
-static void retrace_eglCreateWindowSurface(trace::Call &call) {
+static void replay_eglCreateWindowSurface(trace::Call &call) {
     unsigned long long orig_config = call.arg(1).toUIntPtr();
     unsigned long long orig_surface = call.ret->toUIntPtr();
     createDrawable(orig_config, orig_surface);
 }
 
-static void retrace_eglCreatePbufferSurface(trace::Call &call) {
+static void replay_eglCreatePbufferSurface(trace::Call &call) {
     unsigned long long orig_config = call.arg(1).toUIntPtr();
     unsigned long long orig_surface = call.ret->toUIntPtr();
     createDrawable(orig_config, orig_surface);
     // TODO: Respect the pbuffer dimensions too
 }
 
-static void retrace_eglDestroySurface(trace::Call &call) {
+static void replay_eglDestroySurface(trace::Call &call) {
     unsigned long long orig_surface = call.arg(1).toUIntPtr();
 
     DrawableMap::iterator it;
     it = drawable_map.find(orig_surface);
 
     if (it != drawable_map.end()) {
-        glretrace::Context *currentContext = glretrace::getCurrentContext();
+        glreplay::Context *currentContext = glreplay::getCurrentContext();
         if (!currentContext || it->second != currentContext->drawable) {
             // TODO: reference count
             delete it->second;
@@ -136,11 +136,11 @@ static void retrace_eglDestroySurface(trace::Call &call) {
     }
 }
 
-static void retrace_eglBindAPI(trace::Call &call) {
+static void replay_eglBindAPI(trace::Call &call) {
     current_api = call.arg(0).toUInt();
 }
 
-static void retrace_eglCreateContext(trace::Call &call) {
+static void replay_eglCreateContext(trace::Call &call) {
     unsigned long long orig_context = call.ret->toUIntPtr();
     unsigned long long orig_config = call.arg(1).toUIntPtr();
     Context *share_context = getContext(call.arg(2).toUIntPtr());
@@ -169,7 +169,7 @@ static void retrace_eglCreateContext(trace::Call &call) {
     }
 
 
-    Context *context = glretrace::createContext(share_context, profile);
+    Context *context = glreplay::createContext(share_context, profile);
     if (!context) {
         const char *name;
         switch (profile) {
@@ -187,7 +187,7 @@ static void retrace_eglCreateContext(trace::Call &call) {
             break;
         }
 
-        retrace::warning(call) << "Failed to create " << name << " context.\n";
+        replay::warning(call) << "Failed to create " << name << " context.\n";
         os::abort();
     }
 
@@ -196,14 +196,14 @@ static void retrace_eglCreateContext(trace::Call &call) {
     last_profile = profile;
 }
 
-static void retrace_eglDestroyContext(trace::Call &call) {
+static void replay_eglDestroyContext(trace::Call &call) {
     unsigned long long orig_context = call.arg(1).toUIntPtr();
 
     ContextMap::iterator it;
     it = context_map.find(orig_context);
 
     if (it != context_map.end()) {
-        glretrace::Context *currentContext = glretrace::getCurrentContext();
+        glreplay::Context *currentContext = glreplay::getCurrentContext();
         if (it->second != currentContext) {
             // TODO: reference count
             delete it->second;
@@ -212,20 +212,20 @@ static void retrace_eglDestroyContext(trace::Call &call) {
     }
 }
 
-static void retrace_eglMakeCurrent(trace::Call &call) {
+static void replay_eglMakeCurrent(trace::Call &call) {
     glws::Drawable *new_drawable = getDrawable(call.arg(1).toUIntPtr());
     Context *new_context = getContext(call.arg(3).toUIntPtr());
 
-    glretrace::makeCurrent(call, new_drawable, new_context);
+    glreplay::makeCurrent(call, new_drawable, new_context);
 }
 
 
-static void retrace_eglSwapBuffers(trace::Call &call) {
+static void replay_eglSwapBuffers(trace::Call &call) {
     glws::Drawable *drawable = getDrawable(call.arg(1).toUIntPtr());
 
     frame_complete(call);
 
-    if (retrace::doubleBuffer) {
+    if (replay::doubleBuffer) {
         if (drawable) {
             drawable->swapBuffers();
         }
@@ -234,43 +234,43 @@ static void retrace_eglSwapBuffers(trace::Call &call) {
     }
 }
 
-const retrace::Entry glretrace::egl_callbacks[] = {
-    {"eglGetError", &retrace::ignore},
-    {"eglGetDisplay", &retrace::ignore},
-    {"eglInitialize", &retrace::ignore},
-    {"eglTerminate", &retrace::ignore},
-    {"eglQueryString", &retrace::ignore},
-    {"eglGetConfigs", &retrace::ignore},
-    {"eglChooseConfig", &retrace::ignore},
-    {"eglGetConfigAttrib", &retrace::ignore},
-    {"eglCreateWindowSurface", &retrace_eglCreateWindowSurface},
-    {"eglCreatePbufferSurface", &retrace_eglCreatePbufferSurface},
-    //{"eglCreatePixmapSurface", &retrace::ignore},
-    {"eglDestroySurface", &retrace_eglDestroySurface},
-    {"eglQuerySurface", &retrace::ignore},
-    {"eglBindAPI", &retrace_eglBindAPI},
-    {"eglQueryAPI", &retrace::ignore},
-    //{"eglWaitClient", &retrace::ignore},
-    //{"eglReleaseThread", &retrace::ignore},
-    //{"eglCreatePbufferFromClientBuffer", &retrace::ignore},
-    //{"eglSurfaceAttrib", &retrace::ignore},
-    //{"eglBindTexImage", &retrace::ignore},
-    //{"eglReleaseTexImage", &retrace::ignore},
-    {"eglSwapInterval", &retrace::ignore},
-    {"eglCreateContext", &retrace_eglCreateContext},
-    {"eglDestroyContext", &retrace_eglDestroyContext},
-    {"eglMakeCurrent", &retrace_eglMakeCurrent},
-    {"eglGetCurrentContext", &retrace::ignore},
-    {"eglGetCurrentSurface", &retrace::ignore},
-    {"eglGetCurrentDisplay", &retrace::ignore},
-    {"eglQueryContext", &retrace::ignore},
-    {"eglWaitGL", &retrace::ignore},
-    {"eglWaitNative", &retrace::ignore},
-    {"eglSwapBuffers", &retrace_eglSwapBuffers},
-    //{"eglCopyBuffers", &retrace::ignore},
-    {"eglGetProcAddress", &retrace::ignore},
-    {"eglCreateImageKHR", &retrace::ignore},
-    {"eglDestroyImageKHR", &retrace::ignore},
-    {"glEGLImageTargetTexture2DOES", &retrace::ignore},
+const replay::Entry glreplay::egl_callbacks[] = {
+    {"eglGetError", &replay::ignore},
+    {"eglGetDisplay", &replay::ignore},
+    {"eglInitialize", &replay::ignore},
+    {"eglTerminate", &replay::ignore},
+    {"eglQueryString", &replay::ignore},
+    {"eglGetConfigs", &replay::ignore},
+    {"eglChooseConfig", &replay::ignore},
+    {"eglGetConfigAttrib", &replay::ignore},
+    {"eglCreateWindowSurface", &replay_eglCreateWindowSurface},
+    {"eglCreatePbufferSurface", &replay_eglCreatePbufferSurface},
+    //{"eglCreatePixmapSurface", &replay::ignore},
+    {"eglDestroySurface", &replay_eglDestroySurface},
+    {"eglQuerySurface", &replay::ignore},
+    {"eglBindAPI", &replay_eglBindAPI},
+    {"eglQueryAPI", &replay::ignore},
+    //{"eglWaitClient", &replay::ignore},
+    //{"eglReleaseThread", &replay::ignore},
+    //{"eglCreatePbufferFromClientBuffer", &replay::ignore},
+    //{"eglSurfaceAttrib", &replay::ignore},
+    //{"eglBindTexImage", &replay::ignore},
+    //{"eglReleaseTexImage", &replay::ignore},
+    {"eglSwapInterval", &replay::ignore},
+    {"eglCreateContext", &replay_eglCreateContext},
+    {"eglDestroyContext", &replay_eglDestroyContext},
+    {"eglMakeCurrent", &replay_eglMakeCurrent},
+    {"eglGetCurrentContext", &replay::ignore},
+    {"eglGetCurrentSurface", &replay::ignore},
+    {"eglGetCurrentDisplay", &replay::ignore},
+    {"eglQueryContext", &replay::ignore},
+    {"eglWaitGL", &replay::ignore},
+    {"eglWaitNative", &replay::ignore},
+    {"eglSwapBuffers", &replay_eglSwapBuffers},
+    //{"eglCopyBuffers", &replay::ignore},
+    {"eglGetProcAddress", &replay::ignore},
+    {"eglCreateImageKHR", &replay::ignore},
+    {"eglDestroyImageKHR", &replay::ignore},
+    {"glEGLImageTargetTexture2DOES", &replay::ignore},
     {NULL, NULL},
 };
diff --git a/replay/glreplay_glx.cpp b/replay/glreplay_glx.cpp
new file mode 100644
index 0000000..199a681
--- /dev/null
+++ b/replay/glreplay_glx.cpp
@@ -0,0 +1,258 @@
+/**************************************************************************
+ *
+ * Copyright 2011 Jose Fonseca
+ * 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.
+ *
+ **************************************************************************/
+
+
+#include "glproc.hpp"
+#include "replay.hpp"
+#include "glreplay.hpp"
+
+
+#ifndef GLX_PBUFFER_HEIGHT
+#define GLX_PBUFFER_HEIGHT 0x8040
+#endif
+
+#ifndef GLX_PBUFFER_WIDTH
+#define GLX_PBUFFER_WIDTH 0x8041
+#endif
+
+
+using namespace glreplay;
+
+
+typedef std::map<unsigned long, glws::Drawable *> DrawableMap;
+typedef std::map<unsigned long long, Context *> ContextMap;
+static DrawableMap drawable_map;
+static ContextMap context_map;
+
+
+static glws::Drawable *
+getDrawable(unsigned long drawable_id) {
+    if (drawable_id == 0) {
+        return NULL;
+    }
+
+    DrawableMap::const_iterator it;
+    it = drawable_map.find(drawable_id);
+    if (it == drawable_map.end()) {
+        return (drawable_map[drawable_id] = glreplay::createDrawable());
+    }
+
+    return it->second;
+}
+
+static Context *
+getContext(unsigned long long context_ptr) {
+    if (context_ptr == 0) {
+        return NULL;
+    }
+
+    ContextMap::const_iterator it;
+    it = context_map.find(context_ptr);
+    if (it == context_map.end()) {
+        return (context_map[context_ptr] = glreplay::createContext());
+    }
+
+    return it->second;
+}
+
+static void replay_glXCreateContext(trace::Call &call) {
+    unsigned long long orig_context = call.ret->toUIntPtr();
+    Context *share_context = getContext(call.arg(2).toUIntPtr());
+
+    Context *context = glreplay::createContext(share_context);
+    context_map[orig_context] = context;
+}
+
+static void replay_glXCreateContextAttribsARB(trace::Call &call) {
+    unsigned long long orig_context = call.ret->toUIntPtr();
+    Context *share_context = getContext(call.arg(2).toUIntPtr());
+
+    Context *context = glreplay::createContext(share_context);
+    context_map[orig_context] = context;
+}
+
+static void replay_glXMakeCurrent(trace::Call &call) {
+    glws::Drawable *new_drawable = getDrawable(call.arg(1).toUInt());
+    Context *new_context = getContext(call.arg(2).toUIntPtr());
+
+    glreplay::makeCurrent(call, new_drawable, new_context);
+}
+
+
+static void replay_glXDestroyContext(trace::Call &call) {
+    Context *context = getContext(call.arg(1).toUIntPtr());
+
+    if (!context) {
+        return;
+    }
+
+    delete context;
+}
+
+static void replay_glXSwapBuffers(trace::Call &call) {
+    glws::Drawable *drawable = getDrawable(call.arg(1).toUInt());
+
+    frame_complete(call);
+    if (replay::doubleBuffer) {
+        if (drawable) {
+            drawable->swapBuffers();
+        }
+    } else {
+        glFlush();
+    }
+}
+
+static void replay_glXCreateNewContext(trace::Call &call) {
+    unsigned long long orig_context = call.ret->toUIntPtr();
+    Context *share_context = getContext(call.arg(3).toUIntPtr());
+
+    Context *context = glreplay::createContext(share_context);
+    context_map[orig_context] = context;
+}
+
+static void replay_glXCreatePbuffer(trace::Call &call) {
+    const trace::Value *attrib_list = dynamic_cast<const trace::Array *>(&call.arg(2));
+    int width = glreplay::parseAttrib(attrib_list, GLX_PBUFFER_WIDTH, 0);
+    int height = glreplay::parseAttrib(attrib_list, GLX_PBUFFER_HEIGHT, 0);
+
+    unsigned long long orig_drawable = call.ret->toUInt();
+
+    glws::Drawable *drawable = glreplay::createPbuffer(width, height);
+    
+    drawable_map[orig_drawable] = drawable;
+}
+
+static void replay_glXDestroyPbuffer(trace::Call &call) {
+    glws::Drawable *drawable = getDrawable(call.arg(1).toUInt());
+
+    if (!drawable) {
+        return;
+    }
+
+    delete drawable;
+}
+
+static void replay_glXMakeContextCurrent(trace::Call &call) {
+    glws::Drawable *new_drawable = getDrawable(call.arg(1).toUInt());
+    Context *new_context = getContext(call.arg(3).toUIntPtr());
+
+    glreplay::makeCurrent(call, new_drawable, new_context);
+}
+
+const replay::Entry glreplay::glx_callbacks[] = {
+    //{"glXBindChannelToWindowSGIX", &replay_glXBindChannelToWindowSGIX},
+    //{"glXBindSwapBarrierNV", &replay_glXBindSwapBarrierNV},
+    //{"glXBindSwapBarrierSGIX", &replay_glXBindSwapBarrierSGIX},
+    //{"glXBindTexImageEXT", &replay_glXBindTexImageEXT},
+    //{"glXChannelRectSGIX", &replay_glXChannelRectSGIX},
+    //{"glXChannelRectSyncSGIX", &replay_glXChannelRectSyncSGIX},
+    {"glXChooseFBConfig", &replay::ignore},
+    {"glXChooseFBConfigSGIX", &replay::ignore},
+    {"glXChooseVisual", &replay::ignore},
+    //{"glXCopyContext", &replay_glXCopyContext},
+    //{"glXCopyImageSubDataNV", &replay_glXCopyImageSubDataNV},
+    //{"glXCopySubBufferMESA", &replay_glXCopySubBufferMESA},
+    {"glXCreateContextAttribsARB", &replay_glXCreateContextAttribsARB},
+    {"glXCreateContext", &replay_glXCreateContext},
+    //{"glXCreateContextWithConfigSGIX", &replay_glXCreateContextWithConfigSGIX},
+    //{"glXCreateGLXPbufferSGIX", &replay_glXCreateGLXPbufferSGIX},
+    //{"glXCreateGLXPixmap", &replay_glXCreateGLXPixmap},
+    //{"glXCreateGLXPixmapWithConfigSGIX", &replay_glXCreateGLXPixmapWithConfigSGIX},
+    {"glXCreateNewContext", &replay_glXCreateNewContext},
+    {"glXCreatePbuffer", &replay_glXCreatePbuffer},
+    //{"glXCreatePixmap", &replay_glXCreatePixmap},
+    //{"glXCreateWindow", &replay_glXCreateWindow},
+    //{"glXCushionSGI", &replay_glXCushionSGI},
+    {"glXDestroyContext", &replay_glXDestroyContext},
+    //{"glXDestroyGLXPbufferSGIX", &replay_glXDestroyGLXPbufferSGIX},
+    //{"glXDestroyGLXPixmap", &replay_glXDestroyGLXPixmap},
+    {"glXDestroyPbuffer", &replay_glXDestroyPbuffer},
+    //{"glXDestroyPixmap", &replay_glXDestroyPixmap},
+    //{"glXDestroyWindow", &replay_glXDestroyWindow},
+    //{"glXFreeContextEXT", &replay_glXFreeContextEXT},
+    {"glXGetAGPOffsetMESA", &replay::ignore},
+    {"glXGetClientString", &replay::ignore},
+    {"glXGetConfig", &replay::ignore},
+    {"glXGetContextIDEXT", &replay::ignore},
+    {"glXGetCurrentContext", &replay::ignore},
+    {"glXGetCurrentDisplayEXT", &replay::ignore},
+    {"glXGetCurrentDisplay", &replay::ignore},
+    {"glXGetCurrentDrawable", &replay::ignore},
+    {"glXGetCurrentReadDrawable", &replay::ignore},
+    {"glXGetCurrentReadDrawableSGI", &replay::ignore},
+    {"glXGetFBConfigAttrib", &replay::ignore},
+    {"glXGetFBConfigAttribSGIX", &replay::ignore},
+    {"glXGetFBConfigFromVisualSGIX", &replay::ignore},
+    {"glXGetFBConfigs", &replay::ignore},
+    {"glXGetMscRateOML", &replay::ignore},
+    {"glXGetProcAddressARB", &replay::ignore},
+    {"glXGetProcAddress", &replay::ignore},
+    {"glXGetSelectedEvent", &replay::ignore},
+    {"glXGetSelectedEventSGIX", &replay::ignore},
+    {"glXGetSwapIntervalMESA", &replay::ignore},
+    {"glXGetSyncValuesOML", &replay::ignore},
+    {"glXGetVideoSyncSGI", &replay::ignore},
+    {"glXGetVisualFromFBConfig", &replay::ignore},
+    {"glXGetVisualFromFBConfigSGIX", &replay::ignore},
+    //{"glXImportContextEXT", &replay_glXImportContextEXT},
+    {"glXIsDirect", &replay::ignore},
+    //{"glXJoinSwapGroupNV", &replay_glXJoinSwapGroupNV},
+    //{"glXJoinSwapGroupSGIX", &replay_glXJoinSwapGroupSGIX},
+    {"glXMakeContextCurrent", &replay_glXMakeContextCurrent},
+    //{"glXMakeCurrentReadSGI", &replay_glXMakeCurrentReadSGI},
+    {"glXMakeCurrent", &replay_glXMakeCurrent},
+    {"glXQueryChannelDeltasSGIX", &replay::ignore},
+    {"glXQueryChannelRectSGIX", &replay::ignore},
+    {"glXQueryContextInfoEXT", &replay::ignore},
+    {"glXQueryContext", &replay::ignore},
+    {"glXQueryDrawable", &replay::ignore},
+    {"glXQueryExtension", &replay::ignore},
+    {"glXQueryExtensionsString", &replay::ignore},
+    {"glXQueryFrameCountNV", &replay::ignore},
+    {"glXQueryGLXPbufferSGIX", &replay::ignore},
+    {"glXQueryMaxSwapBarriersSGIX", &replay::ignore},
+    {"glXQueryMaxSwapGroupsNV", &replay::ignore},
+    {"glXQueryServerString", &replay::ignore},
+    {"glXQuerySwapGroupNV", &replay::ignore},
+    {"glXQueryVersion", &replay::ignore},
+    //{"glXReleaseBuffersMESA", &replay_glXReleaseBuffersMESA},
+    //{"glXReleaseTexImageEXT", &replay_glXReleaseTexImageEXT},
+    //{"glXResetFrameCountNV", &replay_glXResetFrameCountNV},
+    //{"glXSelectEvent", &replay_glXSelectEvent},
+    //{"glXSelectEventSGIX", &replay_glXSelectEventSGIX},
+    //{"glXSet3DfxModeMESA", &replay_glXSet3DfxModeMESA},
+    //{"glXSwapBuffersMscOML", &replay_glXSwapBuffersMscOML},
+    {"glXSwapBuffers", &replay_glXSwapBuffers},
+    {"glXSwapIntervalEXT", &replay::ignore},
+    {"glXSwapIntervalSGI", &replay::ignore},
+    //{"glXUseXFont", &replay_glXUseXFont},
+    {"glXWaitForMscOML", &replay::ignore},
+    {"glXWaitForSbcOML", &replay::ignore},
+    {"glXWaitGL", &replay::ignore},
+    {"glXWaitVideoSyncSGI", &replay::ignore},
+    {"glXWaitX", &replay::ignore},
+    {NULL, NULL},
+};
+
diff --git a/retrace/glretrace_main.cpp b/replay/glreplay_main.cpp
similarity index 79%
rename from retrace/glretrace_main.cpp
rename to replay/glreplay_main.cpp
index d0298fc..d86da3d 100755
--- a/retrace/glretrace_main.cpp
+++ b/replay/glreplay_main.cpp
@@ -26,10 +26,10 @@
 
 #include <string.h>
 
-#include "retrace.hpp"
+#include "replay.hpp"
 #include "glproc.hpp"
 #include "glstate.hpp"
-#include "glretrace.hpp"
+#include "glreplay.hpp"
 #include "os_time.hpp"
 
 /* Synchronous debug output may reduce performance however,
@@ -38,7 +38,7 @@
  */
 #define DEBUG_OUTPUT_SYNCHRONOUS 0
 
-namespace glretrace {
+namespace glreplay {
 
 bool insideList = false;
 bool insideGlBeginEnd = false;
@@ -75,7 +75,7 @@ void
 checkGlError(trace::Call &call) {
     GLenum error = glGetError();
     while (error != GL_NO_ERROR) {
-        std::ostream & os = retrace::warning(call);
+        std::ostream & os = replay::warning(call);
 
         os << "glGetError(";
         os << call.name();
@@ -118,7 +118,7 @@ checkGlError(trace::Call &call) {
 
 static inline int64_t
 getCurrentTime(void) {
-    if (retrace::profilingGpuTimes && supportsTimestamp) {
+    if (replay::profilingGpuTimes && supportsTimestamp) {
         /* Get the current GL time without stalling */
         GLint64 timestamp = 0;
         glGetInteger64v(GL_TIMESTAMP, &timestamp);
@@ -130,7 +130,7 @@ getCurrentTime(void) {
 
 static inline int64_t
 getTimeFrequency(void) {
-    if (retrace::profilingGpuTimes && supportsTimestamp) {
+    if (replay::profilingGpuTimes && supportsTimestamp) {
         return 1000000000;
     } else {
         return os::timeFrequency;
@@ -143,7 +143,7 @@ completeCallQuery(CallQuery& query) {
     int64_t gpuStart = 0, gpuDuration = 0, cpuDuration = 0, pixels = 0;
 
     if (query.isDraw) {
-        if (retrace::profilingGpuTimes) {
+        if (replay::profilingGpuTimes) {
             if (supportsTimestamp) {
                 glGetQueryObjecti64vEXT(query.ids[GPU_START], GL_QUERY_RESULT, &gpuStart);
             }
@@ -151,7 +151,7 @@ completeCallQuery(CallQuery& query) {
             glGetQueryObjecti64vEXT(query.ids[GPU_DURATION], GL_QUERY_RESULT, &gpuDuration);
         }
 
-        if (retrace::profilingPixelsDrawn) {
+        if (replay::profilingPixelsDrawn) {
             glGetQueryObjecti64vEXT(query.ids[OCCLUSION], GL_QUERY_RESULT, &pixels);
         }
 
@@ -159,14 +159,14 @@ completeCallQuery(CallQuery& query) {
         pixels = -1;
     }
 
-    if (retrace::profilingCpuTimes) {
+    if (replay::profilingCpuTimes) {
         cpuDuration = query.cpuEnd - query.cpuStart;
     }
 
     glDeleteQueries(NUM_QUERIES, query.ids);
 
     /* Add call to profile */
-    retrace::profiler.addCall(query.call, query.sig->name, query.program, pixels, gpuStart, gpuDuration, query.cpuStart, cpuDuration);
+    replay::profiler.addCall(query.call, query.sig->name, query.program, pixels, gpuStart, gpuDuration, query.cpuStart, cpuDuration);
 }
 
 void
@@ -180,7 +180,7 @@ flushQueries() {
 
 void
 beginProfile(trace::Call &call, bool isDraw) {
-    glretrace::Context *currentContext = glretrace::getCurrentContext();
+    glreplay::Context *currentContext = glreplay::getCurrentContext();
 
     /* Create call query */
     CallQuery query;
@@ -193,7 +193,7 @@ beginProfile(trace::Call &call, bool isDraw) {
 
     /* GPU profiling only for draw calls */
     if (isDraw) {
-        if (retrace::profilingGpuTimes) {
+        if (replay::profilingGpuTimes) {
             if (supportsTimestamp) {
                 glQueryCounter(query.ids[GPU_START], GL_TIMESTAMP);
             }
@@ -201,7 +201,7 @@ beginProfile(trace::Call &call, bool isDraw) {
             glBeginQuery(GL_TIME_ELAPSED, query.ids[GPU_DURATION]);
         }
 
-        if (retrace::profilingPixelsDrawn) {
+        if (replay::profilingPixelsDrawn) {
             glBeginQuery(GL_SAMPLES_PASSED, query.ids[OCCLUSION]);
         }
     }
@@ -209,7 +209,7 @@ beginProfile(trace::Call &call, bool isDraw) {
     callQueries.push_back(query);
 
     /* CPU profiling for all calls */
-    if (retrace::profilingCpuTimes) {
+    if (replay::profilingCpuTimes) {
         CallQuery& query = callQueries.back();
         query.cpuStart = getCurrentTime();
     }
@@ -219,18 +219,18 @@ void
 endProfile(trace::Call &call, bool isDraw) {
 
     /* CPU profiling for all calls */
-    if (retrace::profilingCpuTimes) {
+    if (replay::profilingCpuTimes) {
         CallQuery& query = callQueries.back();
         query.cpuEnd = getCurrentTime();
     }
 
     /* GPU profiling only for draw calls */
     if (isDraw) {
-        if (retrace::profilingGpuTimes) {
+        if (replay::profilingGpuTimes) {
             glEndQuery(GL_TIME_ELAPSED);
         }
 
-        if (retrace::profilingPixelsDrawn) {
+        if (replay::profilingPixelsDrawn) {
             glEndQuery(GL_SAMPLES_PASSED);
         }
     }
@@ -238,7 +238,7 @@ endProfile(trace::Call &call, bool isDraw) {
 
 void
 initContext() {
-    glretrace::Context *currentContext = glretrace::getCurrentContext();
+    glreplay::Context *currentContext = glreplay::getCurrentContext();
 
     /* Ensure we have adequate extension support */
     assert(currentContext);
@@ -248,7 +248,7 @@ initContext() {
     supportsDebugOutput = currentContext->hasExtension("GL_ARB_debug_output");
 
     /* Check for timer query support */
-    if (retrace::profilingGpuTimes) {
+    if (replay::profilingGpuTimes) {
         if (!supportsTimestamp && !supportsElapsed) {
             std::cout << "Error: Cannot run profile, GL_EXT_timer_query extension is not supported." << std::endl;
             exit(-1);
@@ -264,14 +264,14 @@ initContext() {
     }
 
     /* Check for occlusion query support */
-    if (retrace::profilingPixelsDrawn && !supportsOcclusion) {
+    if (replay::profilingPixelsDrawn && !supportsOcclusion) {
         std::cout << "Error: Cannot run profile, GL_ARB_occlusion_query extension is not supported." << std::endl;
         exit(-1);
     }
 
     /* Setup debug message call back */
-    if (retrace::debug && supportsDebugOutput) {
-        glretrace::Context *currentContext = glretrace::getCurrentContext();
+    if (replay::debug && supportsDebugOutput) {
+        glreplay::Context *currentContext = glreplay::getCurrentContext();
         glDebugMessageCallbackARB(&debugOutputCallback, currentContext);
 
         if (DEBUG_OUTPUT_SYNCHRONOUS) {
@@ -280,35 +280,35 @@ initContext() {
     }
 
     /* Sync the gpu and cpu start times */
-    if (retrace::profilingCpuTimes || retrace::profilingGpuTimes) {
-        if (!retrace::profiler.hasBaseTimes()) {
+    if (replay::profilingCpuTimes || replay::profilingGpuTimes) {
+        if (!replay::profiler.hasBaseTimes()) {
             GLint64 currentTime = getCurrentTime();
-            retrace::profiler.setBaseCpuTime(currentTime);
-            retrace::profiler.setBaseGpuTime(currentTime);
+            replay::profiler.setBaseCpuTime(currentTime);
+            replay::profiler.setBaseGpuTime(currentTime);
         }
     }
 }
 
 void
 frame_complete(trace::Call &call) {
-    if (retrace::profiling) {
+    if (replay::profiling) {
         /* Complete any remaining queries */
         flushQueries();
 
         /* Indicate end of current frame */
-        retrace::profiler.addFrameEnd();
+        replay::profiler.addFrameEnd();
     }
 
-    retrace::frameComplete(call);
+    replay::frameComplete(call);
 
-    glretrace::Context *currentContext = glretrace::getCurrentContext();
+    glreplay::Context *currentContext = glreplay::getCurrentContext();
     if (!currentContext) {
         return;
     }
 
     assert(currentContext->drawable);
-    if (retrace::debug && !currentContext->drawable->visible) {
-        retrace::warning(call) << "could not infer drawable size (glViewport never called)\n";
+    if (replay::debug && !currentContext->drawable->visible) {
+        replay::warning(call) << "could not infer drawable size (glViewport never called)\n";
     }
 }
 
@@ -366,7 +366,7 @@ getDebugOutputSeverity(GLenum severity) {
 
 static void APIENTRY
 debugOutputCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam) {
-    std::cerr << retrace::callNo << ": ";
+    std::cerr << replay::callNo << ": ";
     std::cerr << "glDebugOutputCallback: ";
     std::cerr << getDebugOutputSeverity(severity) << " severity ";
     std::cerr << getDebugOutputSource(source) << " " << getDebugOutputType(type);
@@ -375,14 +375,14 @@ debugOutputCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsi
     std::cerr << std::endl;
 }
 
-} /* namespace glretrace */
+} /* namespace glreplay */
 
 
-class GLDumper : public retrace::Dumper {
+class GLDumper : public replay::Dumper {
 public:
     image::Image *
     getSnapshot(void) {
-        if (!glretrace::getCurrentContext()) {
+        if (!glreplay::getCurrentContext()) {
             return NULL;
         }
         return glstate::getDrawBufferImage();
@@ -390,8 +390,8 @@ public:
 
     bool
     dumpState(std::ostream &os) {
-        glretrace::Context *currentContext = glretrace::getCurrentContext();
-        if (glretrace::insideGlBeginEnd ||
+        glreplay::Context *currentContext = glreplay::getCurrentContext();
+        if (glreplay::insideGlBeginEnd ||
             !currentContext) {
             return false;
         }
@@ -404,40 +404,40 @@ static GLDumper glDumper;
 
 
 void
-retrace::setUp(void) {
+replay::setUp(void) {
     glws::init();
     dumper = &glDumper;
 }
 
 
 void
-retrace::addCallbacks(retrace::Retracer &retracer)
+replay::addCallbacks(replay::Replayer &replayer)
 {
-    retracer.addCallbacks(glretrace::gl_callbacks);
-    retracer.addCallbacks(glretrace::glx_callbacks);
-    retracer.addCallbacks(glretrace::wgl_callbacks);
-    retracer.addCallbacks(glretrace::cgl_callbacks);
-    retracer.addCallbacks(glretrace::egl_callbacks);
+    replayer.addCallbacks(glreplay::gl_callbacks);
+    replayer.addCallbacks(glreplay::glx_callbacks);
+    replayer.addCallbacks(glreplay::wgl_callbacks);
+    replayer.addCallbacks(glreplay::cgl_callbacks);
+    replayer.addCallbacks(glreplay::egl_callbacks);
 }
 
 
 void
-retrace::flushRendering(void) {
-    glretrace::Context *currentContext = glretrace::getCurrentContext();
+replay::flushRendering(void) {
+    glreplay::Context *currentContext = glreplay::getCurrentContext();
     if (currentContext) {
-        glretrace::flushQueries();
+        glreplay::flushQueries();
         glFlush();
     }
 }
 
 void
-retrace::waitForInput(void) {
+replay::waitForInput(void) {
     while (glws::processEvents()) {
         os::sleep(100*1000);
     }
 }
 
 void
-retrace::cleanUp(void) {
+replay::cleanUp(void) {
     glws::cleanup();
 }
diff --git a/replay/glreplay_wgl.cpp b/replay/glreplay_wgl.cpp
new file mode 100644
index 0000000..751f246
--- /dev/null
+++ b/replay/glreplay_wgl.cpp
@@ -0,0 +1,311 @@
+/**************************************************************************
+ *
+ * Copyright 2011 Jose Fonseca
+ * 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.
+ *
+ **************************************************************************/
+
+
+#include "glproc.hpp"
+#include "replay.hpp"
+#include "glreplay.hpp"
+
+
+using namespace glreplay;
+
+
+typedef std::map<unsigned long long, glws::Drawable *> DrawableMap;
+typedef std::map<unsigned long long, Context *> ContextMap;
+static DrawableMap drawable_map;
+static DrawableMap pbuffer_map;
+static ContextMap context_map;
+
+
+static glws::Drawable *
+getDrawable(unsigned long long hdc) {
+    if (hdc == 0) {
+        return NULL;
+    }
+
+    DrawableMap::const_iterator it;
+    it = drawable_map.find(hdc);
+    if (it == drawable_map.end()) {
+        return (drawable_map[hdc] = glreplay::createDrawable());
+    }
+
+    return it->second;
+}
+
+static void replay_wglCreateContext(trace::Call &call) {
+    unsigned long long orig_context = call.ret->toUIntPtr();
+    Context *context = glreplay::createContext();
+    context_map[orig_context] = context;
+}
+
+static void replay_wglDeleteContext(trace::Call &call) {
+    unsigned long long hglrc = call.arg(0).toUIntPtr();
+
+    ContextMap::iterator it;
+    it = context_map.find(hglrc);
+    if (it == context_map.end()) {
+        return;
+    }
+
+    delete it->second;
+    
+    context_map.erase(it);
+}
+
+static void replay_wglMakeCurrent(trace::Call &call) {
+    glws::Drawable *new_drawable = getDrawable(call.arg(0).toUIntPtr());
+    Context *new_context = context_map[call.arg(1).toUIntPtr()];
+
+    glreplay::makeCurrent(call, new_drawable, new_context);
+}
+
+static void replay_wglCopyContext(trace::Call &call) {
+}
+
+static void replay_wglChoosePixelFormat(trace::Call &call) {
+}
+
+static void replay_wglDescribePixelFormat(trace::Call &call) {
+}
+
+static void replay_wglSetPixelFormat(trace::Call &call) {
+}
+
+static void replay_wglSwapBuffers(trace::Call &call) {
+    glws::Drawable *drawable = getDrawable(call.arg(0).toUIntPtr());
+
+    frame_complete(call);
+    if (replay::doubleBuffer) {
+        if (drawable) {
+            drawable->swapBuffers();
+        } else {
+            glreplay::Context *currentContext = glreplay::getCurrentContext();
+            if (currentContext) {
+                currentContext->drawable->swapBuffers();
+            }
+        }
+    } else {
+        glFlush();
+    }
+}
+
+static void replay_wglShareLists(trace::Call &call) {
+    unsigned long long hglrc1 = call.arg(0).toUIntPtr();
+    unsigned long long hglrc2 = call.arg(1).toUIntPtr();
+
+    Context *share_context = context_map[hglrc1];
+    Context *old_context = context_map[hglrc2];
+
+    Context *new_context = glreplay::createContext(share_context);
+    if (new_context) {
+        glreplay::Context *currentContext = glreplay::getCurrentContext();
+        if (currentContext == old_context) {
+            glreplay::makeCurrent(call, currentContext->drawable, new_context);
+        }
+
+        context_map[hglrc2] = new_context;
+        
+        delete old_context;
+    }
+}
+
+static void replay_wglCreateLayerContext(trace::Call &call) {
+    replay_wglCreateContext(call);
+}
+
+static void replay_wglDescribeLayerPlane(trace::Call &call) {
+}
+
+static void replay_wglSetLayerPaletteEntries(trace::Call &call) {
+}
+
+static void replay_wglRealizeLayerPalette(trace::Call &call) {
+}
+
+static void replay_wglSwapLayerBuffers(trace::Call &call) {
+    replay_wglSwapBuffers(call);
+}
+
+static void replay_wglUseFontBitmapsA(trace::Call &call) {
+}
+
+static void replay_wglUseFontBitmapsW(trace::Call &call) {
+}
+
+static void replay_wglSwapMultipleBuffers(trace::Call &call) {
+}
+
+static void replay_wglUseFontOutlinesA(trace::Call &call) {
+}
+
+static void replay_wglUseFontOutlinesW(trace::Call &call) {
+}
+
+static void replay_wglCreateBufferRegionARB(trace::Call &call) {
+}
+
+static void replay_wglDeleteBufferRegionARB(trace::Call &call) {
+}
+
+static void replay_wglSaveBufferRegionARB(trace::Call &call) {
+}
+
+static void replay_wglRestoreBufferRegionARB(trace::Call &call) {
+}
+
+static void replay_wglChoosePixelFormatARB(trace::Call &call) {
+}
+
+static void replay_wglMakeContextCurrentARB(trace::Call &call) {
+}
+
+static void replay_wglCreatePbufferARB(trace::Call &call) {
+    int iWidth = call.arg(2).toUInt();
+    int iHeight = call.arg(3).toUInt();
+
+    unsigned long long orig_pbuffer = call.ret->toUIntPtr();
+    glws::Drawable *drawable = glreplay::createPbuffer(iWidth, iHeight);
+
+    pbuffer_map[orig_pbuffer] = drawable;
+}
+
+static void replay_wglGetPbufferDCARB(trace::Call &call) {
+    glws::Drawable *pbuffer = pbuffer_map[call.arg(0).toUIntPtr()];
+
+    unsigned long long orig_hdc = call.ret->toUIntPtr();
+
+    drawable_map[orig_hdc] = pbuffer;
+}
+
+static void replay_wglReleasePbufferDCARB(trace::Call &call) {
+}
+
+static void replay_wglDestroyPbufferARB(trace::Call &call) {
+}
+
+static void replay_wglQueryPbufferARB(trace::Call &call) {
+}
+
+static void replay_wglBindTexImageARB(trace::Call &call) {
+}
+
+static void replay_wglReleaseTexImageARB(trace::Call &call) {
+}
+
+static void replay_wglSetPbufferAttribARB(trace::Call &call) {
+}
+
+static void replay_wglCreateContextAttribsARB(trace::Call &call) {
+    unsigned long long orig_context = call.ret->toUIntPtr();
+    Context *share_context = NULL;
+
+    if (call.arg(1).toPointer()) {
+        share_context = context_map[call.arg(1).toUIntPtr()];
+    }
+
+    Context *context = glreplay::createContext(share_context);
+    context_map[orig_context] = context;
+}
+
+static void replay_wglMakeContextCurrentEXT(trace::Call &call) {
+}
+
+static void replay_wglChoosePixelFormatEXT(trace::Call &call) {
+}
+
+static void replay_wglSwapIntervalEXT(trace::Call &call) {
+}
+
+static void replay_wglAllocateMemoryNV(trace::Call &call) {
+}
+
+static void replay_wglFreeMemoryNV(trace::Call &call) {
+}
+
+static void replay_glAddSwapHintRectWIN(trace::Call &call) {
+}
+
+static void replay_wglGetProcAddress(trace::Call &call) {
+}
+
+const replay::Entry glreplay::wgl_callbacks[] = {
+    {"glAddSwapHintRectWIN", &replay_glAddSwapHintRectWIN},
+    {"wglAllocateMemoryNV", &replay_wglAllocateMemoryNV},
+    {"wglBindTexImageARB", &replay_wglBindTexImageARB},
+    {"wglChoosePixelFormat", &replay_wglChoosePixelFormat},
+    {"wglChoosePixelFormatARB", &replay_wglChoosePixelFormatARB},
+    {"wglChoosePixelFormatEXT", &replay_wglChoosePixelFormatEXT},
+    {"wglCopyContext", &replay_wglCopyContext},
+    {"wglCreateBufferRegionARB", &replay_wglCreateBufferRegionARB},
+    {"wglCreateContext", &replay_wglCreateContext},
+    {"wglCreateContextAttribsARB", &replay_wglCreateContextAttribsARB},
+    {"wglCreateLayerContext", &replay_wglCreateLayerContext},
+    {"wglCreatePbufferARB", &replay_wglCreatePbufferARB},
+    {"wglDeleteBufferRegionARB", &replay_wglDeleteBufferRegionARB},
+    {"wglDeleteContext", &replay_wglDeleteContext},
+    {"wglDescribeLayerPlane", &replay_wglDescribeLayerPlane},
+    {"wglDescribePixelFormat", &replay_wglDescribePixelFormat},
+    {"wglDestroyPbufferARB", &replay_wglDestroyPbufferARB},
+    {"wglFreeMemoryNV", &replay_wglFreeMemoryNV},
+    {"wglGetCurrentContext", &replay::ignore},
+    {"wglGetCurrentDC", &replay::ignore},
+    {"wglGetCurrentReadDCARB", &replay::ignore},
+    {"wglGetCurrentReadDCEXT", &replay::ignore},
+    {"wglGetDefaultProcAddress", &replay::ignore},
+    {"wglGetExtensionsStringARB", &replay::ignore},
+    {"wglGetExtensionsStringEXT", &replay::ignore},
+    {"wglGetLayerPaletteEntries", &replay::ignore},
+    {"wglGetPbufferDCARB", &replay_wglGetPbufferDCARB},
+    {"wglGetPixelFormat", &replay::ignore},
+    {"wglGetPixelFormatAttribfvARB", &replay::ignore},
+    {"wglGetPixelFormatAttribfvEXT", &replay::ignore},
+    {"wglGetPixelFormatAttribivARB", &replay::ignore},
+    {"wglGetPixelFormatAttribivEXT", &replay::ignore},
+    {"wglGetProcAddress", &replay_wglGetProcAddress},
+    {"wglGetSwapIntervalEXT", &replay::ignore},
+    {"wglMakeContextCurrentARB", &replay_wglMakeContextCurrentARB},
+    {"wglMakeContextCurrentEXT", &replay_wglMakeContextCurrentEXT},
+    {"wglMakeCurrent", &replay_wglMakeCurrent},
+    {"wglQueryPbufferARB", &replay_wglQueryPbufferARB},
+    {"wglRealizeLayerPalette", &replay_wglRealizeLayerPalette},
+    {"wglReleasePbufferDCARB", &replay_wglReleasePbufferDCARB},
+    {"wglReleaseTexImageARB", &replay_wglReleaseTexImageARB},
+    {"wglRestoreBufferRegionARB", &replay_wglRestoreBufferRegionARB},
+    {"wglSaveBufferRegionARB", &replay_wglSaveBufferRegionARB},
+    {"wglSetLayerPaletteEntries", &replay_wglSetLayerPaletteEntries},
+    {"wglSetPbufferAttribARB", &replay_wglSetPbufferAttribARB},
+    {"wglSetPixelFormat", &replay_wglSetPixelFormat},
+    {"wglShareLists", &replay_wglShareLists},
+    {"wglSwapBuffers", &replay_wglSwapBuffers},
+    {"wglSwapIntervalEXT", &replay_wglSwapIntervalEXT},
+    {"wglSwapLayerBuffers", &replay_wglSwapLayerBuffers},
+    {"wglSwapMultipleBuffers", &replay_wglSwapMultipleBuffers},
+    {"wglUseFontBitmapsA", &replay_wglUseFontBitmapsA},
+    {"wglUseFontBitmapsW", &replay_wglUseFontBitmapsW},
+    {"wglUseFontOutlinesA", &replay_wglUseFontOutlinesA},
+    {"wglUseFontOutlinesW", &replay_wglUseFontOutlinesW},
+    {NULL, NULL}
+};
+
diff --git a/retrace/glretrace_ws.cpp b/replay/glreplay_ws.cpp
similarity index 95%
rename from retrace/glretrace_ws.cpp
rename to replay/glreplay_ws.cpp
index ac03fcc..516e6ad 100644
--- a/retrace/glretrace_ws.cpp
+++ b/replay/glreplay_ws.cpp
@@ -25,20 +25,20 @@
 
 
 /**
- * Window system helpers for glretrace.
+ * Window system helpers for glreplay.
  */
 
 
 #include <string.h>
 
 #include "os_thread.hpp"
-#include "retrace.hpp"
+#include "replay.hpp"
 #include "glproc.hpp"
 #include "glstate.hpp"
-#include "glretrace.hpp"
+#include "glreplay.hpp"
 
 
-namespace glretrace {
+namespace glreplay {
 
 
 static glws::Visual *
@@ -49,7 +49,7 @@ inline glws::Visual *
 getVisual(glws::Profile profile) {
     glws::Visual * & visual = visuals[profile];
     if (!visual) {
-        visual = glws::createVisual(retrace::doubleBuffer, profile);
+        visual = glws::createVisual(replay::doubleBuffer, profile);
         if (!visual) {
             std::cerr << "error: failed to create OpenGL visual\n";
             exit(1);
@@ -62,7 +62,7 @@ getVisual(glws::Profile profile) {
 inline glws::Profile
 getDefaultProfile(void)
 {
-    if (retrace::coreProfile) {
+    if (replay::coreProfile) {
         return glws::PROFILE_CORE;
     } else {
         return glws::PROFILE_COMPAT;
@@ -105,7 +105,7 @@ Context *
 createContext(Context *shareContext, glws::Profile profile) {
     glws::Visual *visual = getVisual(profile);
     glws::Context *shareWsContext = shareContext ? shareContext->wsContext : NULL;
-    glws::Context *ctx = glws::createContext(visual, shareWsContext, profile, retrace::debug);
+    glws::Context *ctx = glws::createContext(visual, shareWsContext, profile, replay::debug);
     if (!ctx) {
         std::cerr << "error: failed to create OpenGL context\n";
         exit(1);
@@ -147,7 +147,7 @@ makeCurrent(trace::Call &call, glws::Drawable *drawable, Context *context)
 
     if (currentContext) {
         glFlush();
-        if (!retrace::doubleBuffer) {
+        if (!replay::doubleBuffer) {
             frame_complete(call);
         }
     }
@@ -250,4 +250,4 @@ parseAttrib(const trace::Value *attribs, int param, int default_ = 0) {
 }
 
 
-} /* namespace glretrace */
+} /* namespace glreplay */
diff --git a/retrace/glstate.cpp b/replay/glstate.cpp
similarity index 100%
rename from retrace/glstate.cpp
rename to replay/glstate.cpp
diff --git a/retrace/glstate.hpp b/replay/glstate.hpp
similarity index 100%
rename from retrace/glstate.hpp
rename to replay/glstate.hpp
diff --git a/retrace/glstate_images.cpp b/replay/glstate_images.cpp
similarity index 100%
rename from retrace/glstate_images.cpp
rename to replay/glstate_images.cpp
diff --git a/retrace/glstate_internal.hpp b/replay/glstate_internal.hpp
similarity index 100%
rename from retrace/glstate_internal.hpp
rename to replay/glstate_internal.hpp
diff --git a/retrace/glstate_params.py b/replay/glstate_params.py
similarity index 99%
rename from retrace/glstate_params.py
rename to replay/glstate_params.py
index 50693a9..3937add 100644
--- a/retrace/glstate_params.py
+++ b/replay/glstate_params.py
@@ -27,7 +27,7 @@
 '''Generate code to dump most GL state into JSON.'''
 
 
-import retrace # to adjust sys.path
+import replay # to adjust sys.path
 
 from specs.stdapi import *
 
diff --git a/retrace/glstate_shaders.cpp b/replay/glstate_shaders.cpp
similarity index 100%
rename from retrace/glstate_shaders.cpp
rename to replay/glstate_shaders.cpp
diff --git a/retrace/glws.cpp b/replay/glws.cpp
similarity index 100%
rename from retrace/glws.cpp
rename to replay/glws.cpp
diff --git a/retrace/glws.hpp b/replay/glws.hpp
similarity index 100%
rename from retrace/glws.hpp
rename to replay/glws.hpp
diff --git a/retrace/glws_cocoa.mm b/replay/glws_cocoa.mm
similarity index 99%
rename from retrace/glws_cocoa.mm
rename to replay/glws_cocoa.mm
index e410862..3324887 100644
--- a/retrace/glws_cocoa.mm
+++ b/replay/glws_cocoa.mm
@@ -123,7 +123,7 @@ public:
         assert(view != nil);
 
         [window setContentView:view];
-        [window setTitle:@"glretrace"];
+        [window setTitle:@"glreplay"];
 
     }
 
@@ -192,7 +192,7 @@ initThread(void) {
 
 void
 init(void) {
-    // Prevent glproc to load system's OpenGL, so that we can trace glretrace.
+    // Prevent glproc to load system's OpenGL, so that we can trace glreplay.
     _libGlHandle = dlopen("OpenGL", RTLD_LOCAL | RTLD_NOW | RTLD_FIRST);
 
     initThread();
diff --git a/retrace/glws_egl_xlib.cpp b/replay/glws_egl_xlib.cpp
similarity index 99%
rename from retrace/glws_egl_xlib.cpp
rename to replay/glws_egl_xlib.cpp
index 5aacdfe..3fa8c78 100644
--- a/retrace/glws_egl_xlib.cpp
+++ b/replay/glws_egl_xlib.cpp
@@ -130,7 +130,7 @@ public:
         sizehints.flags = USSize | USPosition;
         XSetNormalHints(display, window, &sizehints);
 
-        const char *name = "glretrace";
+        const char *name = "glreplay";
         XSetStandardProperties(
             display, window, name, name,
             None, (char **)NULL, 0, &sizehints);
diff --git a/retrace/glws_glx.cpp b/replay/glws_glx.cpp
similarity index 99%
rename from retrace/glws_glx.cpp
rename to replay/glws_glx.cpp
index 1494d06..e285375 100644
--- a/retrace/glws_glx.cpp
+++ b/replay/glws_glx.cpp
@@ -141,7 +141,7 @@ public:
         sizehints.flags = USSize | USPosition;
         XSetNormalHints(display, window, &sizehints);
 
-        const char *name = "glretrace";
+        const char *name = "glreplay";
         XSetStandardProperties(
             display, window, name, name,
             None, (char **)NULL, 0, &sizehints);
diff --git a/retrace/glws_wgl.cpp b/replay/glws_wgl.cpp
similarity index 98%
rename from retrace/glws_wgl.cpp
rename to replay/glws_wgl.cpp
index de6c7d6..cdddaff 100644
--- a/retrace/glws_wgl.cpp
+++ b/replay/glws_wgl.cpp
@@ -114,7 +114,7 @@ public:
             wc.hCursor = LoadCursor(NULL, IDC_ARROW);
             wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
             wc.lpfnWndProc = WndProc;
-            wc.lpszClassName = "glretrace";
+            wc.lpszClassName = "glreplay";
             wc.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW;
             RegisterClass(&wc);
             first = FALSE;
@@ -133,7 +133,7 @@ public:
         AdjustWindowRectEx(&rect, dwStyle, FALSE, dwExStyle);
 
         hWnd = CreateWindowEx(dwExStyle,
-                              "glretrace", /* wc.lpszClassName */
+                              "glreplay", /* wc.lpszClassName */
                               NULL,
                               dwStyle,
                               0, /* x */
diff --git a/retrace/json.cpp b/replay/json.cpp
similarity index 100%
rename from retrace/json.cpp
rename to replay/json.cpp
diff --git a/retrace/json.hpp b/replay/json.hpp
similarity index 100%
rename from retrace/json.hpp
rename to replay/json.hpp
diff --git a/retrace/retrace.cpp b/replay/replay.cpp
similarity index 92%
rename from retrace/retrace.cpp
rename to replay/replay.cpp
index ee876ca..f2f6b32 100644
--- a/retrace/retrace.cpp
+++ b/replay/replay.cpp
@@ -29,10 +29,10 @@
 
 #include "os_time.hpp"
 #include "trace_dump.hpp"
-#include "retrace.hpp"
+#include "replay.hpp"
 
 
-namespace retrace {
+namespace replay {
 
 
 static bool call_dumped = false;
@@ -66,21 +66,21 @@ void unsupported(trace::Call &call) {
     warning(call) << "unsupported " << call.name() << " call\n";
 }
 
-inline void Retracer::addCallback(const Entry *entry) {
+inline void Replayer::addCallback(const Entry *entry) {
     assert(entry->name);
     assert(entry->callback);
     map[entry->name] = entry->callback;
 }
 
 
-void Retracer::addCallbacks(const Entry *entries) {
+void Replayer::addCallbacks(const Entry *entries) {
     while (entries->name && entries->callback) {
         addCallback(entries++);
     }
 }
 
 
-void Retracer::retrace(trace::Call &call) {
+void Replayer::replay(trace::Call &call) {
     call_dumped = false;
 
     Callback callback = 0;
@@ -118,4 +118,4 @@ void Retracer::retrace(trace::Call &call) {
 }
 
 
-} /* namespace retrace */
+} /* namespace replay */
diff --git a/retrace/retrace.hpp b/replay/replay.hpp
similarity index 93%
rename from retrace/retrace.hpp
rename to replay/replay.hpp
index 7c8dcd5..f4e24b3 100644
--- a/retrace/retrace.hpp
+++ b/replay/replay.hpp
@@ -23,8 +23,8 @@
  *
  **************************************************************************/
 
-#ifndef _RETRACE_HPP_
-#define _RETRACE_HPP_
+#ifndef _REPLAY_HPP_
+#define _REPLAY_HPP_
 
 #include <assert.h>
 #include <string.h>
@@ -45,7 +45,7 @@ namespace image {
 }
 
 
-namespace retrace {
+namespace replay {
 
 
 extern trace::Parser parser;
@@ -143,7 +143,7 @@ struct stringComparer {
 extern const Entry stdc_callbacks[];
 
 
-class Retracer
+class Replayer
 {
     typedef std::map<const char *, Callback, stringComparer> Map;
     Map map;
@@ -151,16 +151,16 @@ class Retracer
     std::vector<Callback> callbacks;
 
 public:
-    Retracer() {
+    Replayer() {
         addCallbacks(stdc_callbacks);
     }
 
-    virtual ~Retracer() {}
+    virtual ~Replayer() {}
 
     void addCallback(const Entry *entry);
     void addCallbacks(const Entry *entries);
 
-    void retrace(trace::Call &call);
+    void replay(trace::Call &call);
 };
 
 
@@ -186,7 +186,7 @@ void
 setUp(void);
 
 void
-addCallbacks(retrace::Retracer &retracer);
+addCallbacks(replay::Replayer &replayer);
 
 void
 frameComplete(trace::Call &call);
@@ -203,6 +203,6 @@ void
 cleanUp(void);
 
 
-} /* namespace retrace */
+} /* namespace replay */
 
-#endif /* _RETRACE_HPP_ */
+#endif /* _REPLAY_HPP_ */
diff --git a/retrace/retrace.py b/replay/replay.py
similarity index 86%
rename from retrace/retrace.py
rename to replay/replay.py
index cd5ef1d..3c540a5 100644
--- a/retrace/retrace.py
+++ b/replay/replay.py
@@ -151,10 +151,10 @@ class ValueDeserializer(stdapi.Visitor, stdapi.ExpanderMixin):
         print '    %s = static_cast<%s>((%s).toPointer());' % (lvalue, pointer, rvalue)
 
     def visitObjPointer(self, pointer, lvalue, rvalue):
-        print '    %s = static_cast<%s>(retrace::toObjPointer(call, %s));' % (lvalue, pointer, rvalue)
+        print '    %s = static_cast<%s>(replay::toObjPointer(call, %s));' % (lvalue, pointer, rvalue)
 
     def visitLinearPointer(self, pointer, lvalue, rvalue):
-        print '    %s = static_cast<%s>(retrace::toPointer(%s));' % (lvalue, pointer, rvalue)
+        print '    %s = static_cast<%s>(replay::toPointer(%s));' % (lvalue, pointer, rvalue)
 
     def visitReference(self, reference, lvalue, rvalue):
         self.visit(reference.type, lvalue, rvalue);
@@ -163,7 +163,7 @@ class ValueDeserializer(stdapi.Visitor, stdapi.ExpanderMixin):
         #OpaqueValueDeserializer().visit(handle.type, lvalue, rvalue);
         self.visit(handle.type, lvalue, rvalue);
         new_lvalue = lookupHandle(handle, lvalue)
-        print '    if (retrace::verbosity >= 2) {'
+        print '    if (replay::verbosity >= 2) {'
         print '        std::cout << "%s " << size_t(%s) << " <- " << size_t(%s) << "\\n";' % (handle.name, lvalue, new_lvalue)
         print '    }'
         print '    %s = %s;' % (lvalue, new_lvalue)
@@ -204,7 +204,7 @@ class ValueDeserializer(stdapi.Visitor, stdapi.ExpanderMixin):
                 print r'        break;'
             if polymorphic.defaultType is None:
                 print r'    default:'
-                print r'        retrace::warning(call) << "unexpected polymorphic case" << %s << "\n";' % (switchExpr,)
+                print r'        replay::warning(call) << "unexpected polymorphic case" << %s << "\n";' % (switchExpr,)
                 print r'        break;'
             print r'    }'
         else:
@@ -217,11 +217,11 @@ class ValueDeserializer(stdapi.Visitor, stdapi.ExpanderMixin):
 class OpaqueValueDeserializer(ValueDeserializer):
     '''Value extractor that also understands opaque values.
 
-    Normally opaque values can't be retraced, unless they are being extracted
+    Normally opaque values can't be replayd, unless they are being extracted
     in the context of handles.'''
 
     def visitOpaque(self, opaque, lvalue, rvalue):
-        print '    %s = static_cast<%s>(retrace::toPointer(%s));' % (lvalue, opaque, rvalue)
+        print '    %s = static_cast<%s>(replay::toPointer(%s));' % (lvalue, opaque, rvalue)
 
 
 class SwizzledValueRegistrator(stdapi.Visitor, stdapi.ExpanderMixin):
@@ -264,12 +264,12 @@ class SwizzledValueRegistrator(stdapi.Visitor, stdapi.ExpanderMixin):
         pass
     
     def visitObjPointer(self, pointer, lvalue, rvalue):
-        print r'    retrace::addObj(call, %s, %s);' % (rvalue, lvalue)
+        print r'    replay::addObj(call, %s, %s);' % (rvalue, lvalue)
     
     def visitLinearPointer(self, pointer, lvalue, rvalue):
         assert pointer.size is not None
         if pointer.size is not None:
-            print r'    retrace::addRegion((%s).toUIntPtr(), %s, %s);' % (rvalue, lvalue, pointer.size)
+            print r'    replay::addRegion((%s).toUIntPtr(), %s, %s);' % (rvalue, lvalue, pointer.size)
 
     def visitReference(self, reference, lvalue, rvalue):
         pass
@@ -281,7 +281,7 @@ class SwizzledValueRegistrator(stdapi.Visitor, stdapi.ExpanderMixin):
             rvalue = "_origResult"
             entry = lookupHandle(handle, rvalue) 
             print "    %s = %s;" % (entry, lvalue)
-            print '    if (retrace::verbosity >= 2) {'
+            print '    if (replay::verbosity >= 2) {'
             print '        std::cout << "{handle.name} " << {rvalue} << " -> " << {lvalue} << "\\n";'.format(**locals())
             print '    }'
         else:
@@ -291,7 +291,7 @@ class SwizzledValueRegistrator(stdapi.Visitor, stdapi.ExpanderMixin):
             entry = lookupHandle(handle, rvalue) 
             print '    for ({handle.type} {i} = 0; {i} < {handle.range}; ++{i}) {{'.format(**locals())
             print '        {entry} = {lvalue};'.format(**locals())
-            print '        if (retrace::verbosity >= 2) {'
+            print '        if (replay::verbosity >= 2) {'
             print '            std::cout << "{handle.name} " << ({rvalue}) << " -> " << ({lvalue}) << "\\n";'.format(**locals())
             print '        }'
             print '    }'
@@ -323,21 +323,21 @@ class SwizzledValueRegistrator(stdapi.Visitor, stdapi.ExpanderMixin):
         pass
 
 
-class Retracer:
+class Replayer:
 
-    def retraceFunction(self, function):
-        print 'static void retrace_%s(trace::Call &call) {' % function.name
-        self.retraceFunctionBody(function)
+    def replayFunction(self, function):
+        print 'static void replay_%s(trace::Call &call) {' % function.name
+        self.replayFunctionBody(function)
         print '}'
         print
 
-    def retraceInterfaceMethod(self, interface, method):
-        print 'static void retrace_%s__%s(trace::Call &call) {' % (interface.name, method.name)
-        self.retraceInterfaceMethodBody(interface, method)
+    def replayInterfaceMethod(self, interface, method):
+        print 'static void replay_%s__%s(trace::Call &call) {' % (interface.name, method.name)
+        self.replayInterfaceMethodBody(interface, method)
         print '}'
         print
 
-    def retraceFunctionBody(self, function):
+    def replayFunctionBody(self, function):
         assert function.sideeffects
 
         if function.type is not stdapi.Void:
@@ -350,7 +350,7 @@ class Retracer:
 
         self.swizzleValues(function)
 
-    def retraceInterfaceMethodBody(self, interface, method):
+    def replayInterfaceMethodBody(self, interface, method):
         assert method.sideeffects
 
         if method.type is not stdapi.Void:
@@ -379,13 +379,13 @@ class Retracer:
 
     def deserializeThisPointer(self, interface):
         print r'    %s *_this;' % (interface.name,)
-        print r'    _this = static_cast<%s *>(retrace::toObjPointer(call, call.arg(0)));' % (interface.name,)
+        print r'    _this = static_cast<%s *>(replay::toObjPointer(call, call.arg(0)));' % (interface.name,)
         print r'    if (!_this) {'
         print r'        return;'
         print r'    }'
 
     def deserializeArgs(self, function):
-        print '    retrace::ScopedAllocator _allocator;'
+        print '    replay::ScopedAllocator _allocator;'
         print '    (void)_allocator;'
         success = True
         for arg in function.args:
@@ -426,8 +426,8 @@ class Retracer:
                 print '    // XXX: result'
 
     def failFunction(self, function):
-        print '    if (retrace::verbosity >= 0) {'
-        print '        retrace::unsupported(call);'
+        print '    if (replay::verbosity >= 0) {'
+        print '        replay::unsupported(call);'
         print '    }'
         print '    return;'
 
@@ -467,7 +467,7 @@ class Retracer:
             print '    if (call.ret->toUInt()) {'
             print '        return;'
             print '    }'
-            print '    retrace::delObj(call.arg(0));'
+            print '    replay::delObj(call.arg(0));'
 
         arg_names = ", ".join(method.argNames())
         if method.type is not stdapi.Void:
@@ -480,20 +480,20 @@ class Retracer:
     def checkResult(self, resultType):
         if str(resultType) == 'HRESULT':
             print r'    if (FAILED(_result)) {'
-            print r'        retrace::warning(call) << "failed\n";'
+            print r'        replay::warning(call) << "failed\n";'
             print r'    }'
 
     def filterFunction(self, function):
         return True
 
-    table_name = 'retrace::callbacks'
+    table_name = 'replay::callbacks'
 
-    def retraceApi(self, api):
+    def replayApi(self, api):
 
         print '#include "os_time.hpp"'
         print '#include "trace_parser.hpp"'
-        print '#include "retrace.hpp"'
-        print '#include "retrace_swizzle.hpp"'
+        print '#include "replay.hpp"'
+        print '#include "replay_swizzle.hpp"'
         print
 
         types = api.getAllTypes()
@@ -502,36 +502,36 @@ class Retracer:
         for handle in handles:
             if handle.name not in handle_names:
                 if handle.key is None:
-                    print 'static retrace::map<%s> _%s_map;' % (handle.type, handle.name)
+                    print 'static replay::map<%s> _%s_map;' % (handle.type, handle.name)
                 else:
                     key_name, key_type = handle.key
-                    print 'static std::map<%s, retrace::map<%s> > _%s_map;' % (key_type, handle.type, handle.name)
+                    print 'static std::map<%s, replay::map<%s> > _%s_map;' % (key_type, handle.type, handle.name)
                 handle_names.add(handle.name)
         print
 
         functions = filter(self.filterFunction, api.getAllFunctions())
         for function in functions:
             if function.sideeffects and not function.internal:
-                self.retraceFunction(function)
+                self.replayFunction(function)
         interfaces = api.getAllInterfaces()
         for interface in interfaces:
             for method in interface.iterMethods():
                 if method.sideeffects and not method.internal:
-                    self.retraceInterfaceMethod(interface, method)
+                    self.replayInterfaceMethod(interface, method)
 
-        print 'const retrace::Entry %s[] = {' % self.table_name
+        print 'const replay::Entry %s[] = {' % self.table_name
         for function in functions:
             if not function.internal:
                 if function.sideeffects:
-                    print '    {"%s", &retrace_%s},' % (function.name, function.name)
+                    print '    {"%s", &replay_%s},' % (function.name, function.name)
                 else:
-                    print '    {"%s", &retrace::ignore},' % (function.name,)
+                    print '    {"%s", &replay::ignore},' % (function.name,)
         for interface in interfaces:
             for method in interface.iterMethods():                
                 if method.sideeffects:
-                    print '    {"%s::%s", &retrace_%s__%s},' % (interface.name, method.name, interface.name, method.name)
+                    print '    {"%s::%s", &replay_%s__%s},' % (interface.name, method.name, interface.name, method.name)
                 else:
-                    print '    {"%s::%s", &retrace::ignore},' % (interface.name, method.name)
+                    print '    {"%s::%s", &replay::ignore},' % (interface.name, method.name)
         print '    {NULL, NULL}'
         print '};'
         print
diff --git a/retrace/retrace_main.cpp b/replay/replay_main.cpp
similarity index 90%
rename from retrace/retrace_main.cpp
rename to replay/replay_main.cpp
index ca03745..1e1c7b0 100644
--- a/retrace/retrace_main.cpp
+++ b/replay/replay_main.cpp
@@ -36,7 +36,7 @@
 #include "trace_callset.hpp"
 #include "trace_dump.hpp"
 #include "trace_option.hpp"
-#include "retrace.hpp"
+#include "replay.hpp"
 
 
 static bool waitOnFinish = false;
@@ -48,10 +48,10 @@ static trace::CallSet compareFrequency;
 
 static unsigned dumpStateCallNo = ~0;
 
-retrace::Retracer retracer;
+replay::Replayer replayer;
 
 
-namespace retrace {
+namespace replay {
 
 
 trace::Parser parser;
@@ -106,7 +106,7 @@ takeSnapshot(unsigned call_no) {
         if (!ref) {
             return;
         }
-        if (retrace::verbosity >= 0) {
+        if (replay::verbosity >= 0) {
             std::cout << "Read " << filename << "\n";
         }
     }
@@ -127,7 +127,7 @@ takeSnapshot(unsigned call_no) {
             os::String filename = os::String::format("%s%010u.png",
                                                      snapshotPrefix,
                                                      useCallNos ? call_no : snapshot_no);
-            if (src->writePNG(filename) && retrace::verbosity >= 0) {
+            if (src->writePNG(filename) && replay::verbosity >= 0) {
                 std::cout << "Wrote " << filename << "\n";
             }
         }
@@ -147,13 +147,13 @@ takeSnapshot(unsigned call_no) {
 
 
 /**
- * Retrace one call.
+ * Replay one call.
  *
  * Take snapshots before/after retracing (as appropriate) and dispatch it to
  * the respective handler.
  */
 static void
-retraceCall(trace::Call *call) {
+replayCall(trace::Call *call) {
     bool swapRenderTarget = call->flags &
         trace::CALL_FLAG_SWAP_RENDERTARGET;
     bool doSnapshot = snapshotFrequency.contains(*call) ||
@@ -174,7 +174,7 @@ retraceCall(trace::Call *call) {
     }
 
     callNo = call->no;
-    retracer.retrace(*call);
+    replayer.replay(*call);
 
     if (doSnapshot && !swapRenderTarget)
         takeSnapshot(call->no);
@@ -309,7 +309,7 @@ public:
         do {
             assert(call);
             assert(call->thread_id == leg);
-            retraceCall(call);
+            replayCall(call);
             delete call;
             call = parser.parse_call();
         } while (call && call->thread_id == leg);
@@ -473,7 +473,7 @@ RelayRace::stopRunners(void) {
 
 static void
 mainLoop() {
-    addCallbacks(retracer);
+    addCallbacks(replayer);
 
     long long startTime = 0; 
     frameNo = 0;
@@ -486,7 +486,7 @@ mainLoop() {
     long long endTime = os::getTime();
     float timeInterval = (endTime - startTime) * (1.0 / os::timeFrequency);
 
-    if ((retrace::verbosity >= -1) || (retrace::profiling)) {
+    if ((replay::verbosity >= -1) || (replay::profiling)) {
         std::cout << 
             "Rendered " << frameNo << " frames"
             " in " <<  timeInterval << " secs,"
@@ -501,7 +501,7 @@ mainLoop() {
 }
 
 
-} /* namespace retrace */
+} /* namespace replay */
 
 
 static void
@@ -567,14 +567,14 @@ longOptions[] = {
 
 static void exceptionCallback(void)
 {
-    std::cerr << retrace::callNo << ": error: caught an unhandled exception\n";
+    std::cerr << replay::callNo << ": error: caught an unhandled exception\n";
 }
 
 
 extern "C"
 int main(int argc, char **argv)
 {
-    using namespace retrace;
+    using namespace replay;
     int i;
 
     assert(compareFrequency.empty());
@@ -587,8 +587,8 @@ int main(int argc, char **argv)
             usage(argv[0]);
             return 0;
         case 'b':
-            retrace::debug = false;
-            retrace::verbosity = -1;
+            replay::debug = false;
+            replay::verbosity = -1;
             break;
         case CALL_NOS_OPT:
             useCallNos = trace::boolOption(optarg);
@@ -608,13 +608,13 @@ int main(int argc, char **argv)
         case 'D':
             dumpStateCallNo = atoi(optarg);
             dumpingState = true;
-            retrace::verbosity = -2;
+            replay::verbosity = -2;
             break;
         case CORE_OPT:
-            retrace::coreProfile = true;
+            replay::coreProfile = true;
             break;
         case DB_OPT:
-            retrace::doubleBuffer = true;
+            replay::doubleBuffer = true;
             break;
         case DRIVER_OPT:
             if (strcasecmp(optarg, "hw") == 0) {
@@ -631,7 +631,7 @@ int main(int argc, char **argv)
             }
             break;
         case SB_OPT:
-            retrace::doubleBuffer = false;
+            replay::doubleBuffer = false;
             break;
         case 's':
             snapshotPrefix = optarg;
@@ -640,7 +640,7 @@ int main(int argc, char **argv)
             }
             if (snapshotPrefix[0] == '-' && snapshotPrefix[1] == 0) {
                 os::setBinaryMode(stdout);
-                retrace::verbosity = -2;
+                replay::verbosity = -2;
             }
             break;
         case 'S':
@@ -650,31 +650,31 @@ int main(int argc, char **argv)
             }
             break;
         case 'v':
-            ++retrace::verbosity;
+            ++replay::verbosity;
             break;
         case 'w':
             waitOnFinish = true;
             break;
         case PGPU_OPT:
-            retrace::debug = false;
-            retrace::profiling = true;
-            retrace::verbosity = -1;
+            replay::debug = false;
+            replay::profiling = true;
+            replay::verbosity = -1;
 
-            retrace::profilingGpuTimes = true;
+            replay::profilingGpuTimes = true;
             break;
         case PCPU_OPT:
-            retrace::debug = false;
-            retrace::profiling = true;
-            retrace::verbosity = -1;
+            replay::debug = false;
+            replay::profiling = true;
+            replay::verbosity = -1;
 
-            retrace::profilingCpuTimes = true;
+            replay::profilingCpuTimes = true;
             break;
         case PPD_OPT:
-            retrace::debug = false;
-            retrace::profiling = true;
-            retrace::verbosity = -1;
+            replay::debug = false;
+            replay::profiling = true;
+            replay::verbosity = -1;
 
-            retrace::profilingPixelsDrawn = true;
+            replay::profilingPixelsDrawn = true;
             break;
         default:
             std::cerr << "error: unknown option " << opt << "\n";
@@ -683,27 +683,27 @@ int main(int argc, char **argv)
         }
     }
 
-    retrace::setUp();
-    if (retrace::profiling) {
-        retrace::profiler.setup(retrace::profilingCpuTimes, retrace::profilingGpuTimes, retrace::profilingPixelsDrawn);
+    replay::setUp();
+    if (replay::profiling) {
+        replay::profiler.setup(replay::profilingCpuTimes, replay::profilingGpuTimes, replay::profilingPixelsDrawn);
     }
 
     os::setExceptionCallback(exceptionCallback);
 
     for (i = optind; i < argc; ++i) {
-        if (!retrace::parser.open(argv[i])) {
+        if (!replay::parser.open(argv[i])) {
             return 1;
         }
 
-        retrace::mainLoop();
+        replay::mainLoop();
 
-        retrace::parser.close();
+        replay::parser.close();
     }
     
     os::resetExceptionCallback();
 
     // XXX: X often hangs on XCloseDisplay
-    //retrace::cleanUp();
+    //replay::cleanUp();
 
     return 0;
 }
diff --git a/retrace/retrace_stdc.cpp b/replay/replay_stdc.cpp
similarity index 81%
rename from retrace/retrace_stdc.cpp
rename to replay/replay_stdc.cpp
index dd4d0f4..b524dea 100644
--- a/retrace/retrace_stdc.cpp
+++ b/replay/replay_stdc.cpp
@@ -29,11 +29,11 @@
 
 #include <iostream>
 
-#include "retrace.hpp"
-#include "retrace_swizzle.hpp"
+#include "replay.hpp"
+#include "replay_swizzle.hpp"
 
 
-static void retrace_malloc(trace::Call &call) {
+static void replay_malloc(trace::Call &call) {
     size_t size = call.arg(0).toUInt();
     unsigned long long address = call.ret->toUIntPtr();
 
@@ -47,13 +47,13 @@ static void retrace_malloc(trace::Call &call) {
         return;
     }
 
-    retrace::addRegion(address, buffer, size);
+    replay::addRegion(address, buffer, size);
 }
 
 
-static void retrace_memcpy(trace::Call &call) {
-    void * dest = retrace::toPointer(call.arg(0));
-    void * src  = retrace::toPointer(call.arg(1));
+static void replay_memcpy(trace::Call &call) {
+    void * dest = replay::toPointer(call.arg(0));
+    void * src  = replay::toPointer(call.arg(1));
     size_t n    = call.arg(2).toUInt();
 
     if (!dest || !src || !n) {
@@ -64,8 +64,8 @@ static void retrace_memcpy(trace::Call &call) {
 }
 
 
-const retrace::Entry retrace::stdc_callbacks[] = {
-    {"malloc", &retrace_malloc},
-    {"memcpy", &retrace_memcpy},
+const replay::Entry replay::stdc_callbacks[] = {
+    {"malloc", &replay_malloc},
+    {"memcpy", &replay_memcpy},
     {NULL, NULL}
 };
diff --git a/retrace/retrace_swizzle.cpp b/replay/replay_swizzle.cpp
similarity index 96%
rename from retrace/retrace_swizzle.cpp
rename to replay/replay_swizzle.cpp
index 2045f6b..87ea6f2 100644
--- a/retrace/retrace_swizzle.cpp
+++ b/replay/replay_swizzle.cpp
@@ -28,11 +28,11 @@
 
 #include <string.h>
 
-#include "retrace.hpp"
-#include "retrace_swizzle.hpp"
+#include "replay.hpp"
+#include "replay_swizzle.hpp"
 
 
-namespace retrace {
+namespace replay {
 
 
 struct Region
@@ -101,7 +101,7 @@ upperBound(unsigned long long address) {
 void
 addRegion(unsigned long long address, void *buffer, unsigned long long size)
 {
-    if (retrace::verbosity >= 2) {
+    if (replay::verbosity >= 2) {
         std::cout
             << "region "
             << std::hex
@@ -190,7 +190,7 @@ lookupAddress(unsigned long long address) {
         assert(offset < it->second.size);
         void *addr = (char *)it->second.buffer + offset;
 
-        if (retrace::verbosity >= 2) {
+        if (replay::verbosity >= 2) {
             std::cout
                 << "region "
                 << std::hex
@@ -204,7 +204,7 @@ lookupAddress(unsigned long long address) {
         return addr;
     }
 
-    if (retrace::debug && address >= 64 * 1024 * 1024) {
+    if (replay::debug && address >= 64 * 1024 * 1024) {
         /* Likely not an offset, but an address that should had been swizzled */
         std::cerr << "warning: passing high address 0x" << std::hex << address << std::dec << " as uintptr_t\n";
     }
@@ -271,7 +271,7 @@ addObj(trace::Call &call, trace::Value &value, void *obj) {
 
     _obj_map[address] = obj;
     
-    if (retrace::verbosity >= 2) {
+    if (replay::verbosity >= 2) {
         std::cout << std::hex << "obj 0x" << address << " -> 0x" << size_t(obj) << std::dec << "\n";
     }
 }
@@ -296,7 +296,7 @@ toObjPointer(trace::Call &call, trace::Value &value) {
         obj = NULL;
     }
 
-    if (retrace::verbosity >= 2) {
+    if (replay::verbosity >= 2) {
         std::cout << std::hex << "obj 0x" << address << " <- 0x" << size_t(obj) << std::dec << "\n";
     }
 
@@ -304,4 +304,4 @@ toObjPointer(trace::Call &call, trace::Value &value) {
 }
 
 
-} /* retrace */
+} /* replay */
diff --git a/retrace/retrace_swizzle.hpp b/replay/replay_swizzle.hpp
similarity index 95%
rename from retrace/retrace_swizzle.hpp
rename to replay/replay_swizzle.hpp
index 42e5bf6..e5edcd3 100644
--- a/retrace/retrace_swizzle.hpp
+++ b/replay/replay_swizzle.hpp
@@ -23,8 +23,8 @@
  *
  **************************************************************************/
 
-#ifndef _RETRACE_SWIZZLE_HPP_
-#define _RETRACE_SWIZZLE_HPP_
+#ifndef _REPLAY_SWIZZLE_HPP_
+#define _REPLAY_SWIZZLE_HPP_
 
 
 #include <map>
@@ -32,7 +32,7 @@
 #include "trace_model.hpp"
 
 
-namespace retrace {
+namespace replay {
 
 
 /**
@@ -97,6 +97,6 @@ void *
 toObjPointer(trace::Call &call, trace::Value &value);
 
 
-} /* namespace retrace */
+} /* namespace replay */
 
-#endif /* _RETRACE_SWIZZLE_HPP_ */
+#endif /* _REPLAY_SWIZZLE_HPP_ */
diff --git a/retrace/scoped_allocator.hpp b/replay/scoped_allocator.hpp
similarity index 100%
rename from retrace/scoped_allocator.hpp
rename to replay/scoped_allocator.hpp
diff --git a/retrace/.gitignore b/retrace/.gitignore
deleted file mode 100644
index 978f7a3..0000000
--- a/retrace/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-d3dretrace_d3d9.cpp
-d3dretrace_dxgi.cpp
-glretrace_gl.cpp
-glstate_params.cpp
diff --git a/retrace/glretrace_glx.cpp b/retrace/glretrace_glx.cpp
deleted file mode 100644
index 4ab3d67..0000000
--- a/retrace/glretrace_glx.cpp
+++ /dev/null
@@ -1,258 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2011 Jose Fonseca
- * 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.
- *
- **************************************************************************/
-
-
-#include "glproc.hpp"
-#include "retrace.hpp"
-#include "glretrace.hpp"
-
-
-#ifndef GLX_PBUFFER_HEIGHT
-#define GLX_PBUFFER_HEIGHT 0x8040
-#endif
-
-#ifndef GLX_PBUFFER_WIDTH
-#define GLX_PBUFFER_WIDTH 0x8041
-#endif
-
-
-using namespace glretrace;
-
-
-typedef std::map<unsigned long, glws::Drawable *> DrawableMap;
-typedef std::map<unsigned long long, Context *> ContextMap;
-static DrawableMap drawable_map;
-static ContextMap context_map;
-
-
-static glws::Drawable *
-getDrawable(unsigned long drawable_id) {
-    if (drawable_id == 0) {
-        return NULL;
-    }
-
-    DrawableMap::const_iterator it;
-    it = drawable_map.find(drawable_id);
-    if (it == drawable_map.end()) {
-        return (drawable_map[drawable_id] = glretrace::createDrawable());
-    }
-
-    return it->second;
-}
-
-static Context *
-getContext(unsigned long long context_ptr) {
-    if (context_ptr == 0) {
-        return NULL;
-    }
-
-    ContextMap::const_iterator it;
-    it = context_map.find(context_ptr);
-    if (it == context_map.end()) {
-        return (context_map[context_ptr] = glretrace::createContext());
-    }
-
-    return it->second;
-}
-
-static void retrace_glXCreateContext(trace::Call &call) {
-    unsigned long long orig_context = call.ret->toUIntPtr();
-    Context *share_context = getContext(call.arg(2).toUIntPtr());
-
-    Context *context = glretrace::createContext(share_context);
-    context_map[orig_context] = context;
-}
-
-static void retrace_glXCreateContextAttribsARB(trace::Call &call) {
-    unsigned long long orig_context = call.ret->toUIntPtr();
-    Context *share_context = getContext(call.arg(2).toUIntPtr());
-
-    Context *context = glretrace::createContext(share_context);
-    context_map[orig_context] = context;
-}
-
-static void retrace_glXMakeCurrent(trace::Call &call) {
-    glws::Drawable *new_drawable = getDrawable(call.arg(1).toUInt());
-    Context *new_context = getContext(call.arg(2).toUIntPtr());
-
-    glretrace::makeCurrent(call, new_drawable, new_context);
-}
-
-
-static void retrace_glXDestroyContext(trace::Call &call) {
-    Context *context = getContext(call.arg(1).toUIntPtr());
-
-    if (!context) {
-        return;
-    }
-
-    delete context;
-}
-
-static void retrace_glXSwapBuffers(trace::Call &call) {
-    glws::Drawable *drawable = getDrawable(call.arg(1).toUInt());
-
-    frame_complete(call);
-    if (retrace::doubleBuffer) {
-        if (drawable) {
-            drawable->swapBuffers();
-        }
-    } else {
-        glFlush();
-    }
-}
-
-static void retrace_glXCreateNewContext(trace::Call &call) {
-    unsigned long long orig_context = call.ret->toUIntPtr();
-    Context *share_context = getContext(call.arg(3).toUIntPtr());
-
-    Context *context = glretrace::createContext(share_context);
-    context_map[orig_context] = context;
-}
-
-static void retrace_glXCreatePbuffer(trace::Call &call) {
-    const trace::Value *attrib_list = dynamic_cast<const trace::Array *>(&call.arg(2));
-    int width = glretrace::parseAttrib(attrib_list, GLX_PBUFFER_WIDTH, 0);
-    int height = glretrace::parseAttrib(attrib_list, GLX_PBUFFER_HEIGHT, 0);
-
-    unsigned long long orig_drawable = call.ret->toUInt();
-
-    glws::Drawable *drawable = glretrace::createPbuffer(width, height);
-    
-    drawable_map[orig_drawable] = drawable;
-}
-
-static void retrace_glXDestroyPbuffer(trace::Call &call) {
-    glws::Drawable *drawable = getDrawable(call.arg(1).toUInt());
-
-    if (!drawable) {
-        return;
-    }
-
-    delete drawable;
-}
-
-static void retrace_glXMakeContextCurrent(trace::Call &call) {
-    glws::Drawable *new_drawable = getDrawable(call.arg(1).toUInt());
-    Context *new_context = getContext(call.arg(3).toUIntPtr());
-
-    glretrace::makeCurrent(call, new_drawable, new_context);
-}
-
-const retrace::Entry glretrace::glx_callbacks[] = {
-    //{"glXBindChannelToWindowSGIX", &retrace_glXBindChannelToWindowSGIX},
-    //{"glXBindSwapBarrierNV", &retrace_glXBindSwapBarrierNV},
-    //{"glXBindSwapBarrierSGIX", &retrace_glXBindSwapBarrierSGIX},
-    //{"glXBindTexImageEXT", &retrace_glXBindTexImageEXT},
-    //{"glXChannelRectSGIX", &retrace_glXChannelRectSGIX},
-    //{"glXChannelRectSyncSGIX", &retrace_glXChannelRectSyncSGIX},
-    {"glXChooseFBConfig", &retrace::ignore},
-    {"glXChooseFBConfigSGIX", &retrace::ignore},
-    {"glXChooseVisual", &retrace::ignore},
-    //{"glXCopyContext", &retrace_glXCopyContext},
-    //{"glXCopyImageSubDataNV", &retrace_glXCopyImageSubDataNV},
-    //{"glXCopySubBufferMESA", &retrace_glXCopySubBufferMESA},
-    {"glXCreateContextAttribsARB", &retrace_glXCreateContextAttribsARB},
-    {"glXCreateContext", &retrace_glXCreateContext},
-    //{"glXCreateContextWithConfigSGIX", &retrace_glXCreateContextWithConfigSGIX},
-    //{"glXCreateGLXPbufferSGIX", &retrace_glXCreateGLXPbufferSGIX},
-    //{"glXCreateGLXPixmap", &retrace_glXCreateGLXPixmap},
-    //{"glXCreateGLXPixmapWithConfigSGIX", &retrace_glXCreateGLXPixmapWithConfigSGIX},
-    {"glXCreateNewContext", &retrace_glXCreateNewContext},
-    {"glXCreatePbuffer", &retrace_glXCreatePbuffer},
-    //{"glXCreatePixmap", &retrace_glXCreatePixmap},
-    //{"glXCreateWindow", &retrace_glXCreateWindow},
-    //{"glXCushionSGI", &retrace_glXCushionSGI},
-    {"glXDestroyContext", &retrace_glXDestroyContext},
-    //{"glXDestroyGLXPbufferSGIX", &retrace_glXDestroyGLXPbufferSGIX},
-    //{"glXDestroyGLXPixmap", &retrace_glXDestroyGLXPixmap},
-    {"glXDestroyPbuffer", &retrace_glXDestroyPbuffer},
-    //{"glXDestroyPixmap", &retrace_glXDestroyPixmap},
-    //{"glXDestroyWindow", &retrace_glXDestroyWindow},
-    //{"glXFreeContextEXT", &retrace_glXFreeContextEXT},
-    {"glXGetAGPOffsetMESA", &retrace::ignore},
-    {"glXGetClientString", &retrace::ignore},
-    {"glXGetConfig", &retrace::ignore},
-    {"glXGetContextIDEXT", &retrace::ignore},
-    {"glXGetCurrentContext", &retrace::ignore},
-    {"glXGetCurrentDisplayEXT", &retrace::ignore},
-    {"glXGetCurrentDisplay", &retrace::ignore},
-    {"glXGetCurrentDrawable", &retrace::ignore},
-    {"glXGetCurrentReadDrawable", &retrace::ignore},
-    {"glXGetCurrentReadDrawableSGI", &retrace::ignore},
-    {"glXGetFBConfigAttrib", &retrace::ignore},
-    {"glXGetFBConfigAttribSGIX", &retrace::ignore},
-    {"glXGetFBConfigFromVisualSGIX", &retrace::ignore},
-    {"glXGetFBConfigs", &retrace::ignore},
-    {"glXGetMscRateOML", &retrace::ignore},
-    {"glXGetProcAddressARB", &retrace::ignore},
-    {"glXGetProcAddress", &retrace::ignore},
-    {"glXGetSelectedEvent", &retrace::ignore},
-    {"glXGetSelectedEventSGIX", &retrace::ignore},
-    {"glXGetSwapIntervalMESA", &retrace::ignore},
-    {"glXGetSyncValuesOML", &retrace::ignore},
-    {"glXGetVideoSyncSGI", &retrace::ignore},
-    {"glXGetVisualFromFBConfig", &retrace::ignore},
-    {"glXGetVisualFromFBConfigSGIX", &retrace::ignore},
-    //{"glXImportContextEXT", &retrace_glXImportContextEXT},
-    {"glXIsDirect", &retrace::ignore},
-    //{"glXJoinSwapGroupNV", &retrace_glXJoinSwapGroupNV},
-    //{"glXJoinSwapGroupSGIX", &retrace_glXJoinSwapGroupSGIX},
-    {"glXMakeContextCurrent", &retrace_glXMakeContextCurrent},
-    //{"glXMakeCurrentReadSGI", &retrace_glXMakeCurrentReadSGI},
-    {"glXMakeCurrent", &retrace_glXMakeCurrent},
-    {"glXQueryChannelDeltasSGIX", &retrace::ignore},
-    {"glXQueryChannelRectSGIX", &retrace::ignore},
-    {"glXQueryContextInfoEXT", &retrace::ignore},
-    {"glXQueryContext", &retrace::ignore},
-    {"glXQueryDrawable", &retrace::ignore},
-    {"glXQueryExtension", &retrace::ignore},
-    {"glXQueryExtensionsString", &retrace::ignore},
-    {"glXQueryFrameCountNV", &retrace::ignore},
-    {"glXQueryGLXPbufferSGIX", &retrace::ignore},
-    {"glXQueryMaxSwapBarriersSGIX", &retrace::ignore},
-    {"glXQueryMaxSwapGroupsNV", &retrace::ignore},
-    {"glXQueryServerString", &retrace::ignore},
-    {"glXQuerySwapGroupNV", &retrace::ignore},
-    {"glXQueryVersion", &retrace::ignore},
-    //{"glXReleaseBuffersMESA", &retrace_glXReleaseBuffersMESA},
-    //{"glXReleaseTexImageEXT", &retrace_glXReleaseTexImageEXT},
-    //{"glXResetFrameCountNV", &retrace_glXResetFrameCountNV},
-    //{"glXSelectEvent", &retrace_glXSelectEvent},
-    //{"glXSelectEventSGIX", &retrace_glXSelectEventSGIX},
-    //{"glXSet3DfxModeMESA", &retrace_glXSet3DfxModeMESA},
-    //{"glXSwapBuffersMscOML", &retrace_glXSwapBuffersMscOML},
-    {"glXSwapBuffers", &retrace_glXSwapBuffers},
-    {"glXSwapIntervalEXT", &retrace::ignore},
-    {"glXSwapIntervalSGI", &retrace::ignore},
-    //{"glXUseXFont", &retrace_glXUseXFont},
-    {"glXWaitForMscOML", &retrace::ignore},
-    {"glXWaitForSbcOML", &retrace::ignore},
-    {"glXWaitGL", &retrace::ignore},
-    {"glXWaitVideoSyncSGI", &retrace::ignore},
-    {"glXWaitX", &retrace::ignore},
-    {NULL, NULL},
-};
-
diff --git a/retrace/glretrace_wgl.cpp b/retrace/glretrace_wgl.cpp
deleted file mode 100644
index abcf068..0000000
--- a/retrace/glretrace_wgl.cpp
+++ /dev/null
@@ -1,311 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2011 Jose Fonseca
- * 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.
- *
- **************************************************************************/
-
-
-#include "glproc.hpp"
-#include "retrace.hpp"
-#include "glretrace.hpp"
-
-
-using namespace glretrace;
-
-
-typedef std::map<unsigned long long, glws::Drawable *> DrawableMap;
-typedef std::map<unsigned long long, Context *> ContextMap;
-static DrawableMap drawable_map;
-static DrawableMap pbuffer_map;
-static ContextMap context_map;
-
-
-static glws::Drawable *
-getDrawable(unsigned long long hdc) {
-    if (hdc == 0) {
-        return NULL;
-    }
-
-    DrawableMap::const_iterator it;
-    it = drawable_map.find(hdc);
-    if (it == drawable_map.end()) {
-        return (drawable_map[hdc] = glretrace::createDrawable());
-    }
-
-    return it->second;
-}
-
-static void retrace_wglCreateContext(trace::Call &call) {
-    unsigned long long orig_context = call.ret->toUIntPtr();
-    Context *context = glretrace::createContext();
-    context_map[orig_context] = context;
-}
-
-static void retrace_wglDeleteContext(trace::Call &call) {
-    unsigned long long hglrc = call.arg(0).toUIntPtr();
-
-    ContextMap::iterator it;
-    it = context_map.find(hglrc);
-    if (it == context_map.end()) {
-        return;
-    }
-
-    delete it->second;
-    
-    context_map.erase(it);
-}
-
-static void retrace_wglMakeCurrent(trace::Call &call) {
-    glws::Drawable *new_drawable = getDrawable(call.arg(0).toUIntPtr());
-    Context *new_context = context_map[call.arg(1).toUIntPtr()];
-
-    glretrace::makeCurrent(call, new_drawable, new_context);
-}
-
-static void retrace_wglCopyContext(trace::Call &call) {
-}
-
-static void retrace_wglChoosePixelFormat(trace::Call &call) {
-}
-
-static void retrace_wglDescribePixelFormat(trace::Call &call) {
-}
-
-static void retrace_wglSetPixelFormat(trace::Call &call) {
-}
-
-static void retrace_wglSwapBuffers(trace::Call &call) {
-    glws::Drawable *drawable = getDrawable(call.arg(0).toUIntPtr());
-
-    frame_complete(call);
-    if (retrace::doubleBuffer) {
-        if (drawable) {
-            drawable->swapBuffers();
-        } else {
-            glretrace::Context *currentContext = glretrace::getCurrentContext();
-            if (currentContext) {
-                currentContext->drawable->swapBuffers();
-            }
-        }
-    } else {
-        glFlush();
-    }
-}
-
-static void retrace_wglShareLists(trace::Call &call) {
-    unsigned long long hglrc1 = call.arg(0).toUIntPtr();
-    unsigned long long hglrc2 = call.arg(1).toUIntPtr();
-
-    Context *share_context = context_map[hglrc1];
-    Context *old_context = context_map[hglrc2];
-
-    Context *new_context = glretrace::createContext(share_context);
-    if (new_context) {
-        glretrace::Context *currentContext = glretrace::getCurrentContext();
-        if (currentContext == old_context) {
-            glretrace::makeCurrent(call, currentContext->drawable, new_context);
-        }
-
-        context_map[hglrc2] = new_context;
-        
-        delete old_context;
-    }
-}
-
-static void retrace_wglCreateLayerContext(trace::Call &call) {
-    retrace_wglCreateContext(call);
-}
-
-static void retrace_wglDescribeLayerPlane(trace::Call &call) {
-}
-
-static void retrace_wglSetLayerPaletteEntries(trace::Call &call) {
-}
-
-static void retrace_wglRealizeLayerPalette(trace::Call &call) {
-}
-
-static void retrace_wglSwapLayerBuffers(trace::Call &call) {
-    retrace_wglSwapBuffers(call);
-}
-
-static void retrace_wglUseFontBitmapsA(trace::Call &call) {
-}
-
-static void retrace_wglUseFontBitmapsW(trace::Call &call) {
-}
-
-static void retrace_wglSwapMultipleBuffers(trace::Call &call) {
-}
-
-static void retrace_wglUseFontOutlinesA(trace::Call &call) {
-}
-
-static void retrace_wglUseFontOutlinesW(trace::Call &call) {
-}
-
-static void retrace_wglCreateBufferRegionARB(trace::Call &call) {
-}
-
-static void retrace_wglDeleteBufferRegionARB(trace::Call &call) {
-}
-
-static void retrace_wglSaveBufferRegionARB(trace::Call &call) {
-}
-
-static void retrace_wglRestoreBufferRegionARB(trace::Call &call) {
-}
-
-static void retrace_wglChoosePixelFormatARB(trace::Call &call) {
-}
-
-static void retrace_wglMakeContextCurrentARB(trace::Call &call) {
-}
-
-static void retrace_wglCreatePbufferARB(trace::Call &call) {
-    int iWidth = call.arg(2).toUInt();
-    int iHeight = call.arg(3).toUInt();
-
-    unsigned long long orig_pbuffer = call.ret->toUIntPtr();
-    glws::Drawable *drawable = glretrace::createPbuffer(iWidth, iHeight);
-
-    pbuffer_map[orig_pbuffer] = drawable;
-}
-
-static void retrace_wglGetPbufferDCARB(trace::Call &call) {
-    glws::Drawable *pbuffer = pbuffer_map[call.arg(0).toUIntPtr()];
-
-    unsigned long long orig_hdc = call.ret->toUIntPtr();
-
-    drawable_map[orig_hdc] = pbuffer;
-}
-
-static void retrace_wglReleasePbufferDCARB(trace::Call &call) {
-}
-
-static void retrace_wglDestroyPbufferARB(trace::Call &call) {
-}
-
-static void retrace_wglQueryPbufferARB(trace::Call &call) {
-}
-
-static void retrace_wglBindTexImageARB(trace::Call &call) {
-}
-
-static void retrace_wglReleaseTexImageARB(trace::Call &call) {
-}
-
-static void retrace_wglSetPbufferAttribARB(trace::Call &call) {
-}
-
-static void retrace_wglCreateContextAttribsARB(trace::Call &call) {
-    unsigned long long orig_context = call.ret->toUIntPtr();
-    Context *share_context = NULL;
-
-    if (call.arg(1).toPointer()) {
-        share_context = context_map[call.arg(1).toUIntPtr()];
-    }
-
-    Context *context = glretrace::createContext(share_context);
-    context_map[orig_context] = context;
-}
-
-static void retrace_wglMakeContextCurrentEXT(trace::Call &call) {
-}
-
-static void retrace_wglChoosePixelFormatEXT(trace::Call &call) {
-}
-
-static void retrace_wglSwapIntervalEXT(trace::Call &call) {
-}
-
-static void retrace_wglAllocateMemoryNV(trace::Call &call) {
-}
-
-static void retrace_wglFreeMemoryNV(trace::Call &call) {
-}
-
-static void retrace_glAddSwapHintRectWIN(trace::Call &call) {
-}
-
-static void retrace_wglGetProcAddress(trace::Call &call) {
-}
-
-const retrace::Entry glretrace::wgl_callbacks[] = {
-    {"glAddSwapHintRectWIN", &retrace_glAddSwapHintRectWIN},
-    {"wglAllocateMemoryNV", &retrace_wglAllocateMemoryNV},
-    {"wglBindTexImageARB", &retrace_wglBindTexImageARB},
-    {"wglChoosePixelFormat", &retrace_wglChoosePixelFormat},
-    {"wglChoosePixelFormatARB", &retrace_wglChoosePixelFormatARB},
-    {"wglChoosePixelFormatEXT", &retrace_wglChoosePixelFormatEXT},
-    {"wglCopyContext", &retrace_wglCopyContext},
-    {"wglCreateBufferRegionARB", &retrace_wglCreateBufferRegionARB},
-    {"wglCreateContext", &retrace_wglCreateContext},
-    {"wglCreateContextAttribsARB", &retrace_wglCreateContextAttribsARB},
-    {"wglCreateLayerContext", &retrace_wglCreateLayerContext},
-    {"wglCreatePbufferARB", &retrace_wglCreatePbufferARB},
-    {"wglDeleteBufferRegionARB", &retrace_wglDeleteBufferRegionARB},
-    {"wglDeleteContext", &retrace_wglDeleteContext},
-    {"wglDescribeLayerPlane", &retrace_wglDescribeLayerPlane},
-    {"wglDescribePixelFormat", &retrace_wglDescribePixelFormat},
-    {"wglDestroyPbufferARB", &retrace_wglDestroyPbufferARB},
-    {"wglFreeMemoryNV", &retrace_wglFreeMemoryNV},
-    {"wglGetCurrentContext", &retrace::ignore},
-    {"wglGetCurrentDC", &retrace::ignore},
-    {"wglGetCurrentReadDCARB", &retrace::ignore},
-    {"wglGetCurrentReadDCEXT", &retrace::ignore},
-    {"wglGetDefaultProcAddress", &retrace::ignore},
-    {"wglGetExtensionsStringARB", &retrace::ignore},
-    {"wglGetExtensionsStringEXT", &retrace::ignore},
-    {"wglGetLayerPaletteEntries", &retrace::ignore},
-    {"wglGetPbufferDCARB", &retrace_wglGetPbufferDCARB},
-    {"wglGetPixelFormat", &retrace::ignore},
-    {"wglGetPixelFormatAttribfvARB", &retrace::ignore},
-    {"wglGetPixelFormatAttribfvEXT", &retrace::ignore},
-    {"wglGetPixelFormatAttribivARB", &retrace::ignore},
-    {"wglGetPixelFormatAttribivEXT", &retrace::ignore},
-    {"wglGetProcAddress", &retrace_wglGetProcAddress},
-    {"wglGetSwapIntervalEXT", &retrace::ignore},
-    {"wglMakeContextCurrentARB", &retrace_wglMakeContextCurrentARB},
-    {"wglMakeContextCurrentEXT", &retrace_wglMakeContextCurrentEXT},
-    {"wglMakeCurrent", &retrace_wglMakeCurrent},
-    {"wglQueryPbufferARB", &retrace_wglQueryPbufferARB},
-    {"wglRealizeLayerPalette", &retrace_wglRealizeLayerPalette},
-    {"wglReleasePbufferDCARB", &retrace_wglReleasePbufferDCARB},
-    {"wglReleaseTexImageARB", &retrace_wglReleaseTexImageARB},
-    {"wglRestoreBufferRegionARB", &retrace_wglRestoreBufferRegionARB},
-    {"wglSaveBufferRegionARB", &retrace_wglSaveBufferRegionARB},
-    {"wglSetLayerPaletteEntries", &retrace_wglSetLayerPaletteEntries},
-    {"wglSetPbufferAttribARB", &retrace_wglSetPbufferAttribARB},
-    {"wglSetPixelFormat", &retrace_wglSetPixelFormat},
-    {"wglShareLists", &retrace_wglShareLists},
-    {"wglSwapBuffers", &retrace_wglSwapBuffers},
-    {"wglSwapIntervalEXT", &retrace_wglSwapIntervalEXT},
-    {"wglSwapLayerBuffers", &retrace_wglSwapLayerBuffers},
-    {"wglSwapMultipleBuffers", &retrace_wglSwapMultipleBuffers},
-    {"wglUseFontBitmapsA", &retrace_wglUseFontBitmapsA},
-    {"wglUseFontBitmapsW", &retrace_wglUseFontBitmapsW},
-    {"wglUseFontOutlinesA", &retrace_wglUseFontOutlinesA},
-    {"wglUseFontOutlinesW", &retrace_wglUseFontOutlinesW},
-    {NULL, NULL}
-};
-
diff --git a/scripts/convert.py b/scripts/convert.py
index d5660c0..26617ad 100755
--- a/scripts/convert.py
+++ b/scripts/convert.py
@@ -55,7 +55,7 @@ def convert(inTrace, outPixrun):
         pixExp,
         '-start',
         '-runfile', os.path.abspath(outPixrun),
-        '-targetpath', os.path.abspath(options.retrace),
+        '-targetpath', os.path.abspath(options.replay),
         #'-targetstartfolder', ...,
         '-targetargs', os.path.abspath(inTrace),
     ]
@@ -84,9 +84,9 @@ def main():
         usage='\n\t%prog [options] <trace> ...',
         version='%%prog')
     optparser.add_option(
-        '-r', '--retrace', metavar='PROGRAM',
-        type='string', dest='retrace', default='d3dretrace',
-        help='retrace command [default: %default]')
+        '-r', '--replay', metavar='PROGRAM',
+        type='string', dest='replay', default='d3dreplay',
+        help='replay command [default: %default]')
     optparser.add_option(
         '-v', '--verbose',
         action='store_true', dest='verbose', default=False,
diff --git a/scripts/retracediff.py b/scripts/replaydiff.py
similarity index 93%
rename from scripts/retracediff.py
rename to scripts/replaydiff.py
index 413ecac..e66d273 100755
--- a/scripts/retracediff.py
+++ b/scripts/replaydiff.py
@@ -24,7 +24,7 @@
 #
 ##########################################################################/
 
-'''Run two retrace instances in parallel, comparing generated snapshots.
+'''Run two replay instances in parallel, comparing generated snapshots.
 '''
 
 
@@ -54,9 +54,9 @@ class Setup:
         self.args = args
         self.env = env
 
-    def _retrace(self, args):
+    def _replay(self, args):
         cmd = [
-            options.retrace,
+            options.replay,
         ] + args + self.args
         if self.env:
             for name, value in self.env.iteritems():
@@ -68,8 +68,8 @@ class Setup:
             sys.stderr.write('error: failed to execute %s: %s\n' % (cmd[0], ex.strerror))
             sys.exit(1)
 
-    def retrace(self):
-        return self._retrace([
+    def replay(self):
+        return self._replay([
             '-s', '-',
             '-S', options.snapshot_frequency,
         ])
@@ -77,7 +77,7 @@ class Setup:
     def dump_state(self, call_no):
         '''Get the state dump at the specified call no.'''
 
-        p = self._retrace([
+        p = self._replay([
             '-D', str(call_no),
         ])
         state = jsondiff.load(p.stdout)
@@ -148,12 +148,12 @@ def main():
 
     # Parse command line options
     optparser = optparse.OptionParser(
-        usage='\n\t%prog [options] -- [glretrace options] <trace>',
+        usage='\n\t%prog [options] -- [glreplay options] <trace>',
         version='%%prog')
     optparser.add_option(
-        '-r', '--retrace', metavar='PROGRAM',
-        type='string', dest='retrace', default='glretrace',
-        help='retrace command [default: %default]')
+        '-r', '--replay', metavar='PROGRAM',
+        type='string', dest='replay', default='glreplay',
+        help='replay command [default: %default]')
     optparser.add_option(
         '--ref-driver', metavar='DRIVER',
         type='string', dest='ref_driver', default=None,
@@ -165,11 +165,11 @@ def main():
     optparser.add_option(
         '--ref-arg', metavar='OPTION',
         type='string', action='append', dest='ref_args', default=[],
-        help='pass argument to reference retrace')
+        help='pass argument to reference replay')
     optparser.add_option(
         '--src-arg', metavar='OPTION',
         type='string', action='append', dest='src_args', default=[],
-        help='pass argument to source retrace')
+        help='pass argument to source replay')
     optparser.add_option(
         '--ref-env', metavar='NAME=VALUE',
         type='string', action='append', dest='ref_env', default=[],
@@ -220,9 +220,9 @@ def main():
 
     last_bad = -1
     last_good = 0
-    ref_proc = ref_setup.retrace()
+    ref_proc = ref_setup.replay()
     try:
-        src_proc = src_setup.retrace()
+        src_proc = src_setup.replay()
         try:
             while True:
                 # Get the reference image
diff --git a/scripts/tracecheck.py b/scripts/tracecheck.py
index d204fa6..a3e5285 100755
--- a/scripts/tracecheck.py
+++ b/scripts/tracecheck.py
@@ -100,16 +100,16 @@ def main():
 
     # Parse command line options
     optparser = optparse.OptionParser(
-        usage='\n\tgit bisect run %prog [options] -- [glretrace options] <trace>',
+        usage='\n\tgit bisect run %prog [options] -- [glreplay options] <trace>',
         version='%%prog')
     optparser.add_option(
         '-b', '--build', metavar='COMMAND',
         type='string', dest='build', default=default_build,
         help='build command [default: %default]')
     optparser.add_option(
-        '-r', '--retrace', metavar='PROGRAM',
-        type='string', dest='retrace', default='glretrace',
-        help='retrace command [default: %default]')
+        '-r', '--replay', metavar='PROGRAM',
+        type='string', dest='replay', default='glreplay',
+        help='replay command [default: %default]')
     optparser.add_option(
         '-c', '--compare', metavar='PREFIX',
         type='string', dest='compare_prefix', default=None,
@@ -163,8 +163,8 @@ def main():
             sys.stderr.write("GL_RENDERER mismatch: %r !~ /%s/\n"  % (gl_renderer, options.gl_renderer_re))
             skip()
 
-    # Run glretrace
-    command = [options.retrace]
+    # Run glreplay
+    command = [options.replay]
     if options.compare_prefix:
         command += ['-c', options.compare_prefix]
     else:
diff --git a/specs/gltypes.py b/specs/gltypes.py
index a04990d..3a320fd 100644
--- a/specs/gltypes.py
+++ b/specs/gltypes.py
@@ -100,7 +100,7 @@ GLshader = Handle("shader", GLuint)
 GLlocation = Handle("location", GLint, key=('program', GLhandleARB))
 GLlocationARB = Handle("location", GLint, key=('programObj', GLhandleARB))
 
-contextKey = ('reinterpret_cast<uintptr_t>(glretrace::getCurrentContext())', UIntPtr)
+contextKey = ('reinterpret_cast<uintptr_t>(glreplay::getCurrentContext())', UIntPtr)
 
 GLprogramARB = Handle("programARB", GLuint)
 GLframebuffer = Handle("framebuffer", GLuint)
diff --git a/wrappers/gltrace.hpp b/wrappers/gltrace.hpp
index 04c64b6..45bbf13 100644
--- a/wrappers/gltrace.hpp
+++ b/wrappers/gltrace.hpp
@@ -146,4 +146,4 @@ _glGetStringi_override(GLenum name, GLuint index);
 } /* namespace gltrace */
 
 
-#endif /* _GLRETRACE_HPP_ */
+#endif /* _GLREPLAY_HPP_ */
-- 
1.7.10.4



More information about the apitrace mailing list