1 #ifndef MSP_GL_WINDOWVIEW_H_
2 #define MSP_GL_WINDOWVIEW_H_
4 #include <sigc++/trackable.h>
5 #include <msp/graphics/glcontext.h>
6 #include <msp/graphics/window.h>
13 A view targeting a Graphics::Window.
15 After rendering, buffers are swapped to show the result in the window.
17 The aspect ratio of the view's Camera is automatically updated to match that of
20 class WindowView: public View, public sigc::trackable
23 Graphics::Window &window;
24 Graphics::GLContext &context;
27 WindowView(Graphics::Window &, Graphics::GLContext &);
29 Graphics::Window &get_window() { return window; }
30 Graphics::GLContext &get_context() { return context; }
31 virtual unsigned get_width() const { return window.get_width(); }
32 virtual unsigned get_height() const { return window.get_height(); }
35 virtual void render(Renderer &);
38 void window_resized(unsigned, unsigned);