Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)setupCocos3D {
- static int a = 0;
- if(a == 0) {
- [[CCDirector sharedDirector] setOpenGLView:openGLView];
- ((ViewInterface*)[ViewInterface sharedViewInterface]).currentScene = [testScene scene];
- // Create the customized CC3Layer that supports 3D rendering.
- CC3Layer* cc3Layer = [HelloWorldLayer node];
- // Create the customized 3D scene and attach it to the layer.
- // Could also just create this inside the customer layer.
- cc3Layer.cc3Scene = ((ViewInterface*)[ViewInterface sharedViewInterface]).currentScene;
- // Assign to a generic variable so we can uncomment options below to play with the capabilities
- CC3ControllableLayer* mainLayer = cc3Layer;
- mainLayer.contentSize = CGSizeMake(2048, 1320);
- [CCDirector sharedDirector].animationInterval = (1.0f / kAnimationFrameRate);
- [CCDirector sharedDirector].displayStats = YES;
- [[CCDirector sharedDirector] enableRetinaDisplay: YES];
- ((ViewInterface*)[ViewInterface sharedViewInterface]).mainLayer = mainLayer;
- [[CCDirector sharedDirector] runWithScene:((ViewInterface*)[ViewInterface sharedViewInterface]).mainLayer];
- a++;
- }
- else {
- [[CCDirector sharedDirector] replaceScene:((ViewInterface*)[ViewInterface sharedViewInterface]).mainLayer];
- [[CCDirector sharedDirector] startAnimation];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement