From: Mikko Rasa Date: Fri, 7 Oct 2016 12:37:39 +0000 (+0300) Subject: Add a convenience method to get the aspect ratio of View X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=commitdiff_plain;h=3b6bbeda80d1db44348243c855bc433be23b949e Add a convenience method to get the aspect ratio of View --- diff --git a/source/view.h b/source/view.h index 81d7e051..acd5a65c 100644 --- a/source/view.h +++ b/source/view.h @@ -32,6 +32,7 @@ public: Graphics::GLContext &get_context() { return context; } unsigned get_width() const { return window.get_width(); } unsigned get_height() const { return window.get_height(); } + float get_aspect() const { return static_cast(get_width())/get_height(); } void set_content(const Renderable *); void synchronize_camera_aspect(Camera &);