mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 15:43:50 +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->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();
|
||||
initializeGL();
|
||||
// initialization continues in initializeGL when OpenGL context is ready
|
||||
|
@ -894,6 +879,20 @@ void Application::initializeUi() {
|
|||
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>
|
||||
|
|
|
@ -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,14 +56,12 @@ void Oculus_0_5_DisplayPlugin::init() {
|
|||
if (!_hmd) {
|
||||
qFatal("Failed to acquire HMD");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Oculus_0_5_DisplayPlugin::deinit() {
|
||||
ovr_Shutdown();
|
||||
|
||||
ovrHmd_Destroy(_hmd);
|
||||
_hmd = nullptr;
|
||||
ovr_Shutdown();
|
||||
}
|
||||
|
||||
void Oculus_0_5_DisplayPlugin::activate(PluginContainer * container) {
|
||||
|
|
|
@ -84,8 +84,6 @@ public:
|
|||
UserInputMapper::Input makeInput(JoystickAxisChannel axis, int index);
|
||||
UserInputMapper::Input makeInput(JointChannel joint);
|
||||
|
||||
static const QString NAME;
|
||||
|
||||
public slots:
|
||||
void setFilter(bool filter);
|
||||
|
||||
|
@ -120,6 +118,8 @@ private:
|
|||
bool _hydrasConnected;
|
||||
|
||||
bool _invertButtons = DEFAULT_INVERT_SIXENSE_MOUSE_BUTTONS;
|
||||
|
||||
static const QString NAME;
|
||||
};
|
||||
|
||||
#endif // hifi_SixenseManager_h
|
||||
|
|
Loading…
Reference in a new issue