]> git.tdb.fi Git - libs/gl.git/blobdiff - source/render/windowview.h
Move WindowView::render to the backend
[libs/gl.git] / source / render / windowview.h
index ee7c44dce994268f8b75555b576609e1386221e4..43b8d442ea85dd47fbf8745a0265f3c1d5086a68 100644 (file)
@@ -1,29 +1,38 @@
 #ifndef MSP_GL_WINDOWVIEW_H_
 #define MSP_GL_WINDOWVIEW_H_
 
-#include <msp/graphics/glcontext.h>
+#include <sigc++/trackable.h>
 #include <msp/graphics/window.h>
-#include "view.h"
+#include "device.h"
+#include "windowview_backend.h"
 
 namespace Msp {
 namespace GL {
 
-class WindowView: public View
+/**
+A view targeting a Graphics::Window.
+
+After rendering, the result is presented in the window.
+
+The aspect ratio of the view's Camera is automatically updated to match that of
+the window.
+*/
+class WindowView: public WindowViewBackend, public sigc::trackable
 {
+       friend WindowViewBackend;
+
 private:
        Graphics::Window &window;
-       Graphics::GLContext &context;
+       Device &device;
 
 public:
-       WindowView(Graphics::Window &, Graphics::GLContext &);
+       WindowView(Graphics::Window &);
 
        Graphics::Window &get_window() { return window; }
-       Graphics::GLContext &get_context() { return context; }
        virtual unsigned get_width() const { return window.get_width(); }
        virtual unsigned get_height() const { return window.get_height(); }
 
        using View::render;
-       virtual void render(Renderer &);
 
 private:
        void window_resized(unsigned, unsigned);