From: Imre Deak Date: Thu, 3 May 2012 14:33:13 +0000 (+0300) Subject: mt trace: create gltrace_state.cpp, move getContext into it X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=e90cac47697d2c26ac3a6d5292de101519b46f95;p=apitrace mt trace: create gltrace_state.cpp, move getContext into it 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 --- 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::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; +} +