X-Git-Url: http://git.tdb.fi/?p=libs%2Fvr.git;a=blobdiff_plain;f=source%2Fsystem.cpp;fp=source%2Fsystem.cpp;h=436862e8fbde8e96dfea3d4588a5b24caf4d62e7;hp=0000000000000000000000000000000000000000;hb=b6de7d24475dec8f5d6b8148a69cf8b561bc0761;hpb=c07c707c480f4e989caee17541187f08f136d216 diff --git a/source/system.cpp b/source/system.cpp new file mode 100644 index 0000000..436862e --- /dev/null +++ b/source/system.cpp @@ -0,0 +1,29 @@ +#include +#include "system.h" +#ifdef WITH_OPENVR +#include "openvr/openvrsystem.h" +#endif +#ifdef WITH_LIBOVR +#include "ovr/oculusriftsystem.h" +#endif + +using namespace std; + +namespace Msp { +namespace VR { + +System *System::create(const string &type) +{ +#ifdef WITH_OPENVR + if(type=="openvr") + return new OpenVRSystem; +#endif +#ifdef WITH_LIBOVR + if(type=="libovr") + return new OculusRiftSystem; +#endif + throw invalid_argument(format("system '%s' not supported", type)); +} + +} // namespace VR +} // namespace Msp