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