namespace Msp {
namespace GL {
-FrameFormat::FrameFormat():
- count(0),
- samples(1)
-{ }
-
FrameFormat::FrameFormat(FrameAttachment fa):
count(1),
samples(1)
return make_pixelformat(comp, type);
}
-unsigned get_gl_attachment(FrameAttachment fa)
-{
- if(get_attach_point(fa)==get_attach_point(DEPTH_ATTACHMENT))
- return GL_DEPTH_ATTACHMENT;
- else if(get_attach_point(fa)==get_attach_point(STENCIL_ATTACHMENT))
- return GL_STENCIL_ATTACHMENT;
- else
- return GL_COLOR_ATTACHMENT0+get_attach_point(fa);
-}
-
-unsigned get_gl_buffer_bits(const FrameFormat &format)
-{
- unsigned 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;
-}
-
} // namespace GL
} // namespace Msp