]> git.tdb.fi Git - libs/gl.git/blobdiff - source/view.h
Add a convenience method to get the aspect ratio of View
[libs/gl.git] / source / view.h
index 81d7e051de0ec22d4757d61fcb31160cd269cd3c..acd5a65cfec98a1753642dfcb75c4393e879ed31 100644 (file)
@@ -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<float>(get_width())/get_height(); }
 
        void set_content(const Renderable *);
        void synchronize_camera_aspect(Camera &);