]> git.tdb.fi Git - libs/gl.git/blobdiff - source/view.h
Add a new View class to tie up some presentation tasks
[libs/gl.git] / source / view.h
diff --git a/source/view.h b/source/view.h
new file mode 100644 (file)
index 0000000..93eb49d
--- /dev/null
@@ -0,0 +1,42 @@
+#ifndef MSP_GL_VIEW_H_
+#define MSP_GL_VIEW_H_
+
+#include <list>
+#include <msp/graphics/glcontext.h>
+#include <msp/graphics/window.h>
+
+namespace Msp {
+namespace GL {
+
+class Camera;
+class Framebuffer;
+class Renderable;
+
+/**
+Manages the presentation of rendering results on the screen.
+*/
+class View
+{
+private:
+       Graphics::Window &window;
+       Graphics::GLContext &context;
+       Framebuffer &target;
+       const Renderable *content;
+       std::list<Camera *> synced_cameras;
+
+public:
+       View(Graphics::Window &, Graphics::GLContext &);
+
+       void set_content(const Renderable *);
+       void synchronize_camera_aspect(Camera &);
+
+       void render();
+
+private:
+       void window_resized(unsigned, unsigned);
+};
+
+} // namespace GL
+} // namespace Msp
+
+#endif