only initialize plugin if oculus store starting

This commit is contained in:
Wayne Chen 2019-01-28 11:12:12 -08:00
parent 1c6521486e
commit 09770920a8

View file

@ -17,11 +17,15 @@
QString OculusAPIPlugin::NAME { "Oculus Rift" };
OculusAPIPlugin::OculusAPIPlugin() {
_session = hifi::ovr::acquireRenderSession();
if (isRunning()) {
_session = hifi::ovr::acquireRenderSession();
}
}
OculusAPIPlugin::~OculusAPIPlugin() {
hifi::ovr::releaseRenderSession(_session);
if (isRunning()) {
hifi::ovr::releaseRenderSession(_session);
}
}
bool OculusAPIPlugin::isRunning() const {