X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=glretrace.hpp;h=255dd6f52d10c8c4a37677efeaa30315928239ed;hb=e0df952b67f3ae38aeb0fd7e32942f8fa53ac49f;hp=a56606c5a89ab9a87cc37ae0487147d57ea308b2;hpb=2403f685f5787de3c6e51f26fe866158a05e4bd4;p=apitrace diff --git a/glretrace.hpp b/glretrace.hpp index a56606c..255dd6f 100644 --- a/glretrace.hpp +++ b/glretrace.hpp @@ -23,86 +23,51 @@ * **************************************************************************/ -/* - * Abstraction for GL window system specific APIs (GLX, WGL). - */ - #ifndef _GLRETRACE_HPP_ #define _GLRETRACE_HPP_ - -namespace glretrace { +#include "trace_parser.hpp" +#include "glws.hpp" -struct Visual -{ - unsigned long redMask; - unsigned long greenMask; - unsigned long blueMask; - unsigned long alphaMask; - bool doubleBuffer; -}; +namespace glretrace { -struct Context -{ - const Visual *visual; -}; +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; +extern unsigned frame; +extern long long startTime; +extern bool wait; -struct Drawable -{ - unsigned width; - unsigned height; +enum frequency { + FREQUENCY_NEVER = 0, + FREQUENCY_FRAME, + FREQUENCY_FRAMEBUFFER, + FREQUENCY_DRAW, }; +extern bool benchmark; +extern const char *compare_prefix; +extern const char *snapshot_prefix; +extern enum frequency snapshot_frequency; -class WindowSystem -{ -public: - Drawable *currentDrawable; - Context *currentContext; - - - inline WindowSystem() : - currentDrawable(NULL), - currentContext(NULL) - {} +extern unsigned dump_state; - virtual ~WindowSystem() {} - - // - // Drawables - // - - virtual Drawable * - createDrawable(unsigned width = 0, unsigned height = 0) = 0; - - virtual void - resizeDrawable(Drawable *drawable, unsigned width, unsigned height) = 0; - - virtual Void * - destroyDrawable(void) = 0; - - // - // Contexts - // - - virtual Context * - createContext(const Visual *visual) = 0; - - virtual void - deleteContext(Context *) = 0; - - virtual bool - makeCurrent(Drawable *drawable, Context *context) = 0; - - virtual bool - processEvents(void) = 0; -}; +void +checkGlError(Trace::Call &call); +void retrace_call_cgl(Trace::Call &call); +void retrace_call_glx(Trace::Call &call); +void retrace_call_wgl(Trace::Call &call); -WindowSystem *createNativeWindowSystem(void); +void snapshot(unsigned call_no); +void frame_complete(unsigned call_no); } /* namespace glretrace */