2 #include "windowview.h"
9 WindowView::WindowView(Graphics::Window &w, Graphics::GLContext &c):
10 View(Framebuffer::system()),
14 window.signal_resize.connect(sigc::mem_fun(this, &WindowView::window_resized));
15 window_resized(window.get_width(), window.get_height());
18 void WindowView::render(Renderer &renderer)
20 View::render(renderer);
21 context.swap_buffers();
24 void WindowView::window_resized(unsigned w, unsigned h)
26 target.viewport(0, 0, w, h);
27 float aspect = static_cast<float>(w)/h;
29 camera->set_aspect_ratio(aspect);