]> git.tdb.fi Git - libs/gl.git/blobdiff - demos/desertpillars/source/desertpillars.cpp
Split the Light class into subclasses by light type
[libs/gl.git] / demos / desertpillars / source / desertpillars.cpp
index b5db8afd1f05d02867376819a160f2d2fea0fbc0..5932e56968be16851469fd045e58b96708b30dc6 100644 (file)
@@ -1,4 +1,5 @@
 #include <msp/fs/dir.h>
+#include <msp/gl/directionallight.h>
 #include <msp/gl/sequencebuilder.h>
 #include <msp/gl/renderer.h>
 #include <msp/gl/tests.h>
@@ -34,11 +35,12 @@ DesertPillars::DesertPillars(int, char **):
        window.signal_close.connect(sigc::bind(sigc::mem_fun(this, &DesertPillars::exit), 0));
        keyboard.signal_button_press.connect(sigc::bind_return(sigc::mem_fun(this, &DesertPillars::key_press), false));
 
-       GL::Light &sun = resources.get<GL::Light>("Sun.light");
+       GL::DirectionalLight &sun = resources.get<GL::DirectionalLight>("Sun.light");
        sky = make_unique<GL::Sky>(content, sun);
        sky->set_debug_name("Sky");
 
        shadow_seq = make_unique<GL::Sequence>();
+       shadow_seq->set_clear_enabled(true);
        shadow_seq->set_debug_name("Shadow sequence");
        GL::Sequence::Step *step = &shadow_seq->add_step("shadow", content);
        step->set_depth_test(GL::LEQUAL);
@@ -53,6 +55,7 @@ DesertPillars::DesertPillars(int, char **):
        sequence.reset(seq_bld.build(view));
 
        env_seq = make_unique<GL::Sequence>();
+       env_seq->set_clear_enabled(true);
        env_seq->set_debug_name("Environment sequence");
        step = &env_seq->add_step("", *shadow_map);
        step->set_lighting(&resources.get<GL::Lighting>("Desert.lightn"));