From: Mikko Rasa Date: Sat, 1 Nov 2014 00:25:49 +0000 (+0200) Subject: Use the same Renderer to render all faces of EnvironmentMap X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=d895da0ab78b60fb083cb9846ad1a4b4eebde69c;p=libs%2Fgl.git Use the same Renderer to render all faces of EnvironmentMap --- diff --git a/source/environmentmap.cpp b/source/environmentmap.cpp index ae98719f..ec406d15 100644 --- a/source/environmentmap.cpp +++ b/source/environmentmap.cpp @@ -39,6 +39,7 @@ void EnvironmentMap::setup_frame() const renderable.setup_frame(); environment.setup_frame(); + Renderer env_renderer(0); const Matrix *matrix = renderable.get_matrix(); Vector3 position = (*matrix)*Vector3(); camera.set_position(position); @@ -49,7 +50,7 @@ void EnvironmentMap::setup_frame() const 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)); - Renderer env_renderer(&camera); + env_renderer.begin(&camera); env_renderer.exclude(renderable); env_renderer.exclude(*this); env_renderer.render(environment);