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();
}
GLvoid * pixels = NULL;
- if (glretrace::currentContext != context) {
+ if (glretrace::getCurrentContext() != context) {
if (retrace::debug) {
retrace::warning(call) << "current context mismatch\n";
}