From: Mikko Rasa Date: Tue, 6 Dec 2016 21:34:16 +0000 (+0200) Subject: Immediate update camera aspect in View::set_camera X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=0807680edd94a7f14560831db4dd52e4e48d0d19;p=libs%2Fgl.git Immediate update camera aspect in View::set_camera --- diff --git a/source/view.cpp b/source/view.cpp index 115a4b0c..1518b6ee 100644 --- a/source/view.cpp +++ b/source/view.cpp @@ -22,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(window.get_width())/window.get_height()); } void View::set_content(Renderable *r)