X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fview.h;h=08629fa065ab159725a5d025ca0b4dc1093f488b;hp=f7f47fc7b48fd7d37f349f73823fee017a3d5ad5;hb=e07b25a160c5d3231282df948017460ac581b4d7;hpb=fd31e462d8acac7af890dad7dff8de76c1caa1a3 diff --git a/source/view.h b/source/view.h index f7f47fc7..08629fa0 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,21 +15,17 @@ 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; Renderable *content; std::list synced_cameras; -public: - View(Graphics::Window &, Graphics::GLContext &); + 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(); } +public: + virtual unsigned get_width() const { return target.get_width(); } + virtual unsigned get_height() const { return target.get_height(); } float get_aspect() const { return static_cast(get_width())/get_height(); } void set_camera(Camera *); @@ -41,10 +34,7 @@ public: // Deprecated void synchronize_camera_aspect(Camera &); - void render(); - -private: - void window_resized(unsigned, unsigned); + virtual void render(); }; } // namespace GL