]> git.tdb.fi Git - libs/gl.git/blobdiff - source/view.h
Remove dynamic allocation from VertexFormat
[libs/gl.git] / source / view.h
index 93eb49d7d64c82d8223a21c406bea9aaf49675f4..acd5a65cfec98a1753642dfcb75c4393e879ed31 100644 (file)
@@ -2,6 +2,7 @@
 #define MSP_GL_VIEW_H_
 
 #include <list>
+#include <sigc++/trackable.h>
 #include <msp/graphics/glcontext.h>
 #include <msp/graphics/window.h>
 
@@ -15,7 +16,7 @@ class Renderable;
 /**
 Manages the presentation of rendering results on the screen.
 */
-class View
+class View: public sigc::trackable
 {
 private:
        Graphics::Window &window;
@@ -27,6 +28,12 @@ private:
 public:
        View(Graphics::Window &, Graphics::GLContext &);
 
+       Graphics::Window &get_window() { return window; }
+       Graphics::GLContext &get_context() { return context; }
+       unsigned get_width() const { return window.get_width(); }
+       unsigned get_height() const { return window.get_height(); }
+       float get_aspect() const { return static_cast<float>(get_width())/get_height(); }
+
        void set_content(const Renderable *);
        void synchronize_camera_aspect(Camera &);