Showing the changes to interface/src/ui/ApplicationOverlay.cpp (1 of 123 files). Show all
Unified · Split
| @@ -13,7 +13,6 @@ · 12 unmodified lines | ||
| 13 | 13 | |
| 14 | 14 | #include <avatar/AvatarManager.h> |
| 15 | 15 | #include <GLMHelpers.h> |
| 16 | −#include <FramebufferCache.h> | |
| 17 | 16 | #include <GLMHelpers.h> |
| 18 | 17 | #include <OffscreenUi.h> |
| 19 | 18 | #include <CursorManager.h> |
| @@ -42,7 +41,6 @@ ApplicationOverlay::ApplicationOverlay() · 22 unmodified lines | ||
| 42 | 41 | _domainStatusBorder = geometryCache->allocateID(); |
| 43 | 42 | _magnifierBorder = geometryCache->allocateID(); |
| 44 | 43 | _qmlGeometryId = geometryCache->allocateID(); |
| 45 | − _rearViewGeometryId = geometryCache->allocateID(); | |
| 46 | 44 | } |
| 47 | 45 | |
| 48 | 46 | ApplicationOverlay::~ApplicationOverlay() { |
| @@ -51,7 +49,6 @@ ApplicationOverlay::~ApplicationOverlay() { · 2 unmodified lines | ||
| 51 | 49 | geometryCache->releaseID(_domainStatusBorder); |
| 52 | 50 | geometryCache->releaseID(_magnifierBorder); |
| 53 | 51 | geometryCache->releaseID(_qmlGeometryId); |
| 54 | − geometryCache->releaseID(_rearViewGeometryId); | |
| 55 | 52 | } |
| 56 | 53 | } |
| 57 | 54 | |
| @@ -86,7 +83,6 @@ void ApplicationOverlay::renderOverlay(RenderArgs* renderArgs) { · 28 unmodified lines | ||
| 86 | 83 | // Now render the overlay components together into a single texture |
| 87 | 84 | renderDomainConnectionStatusBorder(renderArgs); // renders the connected domain line |
| 88 | 85 | renderAudioScope(renderArgs); // audio scope in the very back - NOTE: this is the debug audio scope, not the VU meter |
| 89 | − renderRearView(renderArgs); // renders the mirror view selfie | |
| 90 | 86 | renderOverlays(renderArgs); // renders Scripts Overlay and AudioScope |
| 91 | 87 | renderQmlUi(renderArgs); // renders a unit quad with the QML UI texture, and the text overlays from scripts |
| 92 | 88 | renderStatsAndLogs(renderArgs); // currently renders nothing |
| @@ -163,45 +159,6 @@ void ApplicationOverlay::renderOverlays(RenderArgs* renderArgs) { · 70 unmodified lines | ||
| 163 | 159 | qApp->getOverlays().renderHUD(renderArgs); |
| 164 | 160 | } |
| 165 | 161 | |
| 166 | −void ApplicationOverlay::renderRearViewToFbo(RenderArgs* renderArgs) { | |
| 167 | −} | |
| 168 | − | |
| 169 | −void ApplicationOverlay::renderRearView(RenderArgs* renderArgs) { | |
| 170 | − if (!qApp->isHMDMode() && Menu::getInstance()->isOptionChecked(MenuOption::MiniMirror) && | |
| 171 | − !Menu::getInstance()->isOptionChecked(MenuOption::FullscreenMirror)) { | |
| 172 | − gpu::Batch& batch = *renderArgs->_batch; | |
| 173 | − | |
| 174 | − auto geometryCache = DependencyManager::get<GeometryCache>(); | |
| 175 | − | |
| 176 | − auto framebuffer = DependencyManager::get<FramebufferCache>(); | |
| 177 | − auto selfieTexture = framebuffer->getSelfieFramebuffer()->getRenderBuffer(0); | |
| 178 | − | |
| 179 | − int width = renderArgs->_viewport.z; | |
| 180 | − int height = renderArgs->_viewport.w; | |
| 181 | − mat4 legacyProjection = glm::ortho<float>(0, width, height, 0, ORTHO_NEAR_CLIP, ORTHO_FAR_CLIP); | |
| 182 | − batch.setProjectionTransform(legacyProjection); | |
| 183 | − batch.setModelTransform(Transform()); | |
| 184 | − batch.resetViewTransform(); | |
| 185 | − | |
| 186 | − float screenRatio = ((float)qApp->getDevicePixelRatio()); | |
| 187 | − float renderRatio = ((float)qApp->getRenderResolutionScale()); | |
| 188 | − | |
| 189 | − auto viewport = qApp->getMirrorViewRect(); | |
| 190 | − glm::vec2 bottomLeft(viewport.left(), viewport.top() + viewport.height()); | |
| 191 | − glm::vec2 topRight(viewport.left() + viewport.width(), viewport.top()); | |
| 192 | − bottomLeft *= screenRatio; | |
| 193 | − topRight *= screenRatio; | |
| 194 | − glm::vec2 texCoordMinCorner(0.0f, 0.0f); | |
| 195 | − glm::vec2 texCoordMaxCorner(viewport.width() * renderRatio / float(selfieTexture->getWidth()), viewport.height() * renderRatio / float(selfieTexture->getHeight())); | |
| 196 | − | |
| 197 | − batch.setResourceTexture(0, selfieTexture); | |
| 198 | − float alpha = DependencyManager::get<OffscreenUi>()->getDesktop()->property("unpinnedAlpha").toFloat(); | |
| 199 | − geometryCache->renderQuad(batch, bottomLeft, topRight, texCoordMinCorner, texCoordMaxCorner, glm::vec4(1.0f, 1.0f, 1.0f, alpha), _rearViewGeometryId); | |
| 200 | − | |
| 201 | − batch.setResourceTexture(0, renderArgs->_whiteTexture); | |
| 202 | − } | |
| 203 | −} | |
| 204 | − | |
| 205 | 162 | void ApplicationOverlay::renderStatsAndLogs(RenderArgs* renderArgs) { |
| 206 | 163 | |
| 207 | 164 | // Display stats and log text onscreen |