X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fview.h;h=df623c3a7d88b632e89a397609da0fba3d42d6c7;hb=47853d7a557bf81131512832a9e531cb04d273ca;hp=93eb49d7d64c82d8223a21c406bea9aaf49675f4;hpb=9759cae2abf138acc548e3f230967e2c843e967e;p=libs%2Fgl.git diff --git a/source/view.h b/source/view.h index 93eb49d7..df623c3a 100644 --- a/source/view.h +++ b/source/view.h @@ -2,38 +2,39 @@ #define MSP_GL_VIEW_H_ #include -#include -#include +#include "framebuffer.h" namespace Msp { namespace GL { class Camera; -class Framebuffer; class Renderable; +class Renderer; /** Manages the presentation of rendering results on the screen. */ -class View +class View: public sigc::trackable { -private: - Graphics::Window &window; - Graphics::GLContext &context; +protected: Framebuffer ⌖ - const Renderable *content; - std::list synced_cameras; + Camera *camera; + Renderable *content; + Renderer *internal_renderer; + View(Framebuffer &); public: - View(Graphics::Window &, Graphics::GLContext &); + virtual ~View(); - void set_content(const Renderable *); - void synchronize_camera_aspect(Camera &); + virtual unsigned get_width() const { return target.get_width(); } + virtual unsigned get_height() const { return target.get_height(); } + float get_aspect_ratio() const { return static_cast(get_width())/get_height(); } - void render(); + void set_camera(Camera *); + void set_content(Renderable *); -private: - void window_resized(unsigned, unsigned); + virtual void render(); + virtual void render(Renderer &); }; } // namespace GL