1 #include <msp/gl/extensions/ext_framebuffer_object.h>
2 #include "frameformat.h"
3 #include "frameformat_backend.h"
9 unsigned get_gl_attachment(FrameAttachment fa)
11 if(get_attach_point(fa)==get_attach_point(DEPTH_ATTACHMENT))
12 return GL_DEPTH_ATTACHMENT;
13 else if(get_attach_point(fa)==get_attach_point(STENCIL_ATTACHMENT))
14 return GL_STENCIL_ATTACHMENT;
16 return GL_COLOR_ATTACHMENT0+get_attach_point(fa);
19 unsigned get_gl_buffer_bits(const FrameFormat &format)
22 for(FrameAttachment a: format)
24 if(get_attach_point(a)==get_attach_point(DEPTH_ATTACHMENT))
25 bits |= GL_DEPTH_BUFFER_BIT;
26 else if(get_attach_point(a)==get_attach_point(STENCIL_ATTACHMENT))
27 bits |= GL_STENCIL_BUFFER_BIT;
29 bits |= GL_COLOR_BUFFER_BIT;