]> git.tdb.fi Git - libs/gl.git/blob - source/render/view.h
9c756bbcdb453c62b1701a8421d3df075c6076f0
[libs/gl.git] / source / render / view.h
1 #ifndef MSP_GL_VIEW_H_
2 #define MSP_GL_VIEW_H_
3
4 #include "framebuffer.h"
5
6 namespace Msp {
7 namespace GL {
8
9 class Camera;
10 class Renderable;
11 class Renderer;
12
13 /**
14 Manages the presentation of rendering results on the screen.
15 */
16 class View
17 {
18 protected:
19         Framebuffer ⌖
20         Camera *camera;
21         Renderable *content;
22         Renderer *internal_renderer;
23
24         View(Framebuffer &);
25 public:
26         virtual ~View();
27
28         virtual unsigned get_width() const { return target.get_width(); }
29         virtual unsigned get_height() const { return target.get_height(); }
30         float get_aspect_ratio() const { return static_cast<float>(get_width())/get_height(); }
31
32         void set_camera(Camera *);
33         void set_content(Renderable *);
34
35         virtual void render();
36         virtual void render(Renderer &);
37 };
38
39 } // namespace GL
40 } // namespace Msp
41
42 #endif