]> git.tdb.fi Git - libs/gl.git/blobdiff - source/view.cpp
Derive ProgramCompiler::DeclarationCombiner from BlockModifier
[libs/gl.git] / source / view.cpp
index cd759e4859c30ee754836411ce37cdb259fb29e1..b4dcca99cc4a4f6b6bb6839df1ee39bf8f99fc23 100644 (file)
@@ -13,14 +13,18 @@ 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));
+       window_resized(window.get_width(), window.get_height());
 }
 
 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)