4 #include <msp/core/noncopyable.h>
5 #include "framebuffer.h"
15 An ultimate render target, which is typically visible to the user of the
16 application in some way.
18 The content renderable's render() function is called with an empty tag. A
19 Sequence can be used to specify other tags and add post-processing.
21 class View: public NonCopyable
25 Renderable *content = 0;
26 Renderer *internal_renderer = 0;
33 virtual unsigned get_width() const { return get_target().get_width(); }
34 virtual unsigned get_height() const { return get_target().get_height(); }
35 float get_aspect_ratio() const { return static_cast<float>(get_width())/get_height(); }
37 /** Sets the camera to render with. The camera's aspect ratio is set to
38 match that of the view. */
39 void set_camera(Camera *);
41 void set_content(Renderable *);
43 virtual void render();
44 virtual void render(Renderer &);
46 virtual const Framebuffer &get_target() const = 0;