X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=retrace%2Fglretrace.hpp;h=7441b56938e22481e0110b181b74b7de81a55c98;hb=37007777c37b1d28abfe1ac07901d1e13e12b113;hp=bfc6398abdc2c5b7bd3900b38789df49e48c12c0;hpb=6d92327e88d2bb4c03a1b84663e50497f99fc24f;p=apitrace diff --git a/retrace/glretrace.hpp b/retrace/glretrace.hpp index bfc6398..7441b56 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 bool supportsARBShaderObjects; +Context * +getCurrentContext(void); + + +int +parseAttrib(const trace::Value *attribs, int param, int default_); -extern glws::Drawable *currentDrawable; -extern glws::Context *currentContext; 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); -glws::Context * -createContext(glws::Context *shareContext = 0); +Context * +createContext(Context *shareContext, glws::Profile profile); + +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,18 +98,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); -void endProfile(trace::Call &call); +void beginProfile(trace::Call &call, bool isDraw); +void endProfile(trace::Call &call, bool isDraw); -void setActiveProgram(GLuint program); } /* namespace glretrace */ -GLuint retrace_unmap_program(GLuint val); #endif /* _GLRETRACE_HPP_ */