X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fwindowview.cpp;h=0927407a316ed92823ad8e605daa85f15326e3b3;hb=refs%2Fheads%2Fmaster;hp=2cce075c9b5f80509c5bc98e1fc889a4d63039ae;hpb=d531a1f0a8ea50eb6ff1a372aca81e827e1d2034;p=libs%2Fgl.git diff --git a/source/windowview.cpp b/source/windowview.cpp deleted file mode 100644 index 2cce075c..00000000 --- a/source/windowview.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include "camera.h" -#include "windowview.h" - -using namespace std; - -namespace Msp { -namespace GL { - -WindowView::WindowView(Graphics::Window &w, Graphics::GLContext &c): - View(Framebuffer::system()), - 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(Renderer &renderer) -{ - View::render(renderer); - 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); -} - -} // namespace GL -} // namespace Msp