From 85ab39917c86d7f3f04c032dd92b84a84e1e5e26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= Date: Thu, 14 Aug 2014 13:19:31 +0300 Subject: [PATCH] libappfw|VRConfig: Determining if VR mode displaces content on screen --- doomsday/libappfw/include/de/vr/vrconfig.h | 10 ++++++++++ doomsday/libappfw/src/vr/vrconfig.cpp | 18 ++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/doomsday/libappfw/include/de/vr/vrconfig.h b/doomsday/libappfw/include/de/vr/vrconfig.h index 2c67a27ced..73862412f6 100644 --- a/doomsday/libappfw/include/de/vr/vrconfig.h +++ b/doomsday/libappfw/include/de/vr/vrconfig.h @@ -206,6 +206,16 @@ class LIBAPPFW_PUBLIC VRConfig de::OculusRift const &oculusRift() const; public: + /** + * Determines if the VR mode will be applying a transformation to window contents + * that displaces the content from its "actual" location. + * + * @param mode Mode. + * + * @return @c true, if contents will change position on screen. + */ + static bool modeAppliesDisplacement(StereoMode mode); + static bool modeNeedsStereoGLFormat(StereoMode mode); private: diff --git a/doomsday/libappfw/src/vr/vrconfig.cpp b/doomsday/libappfw/src/vr/vrconfig.cpp index 6fce8dcc19..e3f9a7e8a7 100644 --- a/doomsday/libappfw/src/vr/vrconfig.cpp +++ b/doomsday/libappfw/src/vr/vrconfig.cpp @@ -246,4 +246,22 @@ OculusRift const &VRConfig::oculusRift() const return d->ovr; } +bool VRConfig::modeAppliesDisplacement(StereoMode mode) +{ + switch(mode) + { + case Mono: + case GreenMagenta: + case RedCyan: + case LeftOnly: + case RightOnly: + case QuadBuffered: + return false; + + default: + break; + } + return true; +} + } // namespace de