X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Frender%2Fsequence.cpp;h=535e81859aa0dea0a8d403088abc8ae2ce819d6a;hp=d5b3ae94f9634a827865d9cdec0c11d2224fbb22;hb=d4e380914f02800b7d915a8748ac9ccd7029bc3b;hpb=31ae3e3c4a28ac2ec97cc3efaa25adbf1511aadc diff --git a/source/render/sequence.cpp b/source/render/sequence.cpp index d5b3ae94..535e8185 100644 --- a/source/render/sequence.cpp +++ b/source/render/sequence.cpp @@ -13,29 +13,29 @@ using namespace std; namespace Msp { namespace GL { +Sequence::Sequence(): + width(0), + height(0), + target{0, 0}, + target_ms(0) +{ } + Sequence::Sequence(unsigned w, unsigned h, const FrameFormat &f): width(w), height(h), - target_format(f) + target_format(f), + target_ms(0) { - if(!target_format.empty()) - { - FrameFormat postproc_fmt = target_format; - postproc_fmt.set_samples(1); - target[0] = new RenderTarget(width, height, postproc_fmt); - target[1] = new RenderTarget(width, height, postproc_fmt); - - if(target_format.get_samples()>1) - target_ms = new RenderTarget(width, height, target_format); - else - target_ms = 0; - } - else - { - target_ms = 0; - target[0] = 0; - target[1] = 0; - } + if(target_format.empty()) + throw invalid_argument("Sequence::Sequence"); + + FrameFormat postproc_fmt = target_format; + postproc_fmt.set_samples(1); + target[0] = new RenderTarget(width, height, postproc_fmt); + target[1] = new RenderTarget(width, height, postproc_fmt); + + if(target_format.get_samples()>1) + target_ms = new RenderTarget(width, height, target_format); } Sequence::~Sequence()