MainViewController Class Reference
Inherits from | UIViewController |
Declared in | MainViewController.h |
Overview
The main application view controller.
An instance of this controller is instantiated in the main app Storyboard. This controller loads and manages different Cocos3D scenes, through user interaction with standard UI controls. This controller supports user selection of several separate 3D scenes, and coordinates the transition between them. When the user selects a different 3D scene, the new 3D scene is created and loaded, an animated transition is run from the old 3D scene to the new, and the old scene is released and deallocated.
Since the user interface allows the same 3D scene to be repeatedly loaded and removed, background resource loading cannot be used, because GL objects must be deleted using the same GL context on which they were loaded. To ensure we don’t run into trouble when 3D scenes are removed, this controller turns background loading off so that each 3D scene is loaded in the foreground.
Tasks
-
cc3FrameView
property -
sceneSelectorControl
property -
progressView
property -
– requestChange3DSceneFromSegmentControl:
Properties
cc3FrameView
This generic UIView is used as a container for the CCGLView view that displays the Cocos3D (and Cocos2D) scene. Since the CCGLView is created programmatically, this view is used within the Storyboard to define the size and position of the CCGLView. Once created programmatically, the CCGLView is added as a subview of this view, and made the same size as this view.
@property (strong, nonatomic) IBOutlet UIView *cc3FrameView
Declared In
MainViewController.h