X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fview.h;h=bd39e8ff7f11c6835b07a62a233b858b60472735;hb=dafd3a42a2f06bfd8e88f9240fc2f4bd3d401541;hp=93eb49d7d64c82d8223a21c406bea9aaf49675f4;hpb=9759cae2abf138acc548e3f230967e2c843e967e;p=libs%2Fgl.git diff --git a/source/view.h b/source/view.h index 93eb49d7..bd39e8ff 100644 --- a/source/view.h +++ b/source/view.h @@ -2,6 +2,7 @@ #define MSP_GL_VIEW_H_ #include +#include #include #include @@ -15,19 +16,29 @@ class Renderable; /** Manages the presentation of rendering results on the screen. */ -class View +class View: public sigc::trackable { private: Graphics::Window &window; Graphics::GLContext &context; Framebuffer ⌖ + Camera *camera; const Renderable *content; std::list synced_cameras; public: View(Graphics::Window &, Graphics::GLContext &); + Graphics::Window &get_window() { return window; } + 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_camera(Camera *); void set_content(const Renderable *); + + // Deprecated void synchronize_camera_aspect(Camera &); void render();