+GLenum get_gl_buffer_bits(const FrameFormat &format)
+{
+ GLenum bits = 0;
+ for(FrameAttachment a: format)
+ {
+ if(get_attach_point(a)==get_attach_point(DEPTH_ATTACHMENT))
+ bits |= GL_DEPTH_BUFFER_BIT;
+ else if(get_attach_point(a)==get_attach_point(STENCIL_ATTACHMENT))
+ bits |= GL_STENCIL_BUFFER_BIT;
+ else
+ bits |= GL_COLOR_BUFFER_BIT;
+ }
+ return bits;
+}
+