mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 09:57:26 +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));
|
||||||
|
|
Loading…
Reference in a new issue