]> git.tdb.fi Git - libs/gl.git/commitdiff
Use the Blend and DepthTest classes
authorMikko Rasa <tdb@tdb.fi>
Mon, 27 Sep 2010 06:43:55 +0000 (06:43 +0000)
committerMikko Rasa <tdb@tdb.fi>
Mon, 27 Sep 2010 06:43:55 +0000 (06:43 +0000)
source/bloom.cpp

index 3993c8c901b9a01c66e621af65d6bcefc5ebc1f7..040fd6c7b1fa5ea5f995aafc4e45784665a87269 100644 (file)
@@ -133,8 +133,8 @@ void Bloom::render(const Texture2D &src)
        blur_shader.bind();
        fbo.bind();
        src.bind_to(0);
-       disable(DEPTH_TEST);
-       disable(BLEND);
+       Bind unbind_dtest(static_cast<DepthTest *>(0), true);
+       Bind unbind_blend(static_cast<Blend *>(0), true);
        for(unsigned i=0; i<2; ++i)
        {
                fbo.attach(COLOR_ATTACHMENT0, tex[i], 0);
@@ -155,9 +155,6 @@ void Bloom::render(const Texture2D &src)
        Program::unbind();
        Texture::unbind_from(1);
        Texture::unbind_from(0);
-       // XXX Should check if the modes were enabled in the first place
-       enable(DEPTH_TEST);
-       enable(BLEND);
 }
 
 } // namespace GL