mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
Merge pull request #5429 from SamGondelman/macPluginsFix
Mac Sixense/Oculus init_hid fix
This commit is contained in:
commit
ce9a6298f0
5 changed files with 18 additions and 20 deletions
|
@ -535,18 +535,6 @@ 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());
|
||||||
|
|
||||||
// must be before initializeGL()
|
|
||||||
_activeInputPlugins.clear();
|
|
||||||
auto inputPlugins = getInputPlugins();
|
|
||||||
foreach(auto inputPlugin, inputPlugins) {
|
|
||||||
QString name = inputPlugin->getName();
|
|
||||||
if (name == KeyboardMouseDevice::NAME) {
|
|
||||||
_keyboardMouseDevice = static_cast<KeyboardMouseDevice*>(inputPlugin.data()); // TODO: this seems super hacky
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
updateInputModes();
|
|
||||||
|
|
||||||
_offscreenContext->makeCurrent();
|
_offscreenContext->makeCurrent();
|
||||||
initializeGL();
|
initializeGL();
|
||||||
// initialization continues in initializeGL when OpenGL context is ready
|
// initialization continues in initializeGL when OpenGL context is ready
|
||||||
|
@ -891,6 +879,17 @@ void Application::initializeUi() {
|
||||||
resizeGL();
|
resizeGL();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// This will set up the input plugins UI
|
||||||
|
_activeInputPlugins.clear();
|
||||||
|
auto inputPlugins = getInputPlugins();
|
||||||
|
foreach(auto inputPlugin, inputPlugins) {
|
||||||
|
QString name = inputPlugin->getName();
|
||||||
|
if (name == KeyboardMouseDevice::NAME) {
|
||||||
|
_keyboardMouseDevice = static_cast<KeyboardMouseDevice*>(inputPlugin.data()); // TODO: this seems super hacky
|
||||||
|
}
|
||||||
|
}
|
||||||
|
updateInputModes();
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename F>
|
template<typename F>
|
||||||
|
|
|
@ -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
|
||||||
};
|
};
|
||||||
|
|
|
@ -112,7 +112,9 @@ bool raySphereIntersect(const glm::vec3 &dir, const glm::vec3 &origin, float r,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ApplicationCompositor::ApplicationCompositor() {
|
ApplicationCompositor::ApplicationCompositor() :
|
||||||
|
_alphaPropertyAnimation(new QPropertyAnimation(this, "alpha"))
|
||||||
|
{
|
||||||
memset(_reticleActive, 0, sizeof(_reticleActive));
|
memset(_reticleActive, 0, sizeof(_reticleActive));
|
||||||
memset(_magActive, 0, sizeof(_reticleActive));
|
memset(_magActive, 0, sizeof(_reticleActive));
|
||||||
memset(_magSizeMult, 0, sizeof(_magSizeMult));
|
memset(_magSizeMult, 0, sizeof(_magSizeMult));
|
||||||
|
|
|
@ -56,7 +56,7 @@ void Oculus_0_5_DisplayPlugin::activate(PluginContainer * container) {
|
||||||
if (!_hmd) {
|
if (!_hmd) {
|
||||||
qFatal("Failed to acquire HMD");
|
qFatal("Failed to acquire HMD");
|
||||||
}
|
}
|
||||||
|
|
||||||
OculusBaseDisplayPlugin::activate(container);
|
OculusBaseDisplayPlugin::activate(container);
|
||||||
|
|
||||||
_window->makeCurrent();
|
_window->makeCurrent();
|
||||||
|
@ -104,7 +104,7 @@ void Oculus_0_5_DisplayPlugin::deactivate(PluginContainer* container) {
|
||||||
_hmdWindow = nullptr;
|
_hmdWindow = nullptr;
|
||||||
|
|
||||||
OculusBaseDisplayPlugin::deactivate(container);
|
OculusBaseDisplayPlugin::deactivate(container);
|
||||||
|
|
||||||
ovrHmd_Destroy(_hmd);
|
ovrHmd_Destroy(_hmd);
|
||||||
_hmd = nullptr;
|
_hmd = nullptr;
|
||||||
ovr_Shutdown();
|
ovr_Shutdown();
|
||||||
|
|
|
@ -83,7 +83,7 @@ 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);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setFilter(bool filter);
|
void setFilter(bool filter);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue