mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 02:03:11 +02:00
fixed init crash if you follow very specific startup steps
This commit is contained in:
parent
0e4d065cbc
commit
1af51572af
4 changed files with 20 additions and 21 deletions
|
@ -535,21 +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());
|
||||||
|
|
||||||
// Necessary to call this here so Oculus can get inited before Sixense
|
|
||||||
getDisplayPlugins();
|
|
||||||
|
|
||||||
// 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
|
||||||
|
@ -894,6 +879,20 @@ void Application::initializeUi() {
|
||||||
resizeGL();
|
resizeGL();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// This will prevent the hid_init sixense crash
|
||||||
|
getActiveDisplayPlugin();
|
||||||
|
|
||||||
|
// 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>
|
||||||
|
|
|
@ -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,14 +56,12 @@ void Oculus_0_5_DisplayPlugin::init() {
|
||||||
if (!_hmd) {
|
if (!_hmd) {
|
||||||
qFatal("Failed to acquire HMD");
|
qFatal("Failed to acquire HMD");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Oculus_0_5_DisplayPlugin::deinit() {
|
void Oculus_0_5_DisplayPlugin::deinit() {
|
||||||
ovr_Shutdown();
|
|
||||||
|
|
||||||
ovrHmd_Destroy(_hmd);
|
ovrHmd_Destroy(_hmd);
|
||||||
_hmd = nullptr;
|
_hmd = nullptr;
|
||||||
|
ovr_Shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Oculus_0_5_DisplayPlugin::activate(PluginContainer * container) {
|
void Oculus_0_5_DisplayPlugin::activate(PluginContainer * container) {
|
||||||
|
|
|
@ -84,8 +84,6 @@ public:
|
||||||
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);
|
||||||
|
|
||||||
|
@ -120,6 +118,8 @@ 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