X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fwindowview.cpp;h=0927407a316ed92823ad8e605daa85f15326e3b3;hp=6a0eebda574034de2beb0025d84bec924d781ebb;hb=HEAD;hpb=7cf5ebbc9d91d09d0664598d3fb88606c3307deb diff --git a/source/windowview.cpp b/source/windowview.cpp deleted file mode 100644 index 6a0eebda..00000000 --- a/source/windowview.cpp +++ /dev/null @@ -1,34 +0,0 @@ -#include "camera.h" -#include "windowview.h" - -using namespace std; - -namespace Msp { -namespace GL { - -WindowView::WindowView(Graphics::Window &w, Graphics::GLContext &c): - window(w), - context(c) -{ - window.signal_resize.connect(sigc::mem_fun(this, &WindowView::window_resized)); - window_resized(window.get_width(), window.get_height()); -} - -void WindowView::render() -{ - View::render(); - context.swap_buffers(); -} - -void WindowView::window_resized(unsigned w, unsigned h) -{ - target.viewport(0, 0, w, h); - float aspect = static_cast(w)/h; - if(camera) - camera->set_aspect_ratio(aspect); - for(list::iterator i=synced_cameras.begin(); i!=synced_cameras.end(); ++i) - (*i)->set_aspect_ratio(aspect); -} - -} // namespace GL -} // namespace Msp