views:

1376

answers:

1

I'm playing around with a really simple game for the iPhone based on the CrashLanding example on the developer center. I've extended it a little so that rather than using OpenGL for display all the time I have a plain UIView as the title screen, a UITableView for a high scores screen and an unmodified EAGLView for the game screen.

So all works well setup like this except that when I try and re-display the EAGLView the screen stops updating. I have a game loop that starts and stops when the screen is displayed and hidden and I initially thought that this wasn't restarting but through debugging the application that all seems good. I then thought that maybe I needed to recreate the OpenGL surface when it's redisplayed so I did and the screen went from all black to all pink.

I'm using a UINavigationController to handle moving between views. The error happens after going from the root view controller (Title screen) to the EAGLView (game screen) then going back to the root view controller and going to the game screen again.

Any info/help would be greatly appreciated!

A: 

Many months later...

This turned out to be an issue with using the EAGLView inside a UIViewController. To fix it I pulled the EAGLView out and sat it behind the controller. So to show it I just have to hide the controller. Not so nice but it allows me to switch between it and other views without any issues.

Max Stewart
Max I'm actually experiencing something similar getting a pink screen on render of an EAGLView. In your solution you mention pulling out the EAGLView and sitting it behind the controller. What exactly do you mean by this? Any help you can offer would be great.
Rob Segal