Drawing menu versus drawing game
I am wondering about how deal with deciding which needs to be draw on a given cycle of my game: the game view or a menu view. In a pure OpenGL version, I would have a game state variable the would tell the render() method which one to draw.
But I am confused about how to do this in a standard iPhone (UIKit) arrangement. If I have a root view controller that controls the game view and menu views, where does the main loop belong? In the AppDelegate class, or down in the game view class? But then I would still need a way to communicate back up to the AppDelegate in order to switch between views...
But I am confused about how to do this in a standard iPhone (UIKit) arrangement. If I have a root view controller that controls the game view and menu views, where does the main loop belong? In the AppDelegate class, or down in the game view class? But then I would still need a way to communicate back up to the AppDelegate in order to switch between views...
Why not just do a pure OpenGL version of it and be done with it? Mixing in UIKit widgets with your OpenGL stuff can kill performance anyway. I fiddled with trying to play moderator between OpenGL and UIKit for long enough and simply gave up. There just isn't enough machine available to reliably do both IMHO. You *can*, but it's a trick sometimes, which I don't think is worth the trouble.
I'm sorry, I shouldn't have said UIKit...I meant MVC and all that. If I have to use a UIViewController to swap views between a game view and one or more menu views, where does that fit in with the game's main loop?
I'm no expert but I think a few developers here (myself included) have a single view for all drawing and manage the state like you mentioned in your first post as a pure OpenGL version.
I'm with monteboyd, and have only one glView and skip any MVC for games.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| OpenGL Cube drawing: VBOs, instanced geometry, octrees | Symbol$ | 5 | 6,018 |
Dec 23, 2011 01:43 PM Last Post: Skorche |
|
| obj versus .h models | OptimisticMonkey | 3 | 2,135 |
Jul 27, 2010 07:46 AM Last Post: OptimisticMonkey |
|
| OpenGL ES : Drawing Text... | savage | 8 | 8,060 |
Jan 4, 2010 08:59 PM Last Post: alerus |
|
| Drawing Anti-Aliased Shapes With Open GL | muleskinner | 4 | 3,457 |
Nov 17, 2009 10:01 AM Last Post: warmi |
|
| openGL n00b looking for FBO drawing examples or direction | auptown | 5 | 5,642 |
Nov 4, 2009 02:16 AM Last Post: Eskema |
|

