OpenGL ES does not have glDrawBuffer, so this logic change makes porting
a bit easier.
color_bufs.push_back(attch.attachment);
}
- if(color_bufs.empty())
- {
- glDrawBuffer(GL_NONE);
- glReadBuffer(GL_NONE);
- }
- else if(color_bufs.size()==1)
- {
- glDrawBuffer(color_bufs.front());
- glReadBuffer(color_bufs.front());
- }
- else
- {
+ if(color_bufs.size()>1)
static Require _req(ARB_draw_buffers);
+
+ GLenum first_buffer = (color_bufs.empty() ? GL_NONE : color_bufs.front());
+ if(ARB_draw_buffers)
glDrawBuffers(color_bufs.size(), &color_bufs[0]);
- glReadBuffer(color_bufs.front());
- }
+ else
+ glDrawBuffer(first_buffer);
+
+ glReadBuffer(first_buffer);
}
else
dirty |= mask;