X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=retrace%2Fglretrace.hpp;h=95a6d7596df230e8dd059194c493bbf58055cad3;hb=cbb86175e81c2765f14fa01a2dc49d367203ac1f;hp=11f4d27574dd1a05bd7ec88a001a9b64db94d44a;hpb=56ad11c7849c7e6ca0ad66558cb1a99c58d4cd3d;p=apitrace diff --git a/retrace/glretrace.hpp b/retrace/glretrace.hpp index 11f4d27..95a6d75 100644 --- a/retrace/glretrace.hpp +++ b/retrace/glretrace.hpp @@ -35,27 +35,40 @@ namespace glretrace { struct Context { Context(glws::Context* context) : wsContext(context), + 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 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); @@ -63,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);