if(EXT_framebuffer_object)
{
+ int old_id;
+ glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &old_id);
+ if(old_id)
+ glBindFramebuffer(GL_DRAW_FRAMEBUFFER_BINDING, 0);
+
int value;
glGetFramebufferAttachmentParameteriv(GL_DRAW_FRAMEBUFFER, GL_BACK, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, &value);
if(value==GL_NONE)
glGetFramebufferAttachmentParameteriv(GL_DRAW_FRAMEBUFFER, GL_STENCIL, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, &value);
if(value!=GL_NONE)
sys_format = (sys_format, STENCIL_ATTACHMENT);
+
+ if(old_id)
+ glBindFramebuffer(GL_DRAW_FRAMEBUFFER_BINDING, old_id);
}
else
// Make a guess if we can't query the format