]> git.tdb.fi Git - libs/gl.git/blobdiff - source/pipeline.cpp
Add a constructor to Pipeline which takes the size from a View
[libs/gl.git] / source / pipeline.cpp
index 29c42324add861d9e7813ba252f4fde9217f20b5..9e2976ab69e5dc4e383c413be18c9239ac786a94 100644 (file)
@@ -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;
 }