X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fsystem.cpp;h=b4105b056a969553f4df57261e0b293b9e305219;hb=81d7a9bad0313e06ed154734d3f2a3120b26b6db;hp=99a6d4871ece2486b7658eb2c1234d9ecbf6f62c;hpb=31c28161d36749d040cbab0099b352f53cad232d;p=libs%2Fvr.git diff --git a/source/system.cpp b/source/system.cpp index 99a6d48..b4105b0 100644 --- a/source/system.cpp +++ b/source/system.cpp @@ -25,5 +25,37 @@ System *System::create(const string &type) 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"); +} + } // namespace VR } // namespace Msp