X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fpipeline.cpp;h=9e2976ab69e5dc4e383c413be18c9239ac786a94;hp=29c42324add861d9e7813ba252f4fde9217f20b5;hb=6109322ffc5dec1a777807fcbefacafe94d1d5eb;hpb=e07b25a160c5d3231282df948017460ac581b4d7 diff --git a/source/pipeline.cpp b/source/pipeline.cpp index 29c42324..9e2976ab 100644 --- a/source/pipeline.cpp +++ b/source/pipeline.cpp @@ -9,20 +9,32 @@ #include "renderer.h" #include "tests.h" #include "texture2d.h" +#include "view.h" using namespace std; namespace Msp { namespace GL { -Pipeline::Pipeline(unsigned w, unsigned h, bool d): - camera(0), - width(w), - height(h), - hdr(d), - samples(0), - target_ms(0) +Pipeline::Pipeline(unsigned w, unsigned h, bool d) { + init(w, h); + hdr = d; +} + +Pipeline::Pipeline(const View &view) +{ + init(view.get_width(), view.get_height()); +} + +void Pipeline::init(unsigned w, unsigned h) +{ + camera = 0; + width = w; + height = h; + hdr = false; + samples = 0; + target_ms = 0; target[0] = 0; target[1] = 0; }