]> git.tdb.fi Git - libs/gl.git/commitdiff
Use renderer for lighting in the shaders demo
authorMikko Rasa <tdb@tdb.fi>
Fri, 29 Nov 2013 09:50:42 +0000 (11:50 +0200)
committerMikko Rasa <tdb@tdb.fi>
Fri, 29 Nov 2013 09:50:42 +0000 (11:50 +0200)
demos/shaders.cpp

index 872c3c160a746ed6aad39a4a76b266274577b749..5a268fec0bc94b581d61d5cb2fc9636bc2a751ee 100644 (file)
@@ -82,11 +82,9 @@ int main()
 
        GL::Lighting lighting;
        GL::Light light;
-       light.set_position(GL::Vector4(0, 2, 3, 0));
+       light.set_position(GL::Vector4(0, -0.781, 0.625, 0));
        lighting.attach(0, light);
 
-       GL::Bind bind_light(lighting);
-
        GL::Texturing texturing;
        texturing.attach(0, tex1);
        texturing.attach(1, tex2);
@@ -105,6 +103,7 @@ int main()
                {
                        GL::Bind bind_depth(GL::DepthTest::lequal());
                        GL::Renderer renderer(0);
+                       renderer.set_lighting(&lighting);
                        renderer.set_material(&mat);
                        renderer.set_texturing(&texturing);
                        renderer.add_shader_data(progdata);