[PATCH v3 01/18] mt trace: create gltrace_state.cpp, move getContext into it
Imre Deak
imre.deak at intel.com
Wed May 23 02:05:15 PDT 2012
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 at intel.com>
---
wrappers/CMakeLists.txt | 4 ++++
wrappers/gltrace.py | 8 --------
wrappers/gltrace_state.cpp | 10 ++++++++++
3 files changed, 14 insertions(+), 8 deletions(-)
create mode 100644 wrappers/gltrace_state.cpp
diff --git a/wrappers/CMakeLists.txt b/wrappers/CMakeLists.txt
index a333504..b9e3eef 100644
--- a/wrappers/CMakeLists.txt
+++ b/wrappers/CMakeLists.txt
@@ -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)
diff --git a/wrappers/gltrace.py b/wrappers/gltrace.py
index 8588d1f..901e9d7 100644
--- a/wrappers/gltrace.py
+++ b/wrappers/gltrace.py
@@ -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
index 0000000..6b73d7a
--- /dev/null
+++ b/wrappers/gltrace_state.cpp
@@ -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;
+}
+
--
1.7.5.4
More information about the apitrace
mailing list