X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fframeformat.cpp;h=7fe179331abad0f9e1d70859e0da500ae142378b;hb=df9119a9bf2d348a513c515ed92953353da97b54;hp=f023aba799a59d19cde92ae5e09f7f4fdb9f603d;hpb=9904aa3d09458098541fdce0114785d6bce1777f;p=libs%2Fgl.git diff --git a/source/core/frameformat.cpp b/source/core/frameformat.cpp index f023aba7..7fe17933 100644 --- a/source/core/frameformat.cpp +++ b/source/core/frameformat.cpp @@ -1,17 +1,13 @@ #include "deviceinfo.h" #include "error.h" #include "frameformat.h" +#include "gl.h" using namespace std; namespace Msp { namespace GL { -FrameFormat::FrameFormat(): - count(0), - samples(1) -{ } - FrameFormat::FrameFormat(FrameAttachment fa): count(1), samples(1) @@ -36,8 +32,8 @@ FrameFormat FrameFormat::operator,(PixelFormat pf) const throw invalid_operation("FrameFormat::operator,"); FrameFormat r = *this; - UInt16 &fa = r.attachments[r.count-1]; - fa = make_typed_attachment(static_cast(fa), pf); + FrameAttachment &fa = r.attachments[r.count-1]; + fa = make_typed_attachment(fa, pf); return r; } @@ -48,8 +44,8 @@ FrameFormat FrameFormat::operator,(unsigned index) const throw invalid_operation("FrameFormat::operator,"); FrameFormat r = *this; - UInt16 &fa = r.attachments[r.count-1]; - fa = make_indexed_attachment(static_cast(fa), index); + FrameAttachment &fa = r.attachments[r.count-1]; + fa = make_indexed_attachment(fa, index); return r; } @@ -104,7 +100,7 @@ FrameAttachment make_indexed_attachment(FrameAttachment fa, unsigned i) throw invalid_argument("make_indexed_attachment"); } -PixelFormat get_attachment_pixelformat(UInt16 fa) +PixelFormat get_attachment_pixelformat(FrameAttachment fa) { PixelComponents comp; if(get_attach_point(fa)==get_attach_point(DEPTH_ATTACHMENT)) @@ -123,15 +119,5 @@ PixelFormat get_attachment_pixelformat(UInt16 fa) return make_pixelformat(comp, type); } -GLenum 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); -} - } // namespace GL } // namespace Msp