Frontend/Cocos2D JS

[Cocos2D 에러잡기] initGLContextAttrs

에반황 2016. 12. 22. 17:58


이 글은 PC 버전 TISTORY에 최적화 되어있습니다.


에러코드




Assert failed: Unsupported format for depth and stencil buffers. Using default

Assertion failed: (0), function convertAttrs, file /Users/Hwang/Desktop/TutorialV3CPP/cocos2d/cocos/platform/ios/CCGLViewImpl-ios.mm, line 107.



해결법

AppDelegate 파일들의 추가된 내용이 빠져있는 예제를 돌리다가 생길 수 있다(최신 버전 받으면 기본적으로 들어가 있음), 빠지면 에러를 뿜어낸다.






[AppDelegate.h]


virtual void initGLContextAttrs(); // 추가








[AppDelegate.cpp]



void AppDelegate::initGLContextAttrs() // 추가

{

    // set OpenGL context attributes: red,green,blue,alpha,depth,stencil

    GLContextAttrs glContextAttrs = {8, 8, 8, 8, 24, 8};

    

    GLView::setGLContextAttrs(glContextAttrs);

}







반응형