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
26812681 _overlayConductor.setEnabled(Menu::getInstance()->isOptionChecked(MenuOption::Overlays));
26822682 }
26832683
2684−
2685−
26862684 // If the offscreen Ui has something active that is NOT the root, then assume it has keyboard focus.
26872685 auto offscreenUi = DependencyManager::get<OffscreenUi>();
26882686 if (_keyboardDeviceHasFocus && offscreenUi && offscreenUi->getWindow()->activeFocusItem() != offscreenUi->getRootItem()) {
@@ -4894,19 +4892,44 @@ QRect Application::getRenderingGeometry() const { · 2205 unmodified lines
48944892 }
48954893
48964894 glm::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+
4903+QRect 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;
48984910 }
48994911
49004912 QSize 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;
49024919 }
49034920
49044921 bool Application::isThrottleRendering() const {
4905− return getActiveDisplayPlugin()->isThrottled();
4922+ if (_displayPlugin) {
4923+ return getActiveDisplayPlugin()->isThrottled();
4924+ }
4925+ return false;
49064926 }
49074927
49084928 bool Application::hasFocus() const {
4909− return getActiveDisplayPlugin()->hasFocus();
4929+ if (_displayPlugin) {
4930+ return getActiveDisplayPlugin()->hasFocus();
4931+ }
4932+ return (QApplication::activeWindow() != nullptr);
49104933 }
49114934
49124935 glm::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