PLUGINS - Cleaning up HMD tools
Showing the changes to interface/src/Application.cpp (1 of 4 files). Show all
Unified · Split
| @@ -4595,18 +4595,22 @@ void Application::updateDisplayMode() { · 4594 unmodified lines | |||
| 4595 | _offscreenContext->makeCurrent(); | 4595 | _offscreenContext->makeCurrent(); |
| 4596 | offscreenUi->resize(fromGlm(newDisplayPlugin->getRecommendedUiSize())); | 4596 | offscreenUi->resize(fromGlm(newDisplayPlugin->getRecommendedUiSize())); |
| 4597 | _offscreenContext->makeCurrent(); | 4597 | _offscreenContext->makeCurrent(); |
| 4598 | if (newDisplayPlugin->isHmd()) { | ||
| 4599 | showDisplayPluginsTools(); | ||
| 4600 | } | ||
| 4601 | } | 4598 | } |
| 4602 | 4599 | ||
| 4603 | oldDisplayPlugin = _displayPlugin; | 4600 | oldDisplayPlugin = _displayPlugin; |
| 4604 | _displayPlugin = newDisplayPlugin; | 4601 | _displayPlugin = newDisplayPlugin; |
| 4605 | 4602 | ||
| 4603 | // Only show the hmd tools after the correct plugin has | ||
| 4604 | // been activated so that it's UI is setup correctly | ||
| 4605 | if (newDisplayPlugin->isHmd()) { | ||
| 4606 | showDisplayPluginsTools(); | ||
| 4607 | } | ||
| 4608 | |||
| 4606 | if (oldDisplayPlugin) { | 4609 | if (oldDisplayPlugin) { |
| 4607 | oldDisplayPlugin->deactivate(); | 4610 | oldDisplayPlugin->deactivate(); |
| 4608 | _offscreenContext->makeCurrent(); | 4611 | _offscreenContext->makeCurrent(); |
| 4609 | } | 4612 | } |
| 4613 | emit activeDisplayPluginChanged(); | ||
| 4610 | resetSensors(); | 4614 | resetSensors(); |
| 4611 | } | 4615 | } |
| 4612 | Q_ASSERT_X(_displayPlugin, "Application::updateDisplayMode", "could not find an activated display plugin"); | 4616 | Q_ASSERT_X(_displayPlugin, "Application::updateDisplayMode", "could not find an activated display plugin"); |