]> git.tdb.fi Git - libs/gl.git/blobdiff - source/windowview.h
Split the Window-specific parts out of View
[libs/gl.git] / source / windowview.h
diff --git a/source/windowview.h b/source/windowview.h
new file mode 100644 (file)
index 0000000..825601f
--- /dev/null
@@ -0,0 +1,35 @@
+#ifndef MSP_GL_WINDOWVIEW_H_
+#define MSP_GL_WINDOWVIEW_H_
+
+#include <sigc++/trackable.h>
+#include <msp/graphics/glcontext.h>
+#include <msp/graphics/window.h>
+#include "view.h"
+
+namespace Msp {
+namespace GL {
+
+class WindowView: public View
+{
+private:
+       Graphics::Window &window;
+       Graphics::GLContext &context;
+
+public:
+       WindowView(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(); }
+
+       virtual void render();
+
+private:
+       void window_resized(unsigned, unsigned);
+};
+
+} // namespace GL
+} // namespace Msp
+
+#endif