]> git.cworth.org Git - apitrace/blobdiff - retrace/glretrace.hpp
glretrace: Put currentContext on TLS.
[apitrace] / retrace / glretrace.hpp
index 568049ecb710620eba4e24f2846d56ea7c25cbab..90c4c81693419233af27686eddcd8d23db4475f7 100644 (file)
@@ -35,6 +35,7 @@ namespace glretrace {
 struct Context {
     Context(glws::Context* context)
         : wsContext(context),
+          drawable(0),
           activeProgram(0),
           used(false)
     {
@@ -46,16 +47,31 @@ struct Context {
     }
 
     glws::Context* wsContext;
+
+    // Bound drawable
+    glws::Drawable *drawable;
+
     GLuint activeProgram;
     bool used;
+    
+    // Context must be current
+    inline bool
+    hasExtension(const char *extension) const {
+        return wsContext->hasExtension(extension);
+    }
 };
 
 extern bool insideList;
 extern bool insideGlBeginEnd;
 
 
-extern glws::Drawable *currentDrawable;
-extern Context *currentContext;
+Context *
+getCurrentContext(void);
+
+
+int
+parseAttrib(const trace::Value *attribs, int param, int default_);
+
 
 glws::Drawable *
 createDrawable(glws::Profile profile);
@@ -82,7 +98,6 @@ 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();