]> git.tdb.fi Git - libs/gl.git/blob - source/view.h
Add a new View class to tie up some presentation tasks
[libs/gl.git] / source / view.h
1 #ifndef MSP_GL_VIEW_H_
2 #define MSP_GL_VIEW_H_
3
4 #include <list>
5 #include <msp/graphics/glcontext.h>
6 #include <msp/graphics/window.h>
7
8 namespace Msp {
9 namespace GL {
10
11 class Camera;
12 class Framebuffer;
13 class Renderable;
14
15 /**
16 Manages the presentation of rendering results on the screen.
17 */
18 class View
19 {
20 private:
21         Graphics::Window &window;
22         Graphics::GLContext &context;
23         Framebuffer &target;
24         const Renderable *content;
25         std::list<Camera *> synced_cameras;
26
27 public:
28         View(Graphics::Window &, Graphics::GLContext &);
29
30         void set_content(const Renderable *);
31         void synchronize_camera_aspect(Camera &);
32
33         void render();
34
35 private:
36         void window_resized(unsigned, unsigned);
37 };
38
39 } // namespace GL
40 } // namespace Msp
41
42 #endif