mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-17 17:18:12 +02:00
adding more staging
This commit is contained in:
parent
c22ad2b15a
commit
db06533018
11 changed files with 59 additions and 19 deletions
|
@ -394,7 +394,7 @@ Item {
|
||||||
buttonGlyphSize: 24
|
buttonGlyphSize: 24
|
||||||
buttonGlyphRightMargin: 10
|
buttonGlyphRightMargin: 10
|
||||||
onClicked: {
|
onClicked: {
|
||||||
// if (loginDialog.isOculusStoreRunning()) {
|
// if (loginDialog.isOculusRunning()) {
|
||||||
// linkAccountBody.withOculus = true;
|
// linkAccountBody.withOculus = true;
|
||||||
// loginDialog.loginThroughSteam();
|
// loginDialog.loginThroughSteam();
|
||||||
// } else
|
// } else
|
||||||
|
@ -411,7 +411,7 @@ Item {
|
||||||
continueButton.visible = false;
|
continueButton.visible = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (loginDialog.isOculusStoreRunning()) {
|
if (loginDialog.isOculusRunning()) {
|
||||||
continueButton.text = qsTr("CONTINUE WITH OCULUS");
|
continueButton.text = qsTr("CONTINUE WITH OCULUS");
|
||||||
continueButton.buttonGlyph = hifi.glyphs.oculus;
|
continueButton.buttonGlyph = hifi.glyphs.oculus;
|
||||||
} else if (loginDialog.isSteamRunning()) {
|
} else if (loginDialog.isSteamRunning()) {
|
||||||
|
@ -539,6 +539,9 @@ Item {
|
||||||
Qt.callLater(function() {
|
Qt.callLater(function() {
|
||||||
emailField.forceActiveFocus();
|
emailField.forceActiveFocus();
|
||||||
});
|
});
|
||||||
|
if (loginDialog.isOculusRunning()) {
|
||||||
|
print(loginDialog.getLoggedInUserID());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Keys.onPressed: {
|
Keys.onPressed: {
|
||||||
|
|
|
@ -120,6 +120,7 @@
|
||||||
#include <plugins/PluginManager.h>
|
#include <plugins/PluginManager.h>
|
||||||
#include <plugins/PluginUtils.h>
|
#include <plugins/PluginUtils.h>
|
||||||
#include <plugins/SteamClientPlugin.h>
|
#include <plugins/SteamClientPlugin.h>
|
||||||
|
#include <plugins/OculusPlatformPlugin.h>
|
||||||
#include <plugins/InputConfiguration.h>
|
#include <plugins/InputConfiguration.h>
|
||||||
#include <RecordingScriptingInterface.h>
|
#include <RecordingScriptingInterface.h>
|
||||||
#include <render/EngineStats.h>
|
#include <render/EngineStats.h>
|
||||||
|
@ -793,7 +794,6 @@ bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) {
|
||||||
if (auto steamClient = pluginManager->getSteamClientPlugin()) {
|
if (auto steamClient = pluginManager->getSteamClientPlugin()) {
|
||||||
steamClient->init();
|
steamClient->init();
|
||||||
}
|
}
|
||||||
|
|
||||||
PROFILE_SET_THREAD_NAME("Main Thread");
|
PROFILE_SET_THREAD_NAME("Main Thread");
|
||||||
|
|
||||||
#if defined(Q_OS_WIN)
|
#if defined(Q_OS_WIN)
|
||||||
|
@ -999,6 +999,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
{
|
{
|
||||||
|
|
||||||
auto steamClient = PluginManager::getInstance()->getSteamClientPlugin();
|
auto steamClient = PluginManager::getInstance()->getSteamClientPlugin();
|
||||||
|
auto oculusPlatform = PluginManager::getInstance()->getOculusPlatformPlugin();
|
||||||
setProperty(hifi::properties::STEAM, (steamClient && steamClient->isRunning()));
|
setProperty(hifi::properties::STEAM, (steamClient && steamClient->isRunning()));
|
||||||
setProperty(hifi::properties::CRASHED, _previousSessionCrashed);
|
setProperty(hifi::properties::CRASHED, _previousSessionCrashed);
|
||||||
|
|
||||||
|
@ -1130,6 +1131,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
bool isStore = arguments().indexOf(OCULUS_STORE_ARG) != -1;
|
bool isStore = arguments().indexOf(OCULUS_STORE_ARG) != -1;
|
||||||
setProperty(hifi::properties::OCULUS_STORE, isStore);
|
setProperty(hifi::properties::OCULUS_STORE, isStore);
|
||||||
DependencyManager::get<WalletScriptingInterface>()->setLimitedCommerce(isStore); // Or we could make it a separate arg, or if either arg is set, etc. And should this instead by a hifi::properties?
|
DependencyManager::get<WalletScriptingInterface>()->setLimitedCommerce(isStore); // Or we could make it a separate arg, or if either arg is set, etc. And should this instead by a hifi::properties?
|
||||||
|
if (auto oculusPlatform = PluginManager::getInstance()->getOculusPlatformPlugin()) {
|
||||||
|
oculusPlatform->init();
|
||||||
|
}
|
||||||
|
|
||||||
updateHeartbeat();
|
updateHeartbeat();
|
||||||
|
|
||||||
|
@ -2652,6 +2656,10 @@ Application::~Application() {
|
||||||
if (auto steamClient = PluginManager::getInstance()->getSteamClientPlugin()) {
|
if (auto steamClient = PluginManager::getInstance()->getSteamClientPlugin()) {
|
||||||
steamClient->shutdown();
|
steamClient->shutdown();
|
||||||
}
|
}
|
||||||
|
if (auto oculusPlatform = PluginManager::getInstance()->getOculusPlatformPlugin()) {
|
||||||
|
oculusPlatform->shutdown();
|
||||||
|
}
|
||||||
|
|
||||||
DependencyManager::destroy<PluginManager>();
|
DependencyManager::destroy<PluginManager>();
|
||||||
|
|
||||||
DependencyManager::destroy<CompositorHelper>(); // must be destroyed before the FramebufferCache
|
DependencyManager::destroy<CompositorHelper>(); // must be destroyed before the FramebufferCache
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
|
|
||||||
#include <plugins/PluginManager.h>
|
#include <plugins/PluginManager.h>
|
||||||
#include <plugins/SteamClientPlugin.h>
|
#include <plugins/SteamClientPlugin.h>
|
||||||
|
#include <plugins/OculusPlatformPlugin.h>
|
||||||
#include <shared/GlobalAppProperties.h>
|
#include <shared/GlobalAppProperties.h>
|
||||||
#include <ui/TabletScriptingInterface.h>
|
#include <ui/TabletScriptingInterface.h>
|
||||||
#include <UserActivityLogger.h>
|
#include <UserActivityLogger.h>
|
||||||
|
@ -104,8 +105,16 @@ bool LoginDialog::isSteamRunning() const {
|
||||||
return steamClient && steamClient->isRunning();
|
return steamClient && steamClient->isRunning();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LoginDialog::isOculusStoreRunning() const {
|
bool LoginDialog::isOculusRunning() const {
|
||||||
return qApp->property(hifi::properties::OCULUS_STORE).toBool();
|
auto oculusPlatform = PluginManager::getInstance()->getOculusPlatformPlugin();
|
||||||
|
return oculusPlatform && oculusPlatform->isRunning();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString LoginDialog::getLoggedInUserID() const {
|
||||||
|
auto oculusPlatform = PluginManager::getInstance()->getOculusPlatformPlugin();
|
||||||
|
auto userID = oculusPlatform->getLoggedInUserID();
|
||||||
|
qDebug() << "userID: " << userID;
|
||||||
|
return userID;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoginDialog::dismissLoginDialog() {
|
void LoginDialog::dismissLoginDialog() {
|
||||||
|
|
|
@ -67,7 +67,8 @@ protected slots:
|
||||||
Q_INVOKABLE void dismissLoginDialog();
|
Q_INVOKABLE void dismissLoginDialog();
|
||||||
|
|
||||||
Q_INVOKABLE bool isSteamRunning() const;
|
Q_INVOKABLE bool isSteamRunning() const;
|
||||||
Q_INVOKABLE bool isOculusStoreRunning() const;
|
Q_INVOKABLE bool isOculusRunning() const;
|
||||||
|
Q_INVOKABLE QString getLoggedInUserID() const;
|
||||||
|
|
||||||
Q_INVOKABLE void login(const QString& username, const QString& password) const;
|
Q_INVOKABLE void login(const QString& username, const QString& password) const;
|
||||||
Q_INVOKABLE void loginThroughSteam();
|
Q_INVOKABLE void loginThroughSteam();
|
||||||
|
|
|
@ -21,6 +21,7 @@ class DisplayPlugin;
|
||||||
class InputPlugin;
|
class InputPlugin;
|
||||||
class CodecPlugin;
|
class CodecPlugin;
|
||||||
class SteamClientPlugin;
|
class SteamClientPlugin;
|
||||||
|
class OculusPlatformPlugin;
|
||||||
class Plugin;
|
class Plugin;
|
||||||
class PluginContainer;
|
class PluginContainer;
|
||||||
class PluginManager;
|
class PluginManager;
|
||||||
|
@ -35,4 +36,5 @@ using CodecPluginPointer = std::shared_ptr<CodecPlugin>;
|
||||||
using CodecPluginList = std::vector<CodecPluginPointer>;
|
using CodecPluginList = std::vector<CodecPluginPointer>;
|
||||||
using CodecPluginProvider = std::function<CodecPluginList()>;
|
using CodecPluginProvider = std::function<CodecPluginList()>;
|
||||||
using SteamClientPluginPointer = std::shared_ptr<SteamClientPlugin>;
|
using SteamClientPluginPointer = std::shared_ptr<SteamClientPlugin>;
|
||||||
|
using OculusPlatformPluginPointer = std::shared_ptr<OculusPlatformPlugin>;
|
||||||
using InputPluginSettingsPersister = std::function<void(const InputPluginList&)>;
|
using InputPluginSettingsPersister = std::function<void(const InputPluginList&)>;
|
||||||
|
|
|
@ -179,6 +179,23 @@ const SteamClientPluginPointer PluginManager::getSteamClientPlugin() {
|
||||||
return steamClientPlugin;
|
return steamClientPlugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const OculusPlatformPluginPointer PluginManager::getOculusPlatformPlugin() {
|
||||||
|
static OculusPlatformPluginPointer oculusPlatformPlugin;
|
||||||
|
static std::once_flag once;
|
||||||
|
std::call_once(once, [&] {
|
||||||
|
// Now grab the dynamic plugins
|
||||||
|
for (auto loader : getLoadedPlugins()) {
|
||||||
|
OculusPlatformProvider* oculusPlatformProvider = qobject_cast<OculusPlatformProvider*>(loader->instance());
|
||||||
|
if (oculusPlatformProvider) {
|
||||||
|
oculusPlatformPlugin = oculusPlatformProvider->getOculusPlatformPlugin();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return oculusPlatformPlugin;
|
||||||
|
}
|
||||||
|
|
||||||
const DisplayPluginList& PluginManager::getDisplayPlugins() {
|
const DisplayPluginList& PluginManager::getDisplayPlugins() {
|
||||||
static std::once_flag once;
|
static std::once_flag once;
|
||||||
static auto deviceAddedCallback = [](QString deviceName) {
|
static auto deviceAddedCallback = [](QString deviceName) {
|
||||||
|
|
|
@ -28,6 +28,7 @@ public:
|
||||||
const InputPluginList& getInputPlugins();
|
const InputPluginList& getInputPlugins();
|
||||||
const CodecPluginList& getCodecPlugins();
|
const CodecPluginList& getCodecPlugins();
|
||||||
const SteamClientPluginPointer getSteamClientPlugin();
|
const SteamClientPluginPointer getSteamClientPlugin();
|
||||||
|
const OculusPlatformPluginPointer getOculusPlatformPlugin();
|
||||||
|
|
||||||
DisplayPluginList getPreferredDisplayPlugins();
|
DisplayPluginList getPreferredDisplayPlugins();
|
||||||
void setPreferredDisplayPlugins(const QStringList& displays);
|
void setPreferredDisplayPlugins(const QStringList& displays);
|
||||||
|
|
|
@ -51,5 +51,15 @@ public:
|
||||||
virtual SteamClientPluginPointer getSteamClientPlugin() = 0;
|
virtual SteamClientPluginPointer getSteamClientPlugin() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class OculusPlatformProvider {
|
||||||
|
public:
|
||||||
|
virtual ~OculusPlatformProvider() {}
|
||||||
|
virtual OculusPlatformPluginPointer getOculusPlatformPlugin() = 0;
|
||||||
|
};
|
||||||
|
|
||||||
#define SteamClientProvider_iid "com.highfidelity.plugins.steamclient"
|
#define SteamClientProvider_iid "com.highfidelity.plugins.steamclient"
|
||||||
Q_DECLARE_INTERFACE(SteamClientProvider, SteamClientProvider_iid)
|
Q_DECLARE_INTERFACE(SteamClientProvider, SteamClientProvider_iid)
|
||||||
|
|
||||||
|
|
||||||
|
#define OculusPlatformProvider_iid "com.highfidelity.plugins.oculusplatform"
|
||||||
|
Q_DECLARE_INTERFACE(OculusPlatformProvider, OculusPlatformProvider_iid)
|
||||||
|
|
|
@ -34,6 +34,8 @@ if (NOT SERVER_ONLY AND NOT ANDROID)
|
||||||
add_subdirectory(${DIR})
|
add_subdirectory(${DIR})
|
||||||
set(DIR "steamClient")
|
set(DIR "steamClient")
|
||||||
add_subdirectory(${DIR})
|
add_subdirectory(${DIR})
|
||||||
|
set(DIR "oculusPlatform")
|
||||||
|
add_subdirectory(${DIR})
|
||||||
set(DIR "hifiLeapMotion")
|
set(DIR "hifiLeapMotion")
|
||||||
add_subdirectory(${DIR})
|
add_subdirectory(${DIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -174,18 +174,6 @@ ovrTrackingState ovr::getTrackingState(double absTime, ovrBool latencyMarker) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ovr::getLoggedInUserID() {
|
|
||||||
ovr_GetLoggedInUserID();
|
|
||||||
ovrMessageHandle message = ovr_PopMessage();
|
|
||||||
if (!ovr_Message_IsError(message)) {
|
|
||||||
ovrUserHandle user = ovr_Message_GetUser(message);
|
|
||||||
qCDebug(oculusLog) << "User is: " << ovr_User_GetID(user) << ", " << ovr_User_GetOculusID(user);
|
|
||||||
} else {
|
|
||||||
auto error = ovr_Message_GetError(message);
|
|
||||||
qCDebug(oculusLog) << "User failure error: " << ovr_Error_GetMessage(error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ovr::getError() {
|
QString ovr::getError() {
|
||||||
static ovrErrorInfo error;
|
static ovrErrorInfo error;
|
||||||
ovr_GetLastErrorInfo(&error);
|
ovr_GetLastErrorInfo(&error);
|
||||||
|
|
|
@ -29,7 +29,6 @@ struct ovr {
|
||||||
static ovrSessionStatus getStatus();
|
static ovrSessionStatus getStatus();
|
||||||
static ovrSessionStatus getStatus(ovrResult& result);
|
static ovrSessionStatus getStatus(ovrResult& result);
|
||||||
static ovrTrackingState getTrackingState(double absTime = 0.0, ovrBool latencyMarker = ovrFalse);
|
static ovrTrackingState getTrackingState(double absTime = 0.0, ovrBool latencyMarker = ovrFalse);
|
||||||
static QString getLoggedInUserID();
|
|
||||||
static QString getError();
|
static QString getError();
|
||||||
static bool handleOVREvents();
|
static bool handleOVREvents();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue