]> git.tdb.fi Git - libs/gl.git/blob - source/view.h
Add getter for Animation::looping
[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
13 /**
14 Manages the presentation of rendering results on the screen.
15 */
16 class View: public sigc::trackable
17 {
18 protected:
19         Framebuffer &target;
20         Camera *camera;
21         Renderable *content;
22         std::list<Camera *> synced_cameras;
23
24         View(Framebuffer &);
25
26 public:
27         virtual unsigned get_width() const { return target.get_width(); }
28         virtual unsigned get_height() const { return target.get_height(); }
29         float get_aspect_ratio() const { return static_cast<float>(get_width())/get_height(); }
30
31         void set_camera(Camera *);
32         void set_content(Renderable *);
33
34         // Deprecated
35         float get_aspect() const { return get_aspect_ratio(); }
36         void synchronize_camera_aspect(Camera &);
37
38         virtual void render();
39 };
40
41 } // namespace GL
42 } // namespace Msp
43
44 #endif