In some cocos2d-iphone documentation, I was told to put this
// IMPORTANT: Call this function at the very beginning, before running your 1st scene
// Create a depth buffer of 24 bits
// These means that openGL z-order will be taken into account
[[CCDirector sharedDirector] setDepthBufferFormat:kDepthBuffer16];
To allow some 3D effects in my game with actions. However, for some reason, neither setDepthBufferFormat nor kDepthBuffer16 are recognized by XCode. Any ideas?
The cocos2d documentation is partially out of date, unfortunately. The method you mentioned no longer exists. Instead, you will have to modify the line in the app delegate method applicationDidFinishLaunching that initializes the EAGLView. There’s a “viewWithFrame” variant that takes the extra parameters of depthFormat: