首页 > 代码库 > cocos3.2 cocos2dx Stencil buffer is not enabled

cocos3.2 cocos2dx Stencil buffer is not enabled

问题描述:

页面不显示,或者显示绿色,部分组件不显示,eclipse下面出现“cocos2dx Stencil buffer is not enabled”错误

解决方案:


在AppActivity.java加入如下代码:

public Cocos2dxGLSurfaceView onCreateView() {   
        Cocos2dxGLSurfaceView glSurfaceView = new Cocos2dxGLSurfaceView(this);   
        glSurfaceView.setEGLConfigChooser(5, 6, 5, 0, 16, 8);    
        return glSurfaceView;   
    }


如果xcode开发遇到上述问题,解决方法如下:


修改AppController.mm 中depthFormat为:GL_DEPTH24_STENCIL8_OES

注:cocos2dx 3.2xcode下好像没有这种问题发生!!

cocos3.2 cocos2dx Stencil buffer is not enabled