X-Git-Url: http://git.tdb.fi/?p=libs%2Fvr.git;a=blobdiff_plain;f=source%2Fsystem.cpp;fp=source%2Fsystem.cpp;h=c8354561489ffba0bf1b1711c7ed38db97264eb8;hp=99a6d4871ece2486b7658eb2c1234d9ecbf6f62c;hb=e21e0b80154afe4a62480efca61a07d4c2f2b0ef;hpb=eef7ce73069a71a4001442fc54010dc08e74ca1a diff --git a/source/system.cpp b/source/system.cpp index 99a6d48..c835456 100644 --- a/source/system.cpp +++ b/source/system.cpp @@ -25,5 +25,31 @@ 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; +} + } // namespace VR } // namespace Msp