[PATCH 5/6] gles: Add eglretrace

Chia-I Wu olvaffe at gmail.com
Tue Nov 8 15:48:42 PST 2011


It works like glretrace, except that an EGL-based glws implementation is used.
---
 CMakeLists.txt |   31 +++++++++++++++++++++++++++++--
 glproc.py      |    4 +++-
 2 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2f07f70..8a70b71 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -489,7 +489,7 @@ include_directories (
     ${OPENGL_INCLUDE_PATH}
 )
 
-add_executable (glretrace
+set (retrace_sources
     glretrace_gl.cpp
     glretrace_cgl.cpp
     glretrace_glx.cpp
@@ -501,10 +501,14 @@ add_executable (glretrace
     retrace.cpp
     retrace_stdc.cpp
     glws.cpp
-    ${glws_os}
     ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp
 )
 
+add_executable (glretrace
+    ${retrace_sources}
+    ${glws_os}
+)
+
 set_property (
     TARGET glretrace
     APPEND
@@ -529,6 +533,29 @@ endif ()
 
 install (TARGETS glretrace RUNTIME DESTINATION bin) 
 
+if (EGL_FOUND AND NOT WIN32 AND NOT APPLE)
+    add_executable (eglretrace
+        ${retrace_sources}
+        glws_egl_xlib.cpp
+    )
+
+    set_property (
+        TARGET eglretrace
+        APPEND
+        PROPERTY COMPILE_DEFINITIONS "RETRACE"
+        PROPERTY COMPILE_DEFINITIONS "TRACE_EGL"
+    )
+
+    target_link_libraries (eglretrace
+        common
+    )
+
+    target_link_libraries (eglretrace
+            ${EGL_LIBRARIES} ${OPENGL_gl_LIBRARY} ${X11_X11_LIB})
+
+    install (TARGETS eglretrace RUNTIME DESTINATION bin) 
+endif ()
+
 ##############################################################################
 # CLI
 
diff --git a/glproc.py b/glproc.py
index 0fbc43e..a245257 100644
--- a/glproc.py
+++ b/glproc.py
@@ -493,7 +493,9 @@ class GlDispatcher(Dispatcher):
 
     def header(self):
         print '#ifdef RETRACE'
-        print '#  if defined(_WIN32)'
+        print '#  if defined(TRACE_EGL)'
+        print '#    define __getPrivateProcAddress(name) eglGetProcAddress(name)'
+        print '#  elif defined(_WIN32)'
         print '#    define __getPrivateProcAddress(name) wglGetProcAddress(name)'
         print '#  elif defined(__APPLE__)'
         print '#    include <dlfcn.h>'
-- 
1.7.6.3



More information about the apitrace mailing list