-(CCScene*) makeCoinGardenScene { return [[CoinGardenLayer layer] asCCScene]; }
-(CCGLView*) createGLView {
// Create the view first, since it creates the GL context, which CCDirector expects during init.
CCGLView* glView = [CCGLView viewWithFrame: self.cc3FrameView.bounds
pixelFormat: kEAGLColorFormatRGB565
depthFormat: GL_DEPTH24_STENCIL8 // Shadow volumes require a stencil
preserveBackbuffer: NO
numberOfSamples: 4];
#if CC3_CC2_1
CCDirector.directorType = kCCDirectorTypeDisplayLink;
#endif
CCDirector* director = CCDirector.sharedDirector;
director.animationInterval = (1.0f / kAnimationFrameRate);
director.displayStats = YES;
[director setCcGLView:glView];
if ([director runningScene]) {
[director replaceScene: [self makeCoinGardenScene]];
} else {
[director runWithScene: [self makeCoinGardenScene]];
}
return glView;
}
-(void) initializeScene {
// Create the camera, place it back a bit, and add it to the scene
CC3Camera* cam = [CC3Camera nodeWithName: @"Camera"];
cam.location = cc3v( 0.0, 0.0, 18.0 );
[self addChild: cam];
// // Create a light, place it back and to the left at a specific
// // position (not just directional lighting), and add it to the scene
CC3Light* lamp = [CC3Light nodeWithName: @"Lamp"];
lamp.location = cc3v( -2.0, 0.0, 0.0 );
lamp.isDirectionalOnly = NO;
[cam addChild: lamp];
self.opacity = kCCOpacityFull;
[self createBoundingVolumes];
[self createGLBuffers];
[self releaseRedundantContent];
LogInfo(@"The structure of this scene is: %@", [self structureDescription]);
}
[info] CC3Camera 'Camera':2
moving to: (inf, inf, inf)
pointing towards: (-0.000, -0.000, -18.000)
near clipping distance: 1.000
far clipping distance: 1000.000
to show all of: CoinGardenScene 'CoinGardenScene':1
[***ERROR***] [***GL ERROR***] GL_INVALID_FRAMEBUFFER_OPERATION: Operation not allowed on frame buffer from glPushGroupMarkerEXT(0, CoinGardenLayer on CoinGardenScene 'CoinGardenScene':1). To disable this assertion and just log the GL error, set the preprocessor macro GL_ERROR_ASSERTION_ENABLED=0 in your project build settings.
2016-04-25 12:42:51.863 Coin Garden[29418:3779287] *** Assertion failure in void DoLogGLErrorState(NSString *, ...)(), /Users/vladmiller/Library/cocos3d-2.0.2/cocos3d/cocos3d/OpenGL/CC3OpenGLFoundation.m:105
2016-04-25 12:42:51.881 Coin Garden[29418:3779287] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'See previous logged error.'
*** First throw call stack:
(
0 CoreFoundation 0x000000010a8add85 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000109e66deb objc_exception_throw + 48
2 CoreFoundation 0x000000010a8adbea +[NSException raise:format:arguments:] + 106
3 Foundation 0x0000000108d75e1e -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] + 169
4 Coin Garden 0x000000010694880e DoLogGLErrorState + 942
5 Coin Garden 0x0000000106a3aeaa -[CC3OpenGL pushGroupMarkerC:] + 90
6 Coin Garden 0x000000010691542a -[CC3LayerRenderCommand invokeOnRenderer:] + 106
7 Coin Garden 0x0000000106b89a01 -[CCRenderer flush] + 481
8 Coin Garden 0x0000000106a720fb -[CCDirectorIOS drawScene] + 891
9 Foundation 0x0000000108ce1242 -[NSObject(NSThreadPerformAdditions) performSelector:onThread:withObject:waitUntilDone:modes:] + 1085
10 Foundation 0x0000000108d54054 -[NSObject(NSThreadPerformAdditions) performSelector:onThread:withObject:waitUntilDone:] + 120
11 Coin Garden 0x0000000106a7302f -[CCDirectorIOS runWithScene:] + 703
12 Coin Garden 0x00000001068c3f4c -[ThreeDViewController createGLView] + 540
13 Coin Garden 0x00000001068c3a90 -[ThreeDViewController viewDidLoad] + 112
........
)