mrzacek mrzacek
mrzacek mrzacek

Reputation: 428

setWantsBestResolutionOpenGLSurface and flickering with multiple overlaying windows on retina

I'm using setWantsBestResolutionOpenGLSurface to enjoy the high DPI on retina. Everything works now except that if I have multiple windows overlaying each other (these are AU plugins), the drawing in the partially plugins randomly draws over the foreground windows causing a severe flickering. It does NOT do that when setWantsBestResolutionOpenGLSurface is not used, yet the code is pretty much exactly the same.

Upvotes: 0

Views: 591

Answers (1)

mrzacek mrzacek
mrzacek mrzacek

Reputation: 428

So this is the solution:

// Synchronize buffer swaps with vertical refresh rate.
GLint swapInt = 1;
[[self openGLContext] makeCurrentContext];
[[self openGLContext] setValues:&swapInt forParameter:NSOpenGLCPSwapInterval];

Fun fact: It doesn't do that without retina & there's no mentioning of this in the apple docs, so I can only assume this is yet another OSX bug.

Upvotes: 1

Related Questions