X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=retrace%2Fglretrace.hpp;h=95a6d7596df230e8dd059194c493bbf58055cad3;hb=b35ae0df401ff22e3b2dc9b6bfacf1e23baebde0;hp=2ab85e03fda624da0d1e51b7cee6a10d2fba5f34;hpb=f91056b5782d48d526f19dacd5a988003fc6f11e;p=apitrace diff --git a/retrace/glretrace.hpp b/retrace/glretrace.hpp index 2ab85e0..95a6d75 100644 --- a/retrace/glretrace.hpp +++ b/retrace/glretrace.hpp @@ -32,13 +32,43 @@ namespace glretrace { +struct Context { + Context(glws::Context* context) + : wsContext(context), + drawable(0), + activeProgram(0), + used(false) + { + } + + ~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 glws::Context *currentContext; +Context * +getCurrentContext(void); + + +int +parseAttrib(const trace::Value *attribs, int param, int default_); + glws::Drawable * createDrawable(glws::Profile profile); @@ -46,14 +76,17 @@ createDrawable(glws::Profile profile); glws::Drawable * createDrawable(void); -glws::Context * -createContext(glws::Context *shareContext, glws::Profile profile); +glws::Drawable * +createPbuffer(int width, int height); + +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 @@ -65,13 +98,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 initContext(); + void updateDrawable(int width, int height); -void beginProfileGPU(trace::Call &call); -void endProfileGPU(trace::Call &call); +void flushQueries(); +void beginProfile(trace::Call &call, bool isDraw); +void endProfile(trace::Call &call, bool isDraw); } /* namespace glretrace */