]> git.cworth.org Git - apitrace/blobdiff - retrace/glretrace.hpp
Create glretrace specific context.
[apitrace] / retrace / glretrace.hpp
index fea187cf05ed19b474d255bb828000d255a71464..76f47dbcd6aed38d0d733220d6307f9cad48ca0b 100644 (file)
 
 namespace glretrace {
 
-
+struct Context {
+    Context(glws::Context* context)
+        : wsContext(context),
+          activeProgram(0)
+    {
+    }
+
+    ~Context()
+    {
+        delete wsContext;
+    }
+
+    glws::Context* wsContext;
+    GLuint activeProgram;
+};
+
+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 +61,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 +80,15 @@ 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 updateDrawable(int width, int height);
 
+void flushQueries();
+void beginProfile(trace::Call &call);
+void endProfile(trace::Call &call);
+
 } /* namespace glretrace */