]> git.tdb.fi Git - libs/vr.git/blob - source/displaydevice.cpp
Require mspcore since symbols from it are used
[libs/vr.git] / source / displaydevice.cpp
1 #include <msp/strings/format.h>
2 #include "displaydevice.h"
3 #ifdef WITH_OPENVR
4 #include "openvr/openvrdevice.h"
5 #endif
6 #ifdef WITH_LIBOVR
7 #include "ovr/oculusriftdevice.h"
8 #endif
9
10 using namespace std;
11
12 namespace Msp {
13 namespace VR {
14
15 DisplayDevice *DisplayDevice::create_device(const string &type)
16 {
17 #ifdef WITH_OPENVR
18         if(type=="openvr")
19                 return new OpenVRDevice;
20 #endif
21 #ifdef WITH_LIBOVR
22         if(type=="libovr")
23                 return new OculusRiftDevice;
24 #endif
25         throw invalid_argument(format("device type '%s' not supported", type));
26 }
27
28 } // namespace VR
29 } // namespace Msp