X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=retrace%2Fglretrace_ws.cpp;h=ab3c41af388009583be26f5190abf0a7f44d8ec1;hb=207ced34a8b998539414c5213acc6d7a393ca27a;hp=5ae908fc6c75a3cfffee7fb1d33077f65b090c95;hpb=f74ad0d7b108d0b628e2290a4b6c597e9a13ee8e;p=apitrace diff --git a/retrace/glretrace_ws.cpp b/retrace/glretrace_ws.cpp index 5ae908f..ab3c41a 100644 --- a/retrace/glretrace_ws.cpp +++ b/retrace/glretrace_ws.cpp @@ -122,7 +122,16 @@ createContext(Context *shareContext) { } -static thread_specific Context * +Context::~Context() +{ + //assert(this != getCurrentContext()); + if (this != getCurrentContext()) { + delete wsContext; + } +} + + +static OS_THREAD_SPECIFIC_PTR(Context) currentContextPtr; @@ -153,9 +162,6 @@ makeCurrent(trace::Call &call, glws::Drawable *drawable, Context *context) return false; } - if (currentContext) { - currentContext->drawable = NULL; - } currentContextPtr = context; if (drawable && context) { @@ -208,6 +214,9 @@ updateDrawable(int width, int height) { return; } + width = std::max(width, currentDrawable->width); + height = std::max(height, currentDrawable->height); + // Check for bound framebuffer last, as this may have a performance impact. GLint draw_framebuffer = 0; glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &draw_framebuffer);