X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=retrace%2Fglretrace_cgl.cpp;h=613ee81d237073b9d272afd6c87becce1f188e01;hb=c63617dd4ea8a212e56b79e845917915e36776d2;hp=1197015b167ced08a9f44fc874a8872d6b24f83b;hpb=46ff42d9aaddfd35cd655f546d9b41fe84588011;p=apitrace diff --git a/retrace/glretrace_cgl.cpp b/retrace/glretrace_cgl.cpp index 1197015..613ee81 100644 --- a/retrace/glretrace_cgl.cpp +++ b/retrace/glretrace_cgl.cpp @@ -235,9 +235,12 @@ static void retrace_CGLSetCurrentContext(trace::Call &call) { static void retrace_CGLFlushDrawable(trace::Call &call) { - if (currentDrawable && currentContext) { + unsigned long long ctx = call.arg(0).toUIntPtr(); + Context *context = getContext(ctx); + + if (context) { if (retrace::doubleBuffer) { - currentDrawable->swapBuffers(); + context->drawable->swapBuffers(); } else { glFlush(); } @@ -287,7 +290,7 @@ static void retrace_CGLTexImageIOSurface2D(trace::Call &call) { GLvoid * pixels = NULL; - if (glretrace::currentContext != context) { + if (glretrace::getCurrentContext() != context) { if (retrace::debug) { retrace::warning(call) << "current context mismatch\n"; }