]> git.tdb.fi Git - libs/gl.git/blobdiff - source/environmentmap.cpp
Use libmspmath to provide vector and matrix operations
[libs/gl.git] / source / environmentmap.cpp
index 09a9b468277f7fad0c8f030e69ff820157aa70a4..82e1f1d9ad86774d2c716306aebc5b03b012c369 100644 (file)
@@ -20,6 +20,7 @@ EnvironmentMap::EnvironmentMap(unsigned s, Renderable &r, Renderable &e):
        {
                fbo[i].attach(COLOR_ATTACHMENT0, env_tex, TextureCube::enumerate_faces(i), 0);
                fbo[i].attach(DEPTH_ATTACHMENT, depth_buf);
+               fbo[i].require_complete();
        }
 
        // XXX Make the depth range configurable
@@ -45,7 +46,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 +54,7 @@ void EnvironmentMap::setup_frame() const
                env_renderer.exclude(renderable);
                env_renderer.render(environment);
        }
+       Framebuffer::unbind();
 }
 
 void EnvironmentMap::finish_frame() const