]> git.tdb.fi Git - libs/gl.git/commitdiff
Remove the View and Framebuffer constructors from Sequence
authorMikko Rasa <tdb@tdb.fi>
Fri, 24 Sep 2021 21:41:51 +0000 (00:41 +0300)
committerMikko Rasa <tdb@tdb.fi>
Fri, 24 Sep 2021 21:44:22 +0000 (00:44 +0300)
They had no other purpose than to take the size from the other object,
and that fits better in SequenceBuilder.

source/builders/sequencebuilder.cpp
source/render/sequence.cpp
source/render/sequence.h
tools/viewer.cpp

index 8fd4b956a3287efbc9dfc2cf19be92f1151e94b2..300ba23846ae5eba8571194a915119b4327dc370 100644 (file)
@@ -6,6 +6,7 @@
 #include "sequence.h"
 #include "sequencebuilder.h"
 #include "sequencetemplate.h"
+#include "view.h"
 
 using namespace std;
 
@@ -95,14 +96,14 @@ Sequence *SequenceBuilder::build(unsigned w, unsigned h) const
 
 Sequence *SequenceBuilder::build(const View &view) const
 {
-       RefPtr<Sequence> sequence = new Sequence(view, create_frame_format());
+       RefPtr<Sequence> sequence = new Sequence(view.get_width(), view.get_height(), create_frame_format());
        build(*sequence);
        return sequence.release();
 }
 
 Sequence *SequenceBuilder::build(const Framebuffer &fbo) const
 {
-       RefPtr<Sequence> sequence = new Sequence(fbo, create_frame_format());
+       RefPtr<Sequence> sequence = new Sequence(fbo.get_width(), fbo.get_height(), create_frame_format());
        build(*sequence);
        return sequence.release();
 }
index e953b4d6925944b10d872301ef35667a7904f857..d5b3ae94f9634a827865d9cdec0c11d2224fbb22 100644 (file)
@@ -7,34 +7,17 @@
 #include "renderer.h"
 #include "sequence.h"
 #include "texture2d.h"
-#include "view.h"
 
 using namespace std;
 
 namespace Msp {
 namespace GL {
 
-Sequence::Sequence(unsigned w, unsigned h, const FrameFormat &f)
+Sequence::Sequence(unsigned w, unsigned h, const FrameFormat &f):
+       width(w),
+       height(h),
+       target_format(f)
 {
-       init(w, h, f);
-}
-
-Sequence::Sequence(const View &view, const FrameFormat &f)
-{
-       init(view.get_width(), view.get_height(), f);
-}
-
-Sequence::Sequence(const Framebuffer &fbo, const FrameFormat &f)
-{
-       init(fbo.get_width(), fbo.get_height(), f);
-}
-
-void Sequence::init(unsigned w, unsigned h, const FrameFormat &f)
-{
-       width = w;
-       height = h;
-       target_format = f;
-
        if(!target_format.empty())
        {
                FrameFormat postproc_fmt = target_format;
index 00211b006ef4f119c13f292a4b4c885f71dfb10c..0bc65cb78e5f1c5d410b4d5cbc52ca6e4a18adf1 100644 (file)
@@ -19,7 +19,6 @@ class Camera;
 class Clipping;
 class Lighting;
 class PostProcessor;
-class View;
 
 /**
 Top-level content class.  Typically a Sequence is used as the content
@@ -86,11 +85,6 @@ private:
 
 public:
        Sequence(unsigned, unsigned, const FrameFormat & = FrameFormat());
-       Sequence(const View &, const FrameFormat & = FrameFormat());
-       Sequence(const Framebuffer &, const FrameFormat & = FrameFormat());
-private:
-       void init(unsigned, unsigned, const FrameFormat &);
-public:
        ~Sequence();
 
        const FrameFormat &get_target_format() { return target_format; }
index 2c950e18e2acc22714ee9d3030ed7467371a0fe0..20c11c311a61e92efd59ced67d8b3a8c91be9ca2 100644 (file)
@@ -234,7 +234,7 @@ Viewer::Viewer(int argc, char **argv):
 
        if(!sequence)
        {
-               sequence = new GL::Sequence(view);
+               sequence = new GL::Sequence(view.get_width(), view.get_height());
                GL::Sequence::Step &step = sequence->add_step(0, *renderable);
                step.set_lighting(&lighting);
                step.set_depth_test(GL::LEQUAL);