mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 09:23:17 +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->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();
|
||||
initializeGL();
|
||||
// initialization continues in initializeGL when OpenGL context is ready
|
||||
|
@ -891,6 +879,17 @@ void Application::initializeUi() {
|
|||
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>
|
||||
|
|
|
@ -28,7 +28,7 @@ static void addInputPluginToMenu(InputPluginPointer inputPlugin, bool active = f
|
|||
}
|
||||
auto parent = menu->getMenu(MenuOption::InputMenu);
|
||||
auto action = menu->addCheckableActionToQMenuAndActionHash(parent,
|
||||
name, 0, true, qApp,
|
||||
name, 0, active, qApp,
|
||||
SLOT(updateInputModes()));
|
||||
inputPluginGroup->addAction(action);
|
||||
inputPluginGroup->setExclusive(false);
|
||||
|
@ -45,10 +45,7 @@ const InputPluginList& getInputPlugins() {
|
|||
InputPlugin* PLUGIN_POOL[] = {
|
||||
new KeyboardMouseDevice(),
|
||||
new SDL2Manager(),
|
||||
// Sixense is causing some sort of memory corruption on OSX
|
||||
#ifndef Q_OS_MAC
|
||||
new SixenseManager(),
|
||||
#endif
|
||||
new ViveControllerManager(),
|
||||
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(_magActive, 0, sizeof(_reticleActive));
|
||||
memset(_magSizeMult, 0, sizeof(_magSizeMult));
|
||||
|
|
|
@ -56,7 +56,7 @@ void Oculus_0_5_DisplayPlugin::activate(PluginContainer * container) {
|
|||
if (!_hmd) {
|
||||
qFatal("Failed to acquire HMD");
|
||||
}
|
||||
|
||||
|
||||
OculusBaseDisplayPlugin::activate(container);
|
||||
|
||||
_window->makeCurrent();
|
||||
|
@ -104,7 +104,7 @@ void Oculus_0_5_DisplayPlugin::deactivate(PluginContainer* container) {
|
|||
_hmdWindow = nullptr;
|
||||
|
||||
OculusBaseDisplayPlugin::deactivate(container);
|
||||
|
||||
|
||||
ovrHmd_Destroy(_hmd);
|
||||
_hmd = nullptr;
|
||||
ovr_Shutdown();
|
||||
|
|
|
@ -83,7 +83,7 @@ public:
|
|||
UserInputMapper::Input makeInput(unsigned int button, int index);
|
||||
UserInputMapper::Input makeInput(JoystickAxisChannel axis, int index);
|
||||
UserInputMapper::Input makeInput(JointChannel joint);
|
||||
|
||||
|
||||
public slots:
|
||||
void setFilter(bool filter);
|
||||
|
||||
|
|
Loading…
Reference in a new issue