X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fview.h;h=acd5a65cfec98a1753642dfcb75c4393e879ed31;hb=3b159edbe4e80a2bc19c4c2fcd42cb996b9fbfe0;hp=0dd638959693f6c052494892a09a723b273a95a5;hpb=1bd2a77b4999d240a27e13a9069e8fca3410d363;p=libs%2Fgl.git diff --git a/source/view.h b/source/view.h index 0dd63895..acd5a65c 100644 --- a/source/view.h +++ b/source/view.h @@ -2,6 +2,7 @@ #define MSP_GL_VIEW_H_ #include +#include #include #include @@ -15,7 +16,7 @@ class Renderable; /** Manages the presentation of rendering results on the screen. */ -class View +class View: public sigc::trackable { private: Graphics::Window &window; @@ -31,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 &);