Added logging to Oculus Plugin setting

This commit is contained in:
ksuprynowicz 2023-11-05 21:04:45 +01:00
parent 2ad99f91ff
commit 9d5da27101
2 changed files with 6 additions and 0 deletions

View file

@ -213,6 +213,7 @@ const OculusPlatformPluginPointer PluginManager::getOculusPlatformPlugin() {
std::call_once(once, [&] { std::call_once(once, [&] {
// Now grab the dynamic plugins if the setting allows it // Now grab the dynamic plugins if the setting allows it
if (_enableOculusPluginSetting.get()) { if (_enableOculusPluginSetting.get()) {
qCDebug(plugins) << "PluginManager::getOculusPlatformPlugin: Oculus plugin enabled by a setting";
for (auto loader : getLoadedPlugins()) { for (auto loader : getLoadedPlugins()) {
OculusPlatformProvider* oculusPlatformProvider = qobject_cast<OculusPlatformProvider*>(loader->instance()); OculusPlatformProvider* oculusPlatformProvider = qobject_cast<OculusPlatformProvider*>(loader->instance());
if (oculusPlatformProvider) { if (oculusPlatformProvider) {
@ -220,6 +221,8 @@ const OculusPlatformPluginPointer PluginManager::getOculusPlatformPlugin() {
break; break;
} }
} }
} else {
qCDebug(plugins) << "PluginManager::getOculusPlatformPlugin: Oculus plugin disabled by a setting";
} }
}); });
return oculusPlatformPlugin; return oculusPlatformPlugin;

View file

@ -55,6 +55,7 @@ bool isOculusPresent() {
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
// Only check for Oculus presence if Oculus plugin is enabled // Only check for Oculus presence if Oculus plugin is enabled
if (PluginManager::getInstance()->getEnableOculusPluginSetting()) { if (PluginManager::getInstance()->getEnableOculusPluginSetting()) {
qDebug() << "isOculusPresent: Oculus plugin enabled by a setting";
HANDLE oculusServiceEvent = ::OpenEventW(SYNCHRONIZE, FALSE, L"OculusHMDConnected"); HANDLE oculusServiceEvent = ::OpenEventW(SYNCHRONIZE, FALSE, L"OculusHMDConnected");
// The existence of the service indicates a running Oculus runtime // The existence of the service indicates a running Oculus runtime
if (oculusServiceEvent) { if (oculusServiceEvent) {
@ -64,6 +65,8 @@ bool isOculusPresent() {
} }
::CloseHandle(oculusServiceEvent); ::CloseHandle(oculusServiceEvent);
} }
} else {
qDebug() << "isOculusPresent: Oculus plugin disabled by a setting";
} }
#endif #endif
return result; return result;