vr::VR_Shutdown();
}
+bool OpenVRSystem::is_maybe_available()
+{
+ return vr::VR_IsHmdPresent();
+}
+
void OpenVRSystem::configure_view(StereoView &view) const
{
vr::IVRSystem *vr_sys = vr::VRSystem();
OpenVRSystem();
~OpenVRSystem();
+ static bool is_maybe_available();
+
virtual void configure_window(Graphics::Window &) const { }
virtual void configure_view(StereoView &) const;
virtual void set_absolute_tracking(bool);
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
virtual ~System() { }
static System *create(const std::string &);
+ static System *create_autodetect();
virtual void configure_window(Graphics::Window &) const = 0;
virtual void configure_view(StereoView &) const = 0;