无法设置深度缓冲区?
在一些cocos2d-iphone文档中,我被告知要把这个
// 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];
允许在我的游戏中使用一些 3D 效果和动作。但是,由于某种原因,XCode 无法识别 setDepthBufferFormat
和 kDepthBuffer16
。有什么想法吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,cocos2d 文档部分已过时。你提到的方法已经不存在了。相反,您必须修改应用程序委托方法 applicationDidFinishLaunching 中初始化 EAGLView 的行。有一个“viewWithFrame”变体,它采用 heightFormat 的额外参数:
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: