]> git.cworth.org Git - apitrace/commitdiff
mt trace: create gltrace_state.cpp, move getContext into it
authorImre Deak <imre.deak@intel.com>
Thu, 3 May 2012 14:33:13 +0000 (17:33 +0300)
committerImre Deak <imre.deak@intel.com>
Wed, 23 May 2012 08:10:44 +0000 (11:10 +0300)
There is no need to keep this function in a python script and the
following patches will extend the functionality around this code, so
move the function to a .cpp file.

Signed-off-by: Imre Deak <imre.deak@intel.com>
wrappers/CMakeLists.txt
wrappers/gltrace.py
wrappers/gltrace_state.cpp [new file with mode: 0644]

index a33350470730fe5d4245a5a66dc81180448e194f..b9e3eefe88314146f5dfc9e6f219c36677d954df 100644 (file)
@@ -236,6 +236,7 @@ if (WIN32)
     add_library (wgltrace MODULE opengl32.def
         wgltrace.cpp
         glcaps.cpp
+        gltrace_state.cpp
     )
     add_dependencies (wgltrace glproc)
     target_link_libraries (wgltrace
@@ -269,6 +270,7 @@ elseif (APPLE)
     add_library (cgltrace SHARED
         cgltrace.cpp
         glcaps.cpp
+        gltrace_state.cpp
     )
 
     add_dependencies (cgltrace glproc)
@@ -309,6 +311,7 @@ elseif (X11_FOUND)
     add_library (glxtrace SHARED
         glxtrace.cpp
         glcaps.cpp
+        gltrace_state.cpp
     )
 
     add_dependencies (glxtrace glproc)
@@ -355,6 +358,7 @@ if (ENABLE_EGL AND NOT WIN32 AND NOT APPLE)
     add_library (egltrace SHARED
         egltrace.cpp
         glcaps.cpp
+        gltrace_state.cpp
     )
 
     add_dependencies (egltrace glproc)
index 8588d1f826473f5f6cad77024b6964a8d8627d96..901e9d749c1d096ca749526b467b6afae17bd6f8 100644 (file)
@@ -121,14 +121,6 @@ class GlTracer(Tracer):
         print '    VERTEX_ATTRIB_NV,'
         print '};'
         print
-        print 'gltrace::Context *'
-        print 'gltrace::getContext(void)'
-        print '{'
-        print '    // TODO return the context set by other APIs (GLX, EGL, and etc.)'
-        print '    static gltrace::Context _ctx = { gltrace::PROFILE_COMPAT, false, false, false };'
-        print '    return &_ctx;'
-        print '}'
-        print
         print 'static vertex_attrib _get_vertex_attrib(void) {'
         print '    gltrace::Context *ctx = gltrace::getContext();'
         print '    if (ctx->user_arrays_arb || ctx->user_arrays_nv) {'
diff --git a/wrappers/gltrace_state.cpp b/wrappers/gltrace_state.cpp
new file mode 100644 (file)
index 0000000..6b73d7a
--- /dev/null
@@ -0,0 +1,10 @@
+#include <gltrace.hpp>
+
+gltrace::Context *
+gltrace::getContext(void)
+{
+    // TODO return the context set by other APIs (GLX, EGL, and etc.)
+    static gltrace::Context _ctx = { gltrace::PROFILE_COMPAT, false, false, false };
+    return &_ctx;
+}
+