History

Merge pull request #7690 from ZappoMan/improveHMD

Introduce "recommended overlay rectangle" to display plugins

Brad Hefta-Gaub committed 10 years ago

Commit 0ac96012 parents 5ae1e70 f5cddc915 files · +224 −42Browse files

Showing the changes to interface/src/Application.cpp (1 of 15 files). Show all

Unified · Split

interface/src/Application.cpp+29−6
@@ -2681,8 +2681,6 @@ void Application::idle(uint64_t now) { · 2680 unmodified lines
2681 _overlayConductor.setEnabled(Menu::getInstance()->isOptionChecked(MenuOption::Overlays));2681 _overlayConductor.setEnabled(Menu::getInstance()->isOptionChecked(MenuOption::Overlays));
2682 }2682 }
2683 2683
2684
2685
2686 // If the offscreen Ui has something active that is NOT the root, then assume it has keyboard focus.2684 // If the offscreen Ui has something active that is NOT the root, then assume it has keyboard focus.
2687 auto offscreenUi = DependencyManager::get<OffscreenUi>();2685 auto offscreenUi = DependencyManager::get<OffscreenUi>();
2688 if (_keyboardDeviceHasFocus && offscreenUi && offscreenUi->getWindow()->activeFocusItem() != offscreenUi->getRootItem()) {2686 if (_keyboardDeviceHasFocus && offscreenUi && offscreenUi->getWindow()->activeFocusItem() != offscreenUi->getRootItem()) {
@@ -4894,19 +4892,44 @@ QRect Application::getRenderingGeometry() const { · 2205 unmodified lines
4894}4892}
4895 4893
4896glm::uvec2 Application::getUiSize() const {4894glm::uvec2 Application::getUiSize() const {
4897 return getActiveDisplayPlugin()->getRecommendedUiSize();4895 static const uint MIN_SIZE = 1;
4896 glm::uvec2 result(MIN_SIZE);
4897 if (_displayPlugin) {
4898 result = getActiveDisplayPlugin()->getRecommendedUiSize();
4899 }
4900 return result;
4901}
4902
4903QRect Application::getRecommendedOverlayRect() const {
4904 auto uiSize = getUiSize();
4905 QRect result(0, 0, uiSize.x, uiSize.y);
4906 if (_displayPlugin) {
4907 result = getActiveDisplayPlugin()->getRecommendedOverlayRect();
4908 }
4909 return result;
4898}4910}
4899 4911
4900QSize Application::getDeviceSize() const {4912QSize Application::getDeviceSize() const {
4901 return fromGlm(getActiveDisplayPlugin()->getRecommendedRenderSize());4913 static const int MIN_SIZE = 1;
4914 QSize result(MIN_SIZE, MIN_SIZE);
4915 if (_displayPlugin) {
4916 result = fromGlm(getActiveDisplayPlugin()->getRecommendedRenderSize());
4917 }
4918 return result;
4902}4919}
4903 4920
4904bool Application::isThrottleRendering() const {4921bool Application::isThrottleRendering() const {
4905 return getActiveDisplayPlugin()->isThrottled();4922 if (_displayPlugin) {
4923 return getActiveDisplayPlugin()->isThrottled();
4924 }
4925 return false;
4906}4926}
4907 4927
4908bool Application::hasFocus() const {4928bool Application::hasFocus() const {
4909 return getActiveDisplayPlugin()->hasFocus();4929 if (_displayPlugin) {
4930 return getActiveDisplayPlugin()->hasFocus();
4931 }
4932 return (QApplication::activeWindow() != nullptr);
4910}4933}
4911 4934
4912glm::vec2 Application::getViewportDimensions() const {4935glm::vec2 Application::getViewportDimensions() const {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t