From 7ffea3d796acabd43cfe01a0666756c427029901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaakko=20Ker=C3=A4nen?= Date: Fri, 14 Feb 2014 11:30:20 +0200 Subject: [PATCH] Client|libappfw: Cleanup --- doomsday/client/src/gl/gl_main.cpp | 3 +-- doomsday/libappfw/include/de/framework/basewindow.h | 2 ++ doomsday/libappfw/src/basewindow.cpp | 10 ++++++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/doomsday/client/src/gl/gl_main.cpp b/doomsday/client/src/gl/gl_main.cpp index 8058c7e6b5..e7b5b795d1 100644 --- a/doomsday/client/src/gl/gl_main.cpp +++ b/doomsday/client/src/gl/gl_main.cpp @@ -187,8 +187,7 @@ void GL_DoUpdate() DD_WaitForOptimalUpdateTime(); // Blit screen to video. - ClientWindow::main().swapBuffers( - vrCfg().needsStereoGLFormat()? gl::SwapStereoBuffers : gl::SwapMonoBuffer); + ClientWindow::main().swapBuffers(); // We will arrive here always at the same time in relation to the displayed // frame: it is a good time to update the mouse state. diff --git a/doomsday/libappfw/include/de/framework/basewindow.h b/doomsday/libappfw/include/de/framework/basewindow.h index 7e27076610..14f18d237e 100644 --- a/doomsday/libappfw/include/de/framework/basewindow.h +++ b/doomsday/libappfw/include/de/framework/basewindow.h @@ -83,6 +83,8 @@ class BaseWindow : public PersistentCanvasWindow void canvasGLDraw(Canvas &); + void swapBuffers(); + DENG2_AS_IS_METHODS() protected: diff --git a/doomsday/libappfw/src/basewindow.cpp b/doomsday/libappfw/src/basewindow.cpp index a680e07849..8831eae76f 100644 --- a/doomsday/libappfw/src/basewindow.cpp +++ b/doomsday/libappfw/src/basewindow.cpp @@ -19,8 +19,8 @@ #include "de/BaseWindow" #include "de/WindowTransform" #include "de/WindowSystem" - -#include +#include "de/BaseGuiApp" +#include "de/VRConfig" namespace de { @@ -146,6 +146,12 @@ void BaseWindow::canvasGLDraw(Canvas &cv) PersistentCanvasWindow::canvasGLDraw(cv); } +void BaseWindow::swapBuffers() +{ + PersistentCanvasWindow::swapBuffers(DENG2_BASE_GUI_APP->vr().needsStereoGLFormat()? + gl::SwapStereoBuffers : gl::SwapMonoBuffer); +} + void BaseWindow::preDraw() {}