]> git.cworth.org Git - apitrace/blobdiff - glretrace.hpp
apitrace diff-images: Print one line for each file being compared.
[apitrace] / glretrace.hpp
index a56606c5a89ab9a87cc37ae0487147d57ea308b2..83535223fcf3c7f1009d9731df459ff8a9090203 100644 (file)
  *
  **************************************************************************/
 
-/*
- * Abstraction for GL window system specific APIs (GLX, WGL).
- */
-
 #ifndef _GLRETRACE_HPP_
 #define _GLRETRACE_HPP_
 
-
-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"
+#include "retrace.hpp"
 
 
-struct Drawable
-{
-    unsigned width;
-    unsigned height;
-};
-
-
-class WindowSystem
-{
-public:
-    Drawable *currentDrawable;
-    Context *currentContext;
-
-
-    inline WindowSystem() :
-        currentDrawable(NULL),
-        currentContext(NULL)
-    {}
-
-    virtual ~WindowSystem() {}
-
-    //
-    // Drawables
-    //
+namespace glretrace {
 
-    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::Profile defaultProfile;
+extern glws::Visual *visual[glws::PROFILE_MAX];
+extern glws::Drawable *drawable;
+extern glws::Context *context;
 
-    virtual Void *
-    destroyDrawable(void) = 0;
+extern unsigned frame;
+extern long long startTime;
+extern bool wait;
 
-    // 
-    // Contexts
-    //
-    virtual Context *
-    createContext(const Visual *visual) = 0;
+extern bool benchmark;
 
-    virtual void
-    deleteContext(Context *) = 0;
-    
-    virtual bool
-    makeCurrent(Drawable *drawable, Context *context) = 0;
+extern unsigned dump_state;
 
-    virtual bool
-    processEvents(void) = 0;
-};
+void
+checkGlError(trace::Call &call);
 
+extern const retrace::Entry gl_callbacks[];
+extern const retrace::Entry cgl_callbacks[];
+extern const retrace::Entry glx_callbacks[];
+extern const retrace::Entry wgl_callbacks[];
+extern const retrace::Entry egl_callbacks[];
 
-WindowSystem *createNativeWindowSystem(void);
+void frame_complete(trace::Call &call);
 
+void updateDrawable(int width, int height);
 
 } /* namespace glretrace */