iOS window now handles ContextSettings with stencil bits correctly
This commit is contained in:
parent
9b0ce8888e
commit
2cab5789af
@ -58,6 +58,8 @@
|
||||
#define GLEXT_GL_FRAMEBUFFER GL_FRAMEBUFFER_OES
|
||||
#define GLEXT_GL_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING_OES
|
||||
#define GLEXT_GL_RENDERBUFFER GL_RENDERBUFFER_OES
|
||||
#define GLEXT_GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES
|
||||
#define GLEXT_GL_STENCIL_ATTACHMENT GL_STENCIL_ATTACHMENT_OES
|
||||
#define GLEXT_GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_OES
|
||||
#define GLEXT_GL_DEPTH_ATTACHMENT GL_DEPTH_ATTACHMENT_OES
|
||||
#define GLEXT_GL_FRAMEBUFFER_COMPLETE GL_FRAMEBUFFER_COMPLETE_OES
|
||||
|
@ -138,7 +138,9 @@ void EaglContext::recreateRenderBuffers(SFView* glView)
|
||||
if (m_settings.depthBits > 0)
|
||||
{
|
||||
// Find the best internal format
|
||||
GLenum format = m_settings.depthBits > 16 ? GL_DEPTH_COMPONENT24_OES : GL_DEPTH_COMPONENT16_OES;
|
||||
GLenum format = m_settings.depthBits > 16
|
||||
? (m_settings.stencilBits == 0 ? GL_DEPTH_COMPONENT24_OES : GL_DEPTH24_STENCIL8_OES)
|
||||
: GL_DEPTH_COMPONENT16_OES;
|
||||
|
||||
// Get the size of the color-buffer (which fits the current size of the GL view)
|
||||
GLint width, height;
|
||||
@ -150,6 +152,8 @@ void EaglContext::recreateRenderBuffers(SFView* glView)
|
||||
glBindRenderbufferOES(GL_RENDERBUFFER_OES, m_depthbuffer);
|
||||
glRenderbufferStorageOES(GL_RENDERBUFFER_OES, format, width, height);
|
||||
glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_DEPTH_ATTACHMENT_OES, GL_RENDERBUFFER_OES, m_depthbuffer);
|
||||
if (m_settings.stencilBits > 0)
|
||||
glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_STENCIL_ATTACHMENT_OES, GL_RENDERBUFFER_OES, m_depthbuffer);
|
||||
}
|
||||
|
||||
// Make sure that everything's ok
|
||||
|
Loading…
Reference in New Issue
Block a user