cocos2dx3.5 HTC One X 某些UI白屏或使用ClippingNode造成部分手机白屏

    public Cocos2dxGLSurfaceView onCreateView() {
        Cocos2dxGLSurfaceView glSurfaceView = new Cocos2dxGLSurfaceView(this);
        //this line is need on some device if we specify an alpha bits
        if(this.mGLContextAttrs[3] > 0) glSurfaceView.getHolder().setFormat(PixelFormat.TRANSLUCENT);

        Cocos2dxEGLConfigChooser chooser = new Cocos2dxEGLConfigChooser(this.mGLContextAttrs);
        glSurfaceView.setEGLConfigChooser(chooser);
        if(Cocos2dxHelper.getDeviceModel().indexOf("HTC One X") != -1){
        	glSurfaceView.setEGLConfigChooser(5, 6, 5, 0, 16, 8);
        }
        return glSurfaceView;
    }

在Cocos2dxActivity文件代码加入上面对htc one x的判断

 

posted @ 2016-02-17 15:09  沉浮天宝  阅读(394)  评论(0编辑  收藏  举报