i try to set up an Xcode project based on the template "OpenGL Game". That example has a StoryBoard with one GLKViewController and one GLKView.
I'd like to have:
- one GLKView filling half the screen
- one GLKView filling part of the other half
- different things drawn in the two GLKViews
The problem: - I can't seem to put two GLKViews onto a screen when using a StoryBoard - I can't get GLKViews to work when using a NIB file
I wonder if any of the two ways is possible and what would be the best way to proceed.
Even when setting up just one GLKView and GLKViewController in a NIB file it seems that neither the method update: is called nor the glkView:drawInRect: of the GLKViewController.
How can i best place two GLKViews into an iPad app onto the same screen?
EDIT: Sorry for being imprecise.
Basically what i want to do:
- I want to write an App that uses one screen
- in one half of the screen i want one View in which i draw OpenGL
- in one quarter i want another View in which i draw different OpenGL
- in the rest there should be some buttons
I use Xcode 4.2 for iOS 5.1 for iPad
First approach, use a StoryBoard:
- i can only place one large GLKView in which i draw OpenGL, no independent other GLKView
- the example OpenGL code in that GLKView (using the GLKViewController) works fine though.
Second approach, delete the StoryBoard and create a NIB file:
- i can place one GLKView into a Window, a GLKViewController-subclass next to it and link it to the GtkView, but there is nothing drawn in it
- i can place a second GLKView into the window, a different GLKViewController-subclass next to it but there isn't anything drawn in both GLKView.
- i used the GLKView / GLKViewController example that worked fine in a StoryBoard.
Any way would be fine with me, at the moment none works.
Thanks for any hints, Torsten.
SOLVED: I use a NIB file now and i added a PRECONFIGURED combination of GLKViewController / GLKView. Just placing a UIView and a UIViewController and then changing their type does not work.