]> git.tdb.fi Git - libs/gl.git/blobdiff - source/view.cpp
Remove useless declarations of main() from shaders
[libs/gl.git] / source / view.cpp
index cd759e4859c30ee754836411ce37cdb259fb29e1..1518b6ee76b6012f51a4774ba7b5a5635e554d9d 100644 (file)
@@ -13,6 +13,7 @@ View::View(Graphics::Window &w, Graphics::GLContext &c):
        window(w),
        context(c),
        target(Framebuffer::system()),
+       camera(0),
        content(0)
 {
        window.signal_resize.connect(sigc::mem_fun(this, &View::window_resized));
@@ -21,6 +22,8 @@ View::View(Graphics::Window &w, Graphics::GLContext &c):
 void View::set_camera(Camera *c)
 {
        camera = c;
+       if(camera)
+               camera->set_aspect(static_cast<float>(window.get_width())/window.get_height());
 }
 
 void View::set_content(Renderable *r)