]> git.tdb.fi Git - libs/vr.git/blob - source/system.cpp
99a6d4871ece2486b7658eb2c1234d9ecbf6f62c
[libs/vr.git] / source / system.cpp
1 #include <msp/strings/format.h>
2 #include "system.h"
3 #ifdef WITH_OPENVR
4 #include "openvr/openvrsystem.h"
5 #endif
6 #ifdef WITH_LIBOVR
7 #include "libovr/libovrsystem.h"
8 #endif
9
10 using namespace std;
11
12 namespace Msp {
13 namespace VR {
14
15 System *System::create(const string &type)
16 {
17 #ifdef WITH_OPENVR
18         if(type=="openvr")
19                 return new OpenVRSystem;
20 #endif
21 #ifdef WITH_LIBOVR
22         if(type=="libovr")
23                 return new LibOVRSystem;
24 #endif
25         throw invalid_argument(format("system '%s' not supported", type));
26 }
27
28 } // namespace VR
29 } // namespace Msp