
I'm having a problem when trying to build for iOS. It compiles/build without errors,but when it's trying to run the game throws this assert error:
Assert Failed: Unsupported format for depth and stencil buffers. Using default
Assertion Failed: (0),function convertAttrs,file /Users/spacolino/development/games/boringame/cocos2d/cocos/platform/ios/CCGLVIEwImpl-ios.mm,line 107.
In source it looks like this:
if(_glContextAttrs.depthBits==24 && _glContextAttrs.stencilBits==8){ _depthFormat = GL_DEPTH24_STENCIL8_OES;} else if (_glContextAttrs.depthBits==0 && _glContextAttrs.stencilBits==0){ _depthFormat = 0;} else{ CCASSERT(0,"Unsupported format for depth and stencil buffers. Using default");} }
Do I have to set some depth format or stencil buffer? Or?
I've trIEd it on simulator and iphone 5s. It gives the same error.
If you need any additional info please tell me.
Thank you!
created Jul 25 last reply Jul 25 1 reply 84 views user spacolino Jul 25Found the problem. I had to add in AppDelegate:
voID AppDelegate::initGLContextAttrs(){ // set OpenGL context attributes: red,green,blue,Alpha,depth,stencil GLContextAttrs glContextAttrs = {8,8,24,8}; GLVIEw::setGLContextAttrs(glContextAttrs);} I was porting my game from an older 3.4 version to 3.12. If you compare test examples or generated projects of an older Cocos2dx 3.4 version with 3.12 you'll see the difference. Hope it helps to someone.
总结以上是内存溢出为你收集整理的cocos2dx 3.12 iOS build assert error cocos2d-x C++全部内容,希望文章能够帮你解决cocos2dx 3.12 iOS build assert error cocos2d-x C++所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)