X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=retrace%2Fglretrace.hpp;h=7441b56938e22481e0110b181b74b7de81a55c98;hb=37007777c37b1d28abfe1ac07901d1e13e12b113;hp=76f47dbcd6aed38d0d733220d6307f9cad48ca0b;hpb=60139d6c4850e1cf731021e57c89ea5552f60e6b;p=apitrace diff --git a/retrace/glretrace.hpp b/retrace/glretrace.hpp index 76f47db..7441b56 100644 --- a/retrace/glretrace.hpp +++ b/retrace/glretrace.hpp @@ -35,25 +35,40 @@ namespace glretrace { struct Context { Context(glws::Context* context) : wsContext(context), - activeProgram(0) + drawable(0), + activeProgram(0), + used(false) { } - ~Context() - { - delete wsContext; - } + ~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 bool supportsARBShaderObjects; +Context * +getCurrentContext(void); + + +int +parseAttrib(const trace::Value *attribs, int param, int default_); -extern glws::Drawable *currentDrawable; -extern Context *currentContext; glws::Drawable * createDrawable(glws::Profile profile); @@ -61,6 +76,9 @@ createDrawable(glws::Profile profile); glws::Drawable * createDrawable(void); +glws::Drawable * +createPbuffer(int width, int height); + Context * createContext(Context *shareContext, glws::Profile profile); @@ -80,14 +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 flushQueries(); -void beginProfile(trace::Call &call); -void endProfile(trace::Call &call); +void beginProfile(trace::Call &call, bool isDraw); +void endProfile(trace::Call &call, bool isDraw); } /* namespace glretrace */