X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=glretrace.hpp;h=255dd6f52d10c8c4a37677efeaa30315928239ed;hb=46c4a32730c5b52c119376042a84a6773d8d789f;hp=a275f52a4eb9b2d4b0bbc76859378d5fe199fc03;hpb=30228ce517ea4938f428aa0e1cec7d61f1d9a1e2;p=apitrace diff --git a/glretrace.hpp b/glretrace.hpp index a275f52..255dd6f 100644 --- a/glretrace.hpp +++ b/glretrace.hpp @@ -23,98 +23,51 @@ * **************************************************************************/ -/* - * Abstraction for GL window system specific APIs (GLX, WGL). - */ - #ifndef _GLRETRACE_HPP_ #define _GLRETRACE_HPP_ +#include "trace_parser.hpp" +#include "glws.hpp" -namespace glretrace { - - -class Visual -{ -public: - unsigned long redMask; - unsigned long greenMask; - unsigned long blueMask; - unsigned long alphaMask; - bool doubleBuffer; - - virtual ~Visual() {} -}; - - -class Drawable -{ -public: - const Visual *visual; - unsigned width; - unsigned height; - - Drawable(const Visual *vis) : - visual(vis) - {} - virtual ~Drawable() {} - - virtual void - resize(unsigned w, unsigned h) { - width = w; - height = h; - } +namespace glretrace { - virtual void swapBuffers(void) = 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; -class Context -{ -public: - const Visual *visual; - - Context(const Visual *vis) : - visual(vis) - {} +extern unsigned frame; +extern long long startTime; +extern bool wait; - virtual ~Context() {} +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() {} - - virtual Visual * - createVisual(bool doubleBuffer=false) = 0; - - virtual Drawable * - createDrawable(const Visual *visual) = 0; - - virtual Context * - createContext(const Visual *visual) = 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 */