Game Development Reference
In-Depth Information
CCLiquid ). The downside is that the 3D effects may show visual artifacts unless you
enable depth buffering, which requires more memory and has a negative impact on ren-
dering performance.
Figure 3-15 . The CCPageTurn3D action in action
To enable depth buffering in a cocos2d application, you have to change the line where
EAGLView is initialized in your project's AppDelegate.m file. You do this by
changing the depthFormat parameter from its default value 0 to either
GL_DEPTH_COMPONENT16_OES for a 16-bit depth buffer or
GL_DEPTH_COMPONENT24_OES for a 24-bit depth buffer:
CCGLView *glView = [CCGLView viewWithFrame:[window_ bounds]
pixelFormat:kEAGLColorFormatRGB565
depthFormat:GL_DEPTH_COMPONENT16_OES
preserveBackbuffer:NO
sharegroup:nil
multiSampling:NO
numberOfSamples:0];
Kobold2D users can make this change in the config.lua file by modifying the
GLViewDepthFormat parameter as follows:
GLViewDepthFormat = GLViewDepthFormat.Depth16Bit,
 
Search Nedrilad ::




Custom Search