]> 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 fea187cf05ed19b474d255bb828000d255a71464..568049ecb710620eba4e24f2846d56ea7c25cbab 100644 (file)
 
 namespace glretrace {
 
-
+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::Drawable *currentDrawable;
-extern glws::Context *currentContext;
+extern Context *currentContext;
 
 glws::Drawable *
 createDrawable(glws::Profile profile);
@@ -45,14 +63,14 @@ createDrawable(glws::Profile profile);
 glws::Drawable *
 createDrawable(void);
 
-glws::Context *
-createContext(glws::Context *shareContext, glws::Profile profile);
+Context *
+createContext(Context *shareContext, glws::Profile profile);
 
-glws::Context *
-createContext(glws::Context *shareContext = 0);
+Context *
+createContext(Context *shareContext = 0);
 
 bool
-makeCurrent(trace::Call &call, glws::Drawable *drawable, glws::Context *context);
+makeCurrent(trace::Call &call, glws::Drawable *drawable, Context *context);
 
 
 void
@@ -64,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 */