My main view controller contains many sub-views. One such subview is a GLKView
linked up to a GLKViewController
. The GLKViewController
seems to be the one in charge of updating the GLKView
's display, and something automagical is calling that update function on the main thread.
One of my other views in this main view controller is a UITableView
. When the user is interacting with the table view, the GLKView
stops updating.
I'll admit, I am pretty new to OGL ES programming, so I'm not sure how to approach this. I need to get the GLKViewController
's
- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect;
method to be called on a separate thread from the main thread, so I can keep the GLKView
animating while the user is interacting with other elements.
GLKViewController is using a CADisplayLink to call update/draw at a frequency which matches your display refresh rate. When your tableview/scrollview starts tracking a touch, the run loop starts giving it all the priority. You may have to split out your own GLKView and CADisplayLink (instead of using GLKViewController), in order to modify the run loop mode of the CADisplayLink so that it will keep going even if the tableview/scrollview is tracking touches. See this discussion for more info:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With