From 818d47d1c34f6e23e42e846ada471d0124e38ebe Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Sat, 2 Apr 2011 20:22:17 +0100 Subject: [PATCH] Separate WS abstraction from retracing. --- CMakeLists.txt | 4 +++- glretrace.py | 12 ++++++------ glretrace.hpp => glws.hpp | 10 +++++----- glretrace_xlib.cpp => glws_glx.cpp | 4 ++-- 4 files changed, 16 insertions(+), 14 deletions(-) rename glretrace.hpp => glws.hpp (95%) rename glretrace_xlib.cpp => glws_glx.cpp (99%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d919e8..f6802e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -195,8 +195,10 @@ endif () if (WIN32) set (os os_win32.cpp) + set (glws glws_wgl.cpp) else (WIN32) set (os os_posix.cpp) + set (glws glws_glx.cpp) endif (WIN32) add_library (trace trace_model.cpp trace_parser.cpp ${os}) @@ -223,8 +225,8 @@ include_directories ( add_executable (glretrace glretrace.cpp - glretrace_xlib.cpp glstate.cpp + ${glws} image.cpp ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp ) diff --git a/glretrace.py b/glretrace.py index 2f2b8ff..312c9a3 100644 --- a/glretrace.py +++ b/glretrace.py @@ -171,7 +171,7 @@ if __name__ == '__main__': #include "glproc.hpp" #include "glstate.hpp" -#include "glretrace.hpp" +#include "glws.hpp" static bool double_buffer = false; static bool insideGlBeginEnd = false; @@ -240,10 +240,10 @@ checkGlError(void) { print r''' static Trace::Parser parser; -static glretrace::WindowSystem *__ws = NULL; -static glretrace::Visual *__visual = NULL; -static glretrace::Drawable *__drawable = NULL; -static glretrace::Context *__context = NULL; +static glws::WindowSystem *__ws = NULL; +static glws::Visual *__visual = NULL; +static glws::Drawable *__drawable = NULL; +static glws::Context *__context = NULL; #include "image.hpp" @@ -421,7 +421,7 @@ int main(int argc, char **argv) } } - __ws = glretrace::createNativeWindowSystem(); + __ws = glws::createNativeWindowSystem(); __visual = __ws->createVisual(double_buffer); __drawable = __ws->createDrawable(__visual); __drawable->resize(__window_width, __window_height); diff --git a/glretrace.hpp b/glws.hpp similarity index 95% rename from glretrace.hpp rename to glws.hpp index a275f52..8f4a845 100644 --- a/glretrace.hpp +++ b/glws.hpp @@ -27,11 +27,11 @@ * Abstraction for GL window system specific APIs (GLX, WGL). */ -#ifndef _GLRETRACE_HPP_ -#define _GLRETRACE_HPP_ +#ifndef _GLWS_HPP_ +#define _GLWS_HPP_ -namespace glretrace { +namespace glws { class Visual @@ -117,7 +117,7 @@ public: WindowSystem *createNativeWindowSystem(void); -} /* namespace glretrace */ +} /* namespace glws */ -#endif /* _GLRETRACE_HPP_ */ +#endif /* _GLWS_HPP_ */ diff --git a/glretrace_xlib.cpp b/glws_glx.cpp similarity index 99% rename from glretrace_xlib.cpp rename to glws_glx.cpp index a6764c5..be0a82b 100644 --- a/glretrace_xlib.cpp +++ b/glws_glx.cpp @@ -24,10 +24,10 @@ **************************************************************************/ #include "glimports.hpp" -#include "glretrace.hpp" +#include "glws.hpp" -namespace glretrace { +namespace glws { class XlibVisual : public Visual -- 2.45.2