X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fframeformat.cpp;h=649693a43715a94b02974501148b21e4bc576592;hb=e70662d7812464159f2e47f4bebb69d88f89ae93;hp=3b114e7f2f0ebd01da02ea39ce5edd72f64e2be8;hpb=a4d83d3748cdde8cf30683d36a040d3dfacfd693;p=libs%2Fgl.git diff --git a/source/core/frameformat.cpp b/source/core/frameformat.cpp index 3b114e7f..649693a4 100644 --- a/source/core/frameformat.cpp +++ b/source/core/frameformat.cpp @@ -1,4 +1,3 @@ -#include "deviceinfo.h" #include "error.h" #include "frameformat.h" @@ -7,11 +6,6 @@ using namespace std; namespace Msp { namespace GL { -FrameFormat::FrameFormat(): - count(0), - samples(1) -{ } - FrameFormat::FrameFormat(FrameAttachment fa): count(1), samples(1) @@ -84,7 +78,9 @@ FrameAttachment make_typed_attachment(FrameAttachment fa, PixelFormat pf) } else { - if(comp!=RED && comp!=RG && comp!=RGB && comp!=RGBA) + if(comp!=RED && comp!=RG && comp!=RGB && comp!=RGBA && comp!=BGR && comp!=BGRA) + throw invalid_argument("make_typed_attachment"); + if(get_required_swizzle(comp)) throw invalid_argument("make_typed_attachment"); } @@ -123,15 +119,5 @@ PixelFormat get_attachment_pixelformat(FrameAttachment 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