I’m trying to wrap my head around the EAGLView in OF and how openGL is drawn. I’m currently having an issue where UIKit elements are sometimes slow and I’m curious if it’s because openGL is drawn on the main thread and it’s slowing down the UI calls. From what I understand, it’s best to leave the mainThread for UIKit elements and move openGL and other things to another thread.
Has anyone tried this or have tips how OF could be modified to move openGL so another thread? Or is that what displayLink is already doing (has it’s own thread)?
I’m still testing, but this looks like it could be a good candidate for core integration.
It has examples of threaded, single (what we currently use), and GCD (which I think is iOS 4.0 only) openGL implementation: https://github.com/Volcore/LimbicGL
I was able to implement the Threaded example into OF, but I’m still testing. So far it seems a lot better. Loading new UIViewControllers or UIViews no longer stall the openGL or audio thread. It does delay the menu from loading right away (if it takes time to load), but it’s better than stalling the whole application.
I’m not sure I’m integrating it entirely right though so it would be great if someone could help review. There’s currently some [glView lock] and [glView unlock] commands that I can’t figure out. I don’t think they actually do anything, do they?