Baxpin
Baxpin

Reputation: 65

GLKViewController inside a ViewController inside a Navigation Controller

I'm not certain why this isn't working, but maybe someone here can shed some light on what the problem might be. I am working on game based on the XCode OpenGL template. I have a small GLKViewController with a view that does not take up the full screen area, so I'm creating it inside another UIViewController that does have a full screen view as a container. This works, and my update/draw methods are called as I would expect.

However, when I take my container view (with the GLKViewController inside it) and try to initialize it inside a UINavigationController as the rootViewController, the update method for the GLKViewController never gets called, and the draw methods is called exactly once.

This view hieracrhy works fine if there is no UINavigationController, however as soon as it's added, it does not work. I have verified that the viewDidLoad for the GLKViewController is being called. The context is initialized, because I can see the first frame, but after that it looks like the draw/update messages are being swallowed up. I can get around this by not using a navigation controller for this particular view, but I'd like to understand why this does not work. Any idea on what might be happening to the draw/update functions?

Upvotes: 2

Views: 1783

Answers (1)

drhelius
drhelius

Reputation: 76

I recently managed to get GLKViewController running inside a Master/Detail view controller and faced this same problem.

Did you check that GLKViewController is not paused?

This would fire the update loop:

self.paused = NO;

Upvotes: 4

Related Questions