mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 17:49:27 +02:00
trying to fix init issue
This commit is contained in:
parent
901dd77f05
commit
7c9189cfbe
5 changed files with 20 additions and 12 deletions
|
@ -535,6 +535,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
|
||||||
container->setFocus();
|
container->setFocus();
|
||||||
container->installEventFilter(DependencyManager::get<OffscreenUi>().data());
|
container->installEventFilter(DependencyManager::get<OffscreenUi>().data());
|
||||||
|
|
||||||
|
// Necessary to call this here so Oculus can get inited before Sixense
|
||||||
|
getDisplayPlugins();
|
||||||
|
|
||||||
// must be before initializeGL()
|
// must be before initializeGL()
|
||||||
_activeInputPlugins.clear();
|
_activeInputPlugins.clear();
|
||||||
auto inputPlugins = getInputPlugins();
|
auto inputPlugins = getInputPlugins();
|
||||||
|
|
|
@ -28,7 +28,7 @@ static void addInputPluginToMenu(InputPluginPointer inputPlugin, bool active = f
|
||||||
}
|
}
|
||||||
auto parent = menu->getMenu(MenuOption::InputMenu);
|
auto parent = menu->getMenu(MenuOption::InputMenu);
|
||||||
auto action = menu->addCheckableActionToQMenuAndActionHash(parent,
|
auto action = menu->addCheckableActionToQMenuAndActionHash(parent,
|
||||||
name, 0, true, qApp,
|
name, 0, active, qApp,
|
||||||
SLOT(updateInputModes()));
|
SLOT(updateInputModes()));
|
||||||
inputPluginGroup->addAction(action);
|
inputPluginGroup->addAction(action);
|
||||||
inputPluginGroup->setExclusive(false);
|
inputPluginGroup->setExclusive(false);
|
||||||
|
@ -45,10 +45,7 @@ const InputPluginList& getInputPlugins() {
|
||||||
InputPlugin* PLUGIN_POOL[] = {
|
InputPlugin* PLUGIN_POOL[] = {
|
||||||
new KeyboardMouseDevice(),
|
new KeyboardMouseDevice(),
|
||||||
new SDL2Manager(),
|
new SDL2Manager(),
|
||||||
// Sixense is causing some sort of memory corruption on OSX
|
|
||||||
#ifndef Q_OS_MAC
|
|
||||||
new SixenseManager(),
|
new SixenseManager(),
|
||||||
#endif
|
|
||||||
new ViveControllerManager(),
|
new ViveControllerManager(),
|
||||||
nullptr
|
nullptr
|
||||||
};
|
};
|
||||||
|
|
|
@ -47,7 +47,7 @@ bool Oculus_0_5_DisplayPlugin::isSupported() const {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Oculus_0_5_DisplayPlugin::activate(PluginContainer * container) {
|
void Oculus_0_5_DisplayPlugin::init() {
|
||||||
if (!OVR_SUCCESS(ovr_Initialize(nullptr))) {
|
if (!OVR_SUCCESS(ovr_Initialize(nullptr))) {
|
||||||
Q_ASSERT(false);
|
Q_ASSERT(false);
|
||||||
qFatal("Failed to Initialize SDK");
|
qFatal("Failed to Initialize SDK");
|
||||||
|
@ -57,6 +57,16 @@ void Oculus_0_5_DisplayPlugin::activate(PluginContainer * container) {
|
||||||
qFatal("Failed to acquire HMD");
|
qFatal("Failed to acquire HMD");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void Oculus_0_5_DisplayPlugin::deinit() {
|
||||||
|
ovr_Shutdown();
|
||||||
|
|
||||||
|
ovrHmd_Destroy(_hmd);
|
||||||
|
_hmd = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Oculus_0_5_DisplayPlugin::activate(PluginContainer * container) {
|
||||||
OculusBaseDisplayPlugin::activate(container);
|
OculusBaseDisplayPlugin::activate(container);
|
||||||
|
|
||||||
_window->makeCurrent();
|
_window->makeCurrent();
|
||||||
|
@ -104,10 +114,6 @@ void Oculus_0_5_DisplayPlugin::deactivate(PluginContainer* container) {
|
||||||
_hmdWindow = nullptr;
|
_hmdWindow = nullptr;
|
||||||
|
|
||||||
OculusBaseDisplayPlugin::deactivate(container);
|
OculusBaseDisplayPlugin::deactivate(container);
|
||||||
|
|
||||||
ovrHmd_Destroy(_hmd);
|
|
||||||
_hmd = nullptr;
|
|
||||||
ovr_Shutdown();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Oculus_0_5_DisplayPlugin::preRender() {
|
void Oculus_0_5_DisplayPlugin::preRender() {
|
||||||
|
|
|
@ -25,6 +25,8 @@ public:
|
||||||
virtual bool isSupported() const override;
|
virtual bool isSupported() const override;
|
||||||
virtual const QString & getName() const override;
|
virtual const QString & getName() const override;
|
||||||
|
|
||||||
|
virtual void init() override;
|
||||||
|
virtual void deinit() override;
|
||||||
virtual void activate(PluginContainer * container) override;
|
virtual void activate(PluginContainer * container) override;
|
||||||
virtual void deactivate(PluginContainer* container) override;
|
virtual void deactivate(PluginContainer* container) override;
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,9 @@ public:
|
||||||
UserInputMapper::Input makeInput(unsigned int button, int index);
|
UserInputMapper::Input makeInput(unsigned int button, int index);
|
||||||
UserInputMapper::Input makeInput(JoystickAxisChannel axis, int index);
|
UserInputMapper::Input makeInput(JoystickAxisChannel axis, int index);
|
||||||
UserInputMapper::Input makeInput(JointChannel joint);
|
UserInputMapper::Input makeInput(JointChannel joint);
|
||||||
|
|
||||||
|
static const QString NAME;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setFilter(bool filter);
|
void setFilter(bool filter);
|
||||||
|
|
||||||
|
@ -118,8 +120,6 @@ private:
|
||||||
bool _hydrasConnected;
|
bool _hydrasConnected;
|
||||||
|
|
||||||
bool _invertButtons = DEFAULT_INVERT_SIXENSE_MOUSE_BUTTONS;
|
bool _invertButtons = DEFAULT_INVERT_SIXENSE_MOUSE_BUTTONS;
|
||||||
|
|
||||||
static const QString NAME;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_SixenseManager_h
|
#endif // hifi_SixenseManager_h
|
||||||
|
|
Loading…
Reference in a new issue