mirror of https://github.com/axmolengine/axmol.git
Fixed: #12645 iOS: depth/stencil buffers attributes are ignored
This commit is contained in:
parent
d155d42c0e
commit
363da2beab
|
@ -88,10 +88,23 @@ void GLViewImpl::convertAttrs()
|
||||||
if(_glContextAttrs.redBits==8 && _glContextAttrs.greenBits==8 && _glContextAttrs.blueBits==8 && _glContextAttrs.alphaBits==8)
|
if(_glContextAttrs.redBits==8 && _glContextAttrs.greenBits==8 && _glContextAttrs.blueBits==8 && _glContextAttrs.alphaBits==8)
|
||||||
{
|
{
|
||||||
_pixelFormat = kEAGLColorFormatRGBA8;
|
_pixelFormat = kEAGLColorFormatRGBA8;
|
||||||
|
} else if (_glContextAttrs.redBits==5 && _glContextAttrs.greenBits==6 && _glContextAttrs.blueBits==5 && _glContextAttrs.alphaBits==0)
|
||||||
|
{
|
||||||
|
_pixelFormat = kEAGLColorFormatRGB565;
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
CCASSERT(0, "Unsupported render buffer pixel format. Using default");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_glContextAttrs.depthBits==24 && _glContextAttrs.stencilBits==8)
|
if(_glContextAttrs.depthBits==24 && _glContextAttrs.stencilBits==8)
|
||||||
{
|
{
|
||||||
_depthFormat = GL_DEPTH24_STENCIL8_OES;
|
_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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -215,4 +228,3 @@ void GLViewImpl::setIMEKeyboardState(bool open)
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
||||||
#endif // CC_PLATFOR_IOS
|
#endif // CC_PLATFOR_IOS
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue