X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fview.h;h=df623c3a7d88b632e89a397609da0fba3d42d6c7;hp=bd39e8ff7f11c6835b07a62a233b858b60472735;hb=bec07999d95b76f4b47cffcc564d0cd0afc0435e;hpb=7791ca3eac17e355d1de508b1730dc854ed7712d diff --git a/source/view.h b/source/view.h index bd39e8ff..df623c3a 100644 --- a/source/view.h +++ b/source/view.h @@ -2,49 +2,39 @@ #define MSP_GL_VIEW_H_ #include -#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: public sigc::trackable { -private: - Graphics::Window &window; - Graphics::GLContext &context; +protected: Framebuffer ⌖ Camera *camera; - const Renderable *content; - std::list synced_cameras; + Renderable *content; + Renderer *internal_renderer; + View(Framebuffer &); public: - View(Graphics::Window &, Graphics::GLContext &); + virtual ~View(); - 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(); } + 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 set_camera(Camera *); - void set_content(const Renderable *); + void set_content(Renderable *); - // Deprecated - void synchronize_camera_aspect(Camera &); - - void render(); - -private: - void window_resized(unsigned, unsigned); + virtual void render(); + virtual void render(Renderer &); }; } // namespace GL