Skip to content

Commit

Permalink
libappfw|VRConfig: Determining if VR mode displaces content on screen
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Aug 14, 2014
1 parent f6e01a7 commit 85ab399
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
10 changes: 10 additions & 0 deletions doomsday/libappfw/include/de/vr/vrconfig.h
Expand Up @@ -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:
Expand Down
18 changes: 18 additions & 0 deletions doomsday/libappfw/src/vr/vrconfig.cpp
Expand Up @@ -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

0 comments on commit 85ab399

Please sign in to comment.