]> git.tdb.fi Git - libs/gl.git/blobdiff - source/renderpass.cpp
Add a rendering supervisor class
[libs/gl.git] / source / renderpass.cpp
index 5b5f72984b3bbfdbfe293d594ba68b3c17b4bd43..b67be7170ae7cff929d24b115552cce009db05e6 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id$
 
 This file is part of libmspgl
-Copyright © 2007  Mikko Rasa, Mikkosoft Productions
+Copyright © 2007-2008, 2010-2011  Mikko Rasa, Mikkosoft Productions
 Distributed under the LGPL
 */
 
@@ -30,7 +30,6 @@ RenderPass::RenderPass():
 { }
 
 RenderPass::RenderPass(const RenderPass &other):
-       Bindable<RenderPass>(other),
        shprog(other.shprog),
        shdata(other.shdata ? new ProgramData(*other.shdata) : 0),
        material(other.material),
@@ -57,47 +56,6 @@ void RenderPass::set_texture(unsigned index, const Texture *tex)
        texturing->attach(index, *tex);
 }
 
-void RenderPass::bind() const
-{
-       const RenderPass *old = current();
-       if(!set_current(this))
-               return;
-
-       if(shprog)
-       {
-               shprog->bind();
-               shdata->apply();
-       }
-       else if(old && old->shprog)
-               Program::unbind();
-
-       if(material)
-               material->bind();
-       else if(old && old->material)
-               Material::unbind();
-
-       if(texturing)
-               texturing->bind();
-       else if(old && old->texturing)
-               Texturing::unbind();
-}
-
-void RenderPass::unbind()
-{
-       const RenderPass *old = current();
-       if(!set_current(0))
-               return;
-
-       if(old->shprog)
-               Program::unbind();
-
-       if(old->material)
-               Material::unbind();
-
-       if(old->texturing)
-               Texturing::unbind();
-}
-
 
 RenderPass::Loader::Loader(RenderPass &p):
        DataFile::CollectionObjectLoader<RenderPass>(p, 0)