I am having an issue with an opengl view that is not updating WHILE THE WINDOW IS BEING RESIZED, but not actually changing the size of the window. If the window size is changed continuously, then a redraw will happen. I have a method animate which is on a timer that is in the NSRunLoopCommonModes. The timer is firing like normal, but a call to setNeedsDisplay in my animate method does not cause a redraw.
My understanding is that during a resize, the main run loop does not run, and I assume that setNeedsDisplay is only checked during the main run loop, which makes sense to me why it doesn't work, but I'm not sure what to do about it.
I have "fixed" it by checking inLiveResize in my animate method and calling display if so:
but I'm not sure that this is the optimal solution. It seems like some places online say to avoid using display, I can't find any other way to make a display happen.
Is this the right way to deal with this? Does anyone know of a better solution?
My understanding is that during a resize, the main run loop does not run, and I assume that setNeedsDisplay is only checked during the main run loop, which makes sense to me why it doesn't work, but I'm not sure what to do about it.
I have "fixed" it by checking inLiveResize in my animate method and calling display if so:
Code:
if ([self inLiveResize]) {
[self display];
} else {
[self setNeedsDisplay];
}
Is this the right way to deal with this? Does anyone know of a better solution?