]> git.cworth.org Git - apitrace/blobdiff - retrace/glretrace.hpp
CPU Profiling now includes all OpenGL calls (was only draw calls).
[apitrace] / retrace / glretrace.hpp
index 8ba2a80edd477b8e2b418f0c21bfb76b57aace32..568049ecb710620eba4e24f2846d56ea7c25cbab 100644 (file)
 
 namespace glretrace {
 
-
-extern bool double_buffer;
+struct Context {
+    Context(glws::Context* context)
+        : wsContext(context),
+          activeProgram(0),
+          used(false)
+    {
+    }
+
+    ~Context()
+    {
+        delete wsContext;
+    }
+
+    glws::Context* wsContext;
+    GLuint activeProgram;
+    bool used;
+};
+
+extern bool insideList;
 extern bool insideGlBeginEnd;
-extern glws::Profile defaultProfile;
-extern glws::Visual *visual[glws::PROFILE_MAX];
-extern glws::Drawable *drawable;
-extern glws::Context *context;
 
-extern unsigned frame;
-extern long long startTime;
-extern bool wait;
 
-extern bool benchmark;
+extern glws::Drawable *currentDrawable;
+extern Context *currentContext;
+
+glws::Drawable *
+createDrawable(glws::Profile profile);
+
+glws::Drawable *
+createDrawable(void);
+
+Context *
+createContext(Context *shareContext, glws::Profile profile);
+
+Context *
+createContext(Context *shareContext = 0);
+
+bool
+makeCurrent(trace::Call &call, glws::Drawable *drawable, Context *context);
 
-extern unsigned dump_state;
 
 void
 checkGlError(trace::Call &call);
@@ -57,10 +82,17 @@ extern const retrace::Entry glx_callbacks[];
 extern const retrace::Entry wgl_callbacks[];
 extern const retrace::Entry egl_callbacks[];
 
+void frame_start();
 void frame_complete(trace::Call &call);
+void initContext();
+
 
 void updateDrawable(int width, int height);
 
+void flushQueries();
+void beginProfile(trace::Call &call, bool isDraw);
+void endProfile(trace::Call &call, bool isDraw);
+
 } /* namespace glretrace */