2 #include "windowview.h"
9 WindowView::WindowView(Graphics::Window &w, Graphics::GLContext &c):
13 window.signal_resize.connect(sigc::mem_fun(this, &WindowView::window_resized));
14 window_resized(window.get_width(), window.get_height());
17 void WindowView::render()
20 context.swap_buffers();
23 void WindowView::window_resized(unsigned w, unsigned h)
25 target.viewport(0, 0, w, h);
26 float aspect = static_cast<float>(w)/h;
28 camera->set_aspect_ratio(aspect);
29 for(list<Camera *>::iterator i=synced_cameras.begin(); i!=synced_cameras.end(); ++i)
30 (*i)->set_aspect_ratio(aspect);