]> git.tdb.fi Git - libs/gl.git/commitdiff
Don't unbind the fbo until the entire cube map has been rendered
authorMikko Rasa <tdb@tdb.fi>
Wed, 12 Sep 2012 17:05:06 +0000 (20:05 +0300)
committerMikko Rasa <tdb@tdb.fi>
Wed, 12 Sep 2012 17:05:06 +0000 (20:05 +0300)
source/environmentmap.cpp

index 09a9b468277f7fad0c8f030e69ff820157aa70a4..8cda8cbae63b7e7505dd26a1c73d17dfc4ee4db0 100644 (file)
@@ -45,7 +45,7 @@ void EnvironmentMap::setup_frame() const
        for(unsigned i=0; i<6; ++i)
        {
                TextureCubeFace face = TextureCube::enumerate_faces(i);
-               Bind _bind_fbo(fbo[i]);
+               fbo[i].bind();
                fbo[i].clear(COLOR_BUFFER_BIT|DEPTH_BUFFER_BIT);
                camera.set_look_direction(env_tex.get_face_direction(face));
                camera.set_up_direction(env_tex.get_t_direction(face));
@@ -53,6 +53,7 @@ void EnvironmentMap::setup_frame() const
                env_renderer.exclude(renderable);
                env_renderer.render(environment);
        }
+       Framebuffer::unbind();
 }
 
 void EnvironmentMap::finish_frame() const