X-Git-Url: http://git.tdb.fi/?p=libs%2Fvr.git;a=blobdiff_plain;f=source%2Fsystem.cpp;h=500e672f3365518276c51145b5eb9150aa129143;hp=436862e8fbde8e96dfea3d4588a5b24caf4d62e7;hb=80785cc981166c5faacfcc41476b3d2ffdb65c4a;hpb=b6de7d24475dec8f5d6b8148a69cf8b561bc0761 diff --git a/source/system.cpp b/source/system.cpp index 436862e..500e672 100644 --- a/source/system.cpp +++ b/source/system.cpp @@ -4,7 +4,7 @@ #include "openvr/openvrsystem.h" #endif #ifdef WITH_LIBOVR -#include "ovr/oculusriftsystem.h" +#include "libovr/libovrsystem.h" #endif using namespace std; @@ -20,10 +20,47 @@ System *System::create(const string &type) #endif #ifdef WITH_LIBOVR if(type=="libovr") - return new OculusRiftSystem; + return new LibOVRSystem; #endif throw invalid_argument(format("system '%s' not supported", type)); } +System *System::create_autodetect() +{ +#ifdef WITH_OPENVR + if(OpenVRSystem::is_maybe_available()) + { + try + { + return new OpenVRSystem; + } + catch(const runtime_error &) + { } + } +#endif + +#ifdef WITH_LIBOVR + try + { + return new LibOVRSystem; + } + catch(const runtime_error &) + { } +#endif + + return 0; +} + +void System::set_absolute_tracking(bool a) +{ + if(a) + throw invalid_argument("absolute tracking not supported"); +} + +MotionController *System::create_controller() +{ + throw runtime_error("controller not supported"); +} + } // namespace VR } // namespace Msp