]> git.tdb.fi Git - libs/gl.git/blobdiff - demos/forestpond/source/forestpond.cpp
Check the flat qualifier from the correct member
[libs/gl.git] / demos / forestpond / source / forestpond.cpp
index e480d209582d6568119e7362e16c94ca65305ed3..b327489d56430baae63e0e22cbad304033331f13 100644 (file)
@@ -12,15 +12,21 @@ ForestPond::ForestPond(int, char **):
        because it requires Mesh to have its vertex format ready. */
        resources(nullptr),
        view(window),
-       camera(resources.get<GL::Camera>("Camera.camera"))
+       camera(resources.get<GL::Camera>("Camera.camera")),
+       water(resources.get<GL::Object>("Water.object"), resources, { resources.get<GL::Mesh>("Terrain.mesh"), -10.0f, -3.0f, 2.0f, 6.0f })
 {
        window.set_title("Forest Pond");
-       window.signal_close.connect(sigc::bind(sigc::mem_fun(this, &DesertPillars::exit), 0));
+       window.signal_close.connect(sigc::bind(sigc::mem_fun(this, &ForestPond::exit), 0));
 
        GL::SequenceBuilder seq_bld(resources.get<GL::SequenceTemplate>("Forest.seq"));
        seq_bld.set_debug_name("Main sequence");
+       seq_bld.set_renderable("content", content);
        sequence.reset(seq_bld.build(view));
 
+       content.add(resources.get<GL::Scene>("Forest.scene"));
+       content.add(water);
+       water.set_matrix(GL::Matrix::translation(GL::Vector3(-3, 2, 0)));
+
        view.set_content(sequence.get());
        view.set_camera(&camera);
 }