]> git.tdb.fi Git - libs/gl.git/blobdiff - source/render/sequence.cpp
Move blend state from Sequence::Step to RenderMethod
[libs/gl.git] / source / render / sequence.cpp
index e0fb408fad95aa274d63171c5b8f5b012c56d50a..4ccf540809d4a3138f4e30e3d23a0ca3e0e35370 100644 (file)
@@ -12,6 +12,8 @@ using namespace std;
 namespace Msp {
 namespace GL {
 
+Tag Sequence::noclear_tag = "noclear";
+
 Sequence::Sequence(unsigned w, unsigned h, const FrameFormat &f):
        width(w),
        height(h),
@@ -105,7 +107,7 @@ void Sequence::finish_frame()
 
 void Sequence::render(Renderer &renderer, Tag tag) const
 {
-       if(tag.id)
+       if(tag.id && tag!=noclear_tag)
                return;
 
        Renderer::Push _push(renderer);
@@ -115,7 +117,7 @@ void Sequence::render(Renderer &renderer, Tag tag) const
        if(target[0])
                renderer.set_framebuffer(&(target_ms ? target_ms : target[0])->get_framebuffer());
 
-       if(clear_enabled)
+       if(clear_enabled && tag!=noclear_tag)
        {
                const Framebuffer *target_fbo = renderer.get_framebuffer();
                if(!target_fbo)
@@ -146,9 +148,8 @@ void Sequence::render(Renderer &renderer, Tag tag) const
 
                renderer.set_depth_test(&s.get_depth_test());
                renderer.set_stencil_test(&s.get_stencil_test());
-               renderer.set_blend(&s.get_blend());
 
-               if (const Lighting *lighting = s.get_lighting())
+               if(const Lighting *lighting = s.get_lighting())
                        renderer.add_shader_data(lighting->get_shader_data());
 
                if(const Renderable *renderable = s.get_renderable())
@@ -210,10 +211,5 @@ void Sequence::Step::set_stencil_test(const StencilTest &st)
        stencil_test = st;
 }
 
-void Sequence::Step::set_blend(const Blend &b)
-{
-       blend = b;
-}
-
 } // namespace GL
 } // namespace Msp