X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=inline;f=source%2Fview.h;h=cf0f4d64ed8d8feceabdcf10522782ce97c335b0;hb=df20a7e137542a4156cc5ffa8118d59de6b68547;hp=acd5a65cfec98a1753642dfcb75c4393e879ed31;hpb=3b6bbeda80d1db44348243c855bc433be23b949e;p=libs%2Fgl.git diff --git a/source/view.h b/source/view.h index acd5a65c..cf0f4d64 100644 --- a/source/view.h +++ b/source/view.h @@ -2,15 +2,12 @@ #define MSP_GL_VIEW_H_ #include -#include -#include -#include +#include "framebuffer.h" namespace Msp { namespace GL { class Camera; -class Framebuffer; class Renderable; /** @@ -18,29 +15,22 @@ Manages the presentation of rendering results on the screen. */ 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; -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(); } + View(Framebuffer &); - void set_content(const Renderable *); - void synchronize_camera_aspect(Camera &); +public: + 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(); }; } // namespace GL