*
**************************************************************************/
-/*
- * Abstraction for GL window system specific APIs (GLX, WGL).
- */
-
#ifndef _GLRETRACE_HPP_
#define _GLRETRACE_HPP_
+#include <ostream>
-namespace glretrace {
-
-
-struct Visual
-{
- unsigned long redMask;
- unsigned long greenMask;
- unsigned long blueMask;
- unsigned long alphaMask;
- bool doubleBuffer;
-};
-
-
-struct Context
-{
- const Visual *visual;
-};
-
+#include "trace_parser.hpp"
+#include "glws.hpp"
-struct Drawable
-{
- unsigned width;
- unsigned height;
-};
+namespace glretrace {
-class WindowSystem
-{
-public:
- Drawable *currentDrawable;
- Context *currentContext;
-
-
- inline WindowSystem() :
- currentDrawable(NULL),
- currentContext(NULL)
- {}
-
- virtual ~WindowSystem() {}
-
- //
- // Drawables
- //
-
- virtual Drawable *
- createDrawable(unsigned width = 0, unsigned height = 0) = 0;
- virtual void
- resizeDrawable(Drawable *drawable, unsigned width, unsigned height) = 0;
+extern bool double_buffer;
+extern bool insideGlBeginEnd;
+extern Trace::Parser parser;
+extern glws::WindowSystem *ws;
+extern glws::Visual *visual;
+extern glws::Drawable *drawable;
+extern glws::Context *context;
- virtual Void *
- destroyDrawable(void) = 0;
+extern int window_width;
+extern int window_height;
- //
- // Contexts
- //
-
- virtual Context *
- createContext(const Visual *visual) = 0;
+extern unsigned frame;
+extern long long startTime;
+extern bool wait;
- virtual void
- deleteContext(Context *) = 0;
-
- virtual bool
- makeCurrent(Drawable *drawable, Context *context) = 0;
+extern bool benchmark;
+extern const char *compare_prefix;
+extern const char *snapshot_prefix;
- virtual bool
- processEvents(void) = 0;
-};
+extern unsigned dump_state;
+void
+checkGlError(void);
-WindowSystem *createNativeWindowSystem(void);
+void state_dump(std::ostream &os);
} /* namespace glretrace */