Multiple OpenGL views

Posts: 9
Joined: 2008.12
Post: #1
Im trying to put together a little game, it has several scenes and i figured each scene could be an EAGLView extension. Then i could set the active view and have the active view run its gameloop.

Problem im seeing is when i add the second EAGLView to the UIWindow i get the following error:

failed to make complete framebuffer object

Heres what im doing:

view1 = [[EAGLView alloc] initWithFrame:rect];
view2 = [[EAGLView alloc] initWithFrame:rect];
[window addSubview:view1];
[window addSubview:view2];

Any thoughts?
Quote this message in a reply
Posts: 1,234
Joined: 2002.10
Post: #2
If you're only showing one scene at a time, you only need one view.

Multiple views are for when you really have multiple simultaneous views. Like in a CAD application.
Quote this message in a reply
Posts: 9
Joined: 2008.12
Post: #3
I figured this may be a smart way to set up the state machine, allow the front view to be the current state. It turning out to be more trouble than its worth.
I've rewritten it to use a normal state machine. Setting up a single full screen OpenGL view and having each game state class write the OpenGL instructions.

Thanks for your response.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Multiple XIB or Views Jerm #1 1 4,686 Feb 2, 2010 02:10 AM
Last Post: Newbrof
  Messaging between separate views Toontingy 0 3,039 Jan 9, 2010 05:10 PM
Last Post: Toontingy
  OpenGL ES 2d game - multiple EAGL Views or not? Elphaba 4 6,772 Aug 4, 2009 10:42 AM
Last Post: maximile
  views and OpenGL jeffro 0 2,849 Jan 20, 2009 11:18 PM
Last Post: jeffro
  Maintain variables across multiple Views masumbuet 1 3,300 Dec 17, 2008 06:42 AM
Last Post: pierre