History

Merge remote-tracking branch 'upstream/master' into smarter_textures

Brad Davis committed 9 years ago

Commit e482eac2 parents 5a6478c 92e3f87123 files · +3184 −1521Browse files

Showing the changes to interface/src/ui/ApplicationOverlay.cpp (1 of 123 files). Show all

Unified · Split

interface/src/ui/ApplicationOverlay.cpp+0−43
@@ -13,7 +13,6 @@ · 12 unmodified lines
1313
1414 #include <avatar/AvatarManager.h>
1515 #include <GLMHelpers.h>
16−#include <FramebufferCache.h>
1716 #include <GLMHelpers.h>
1817 #include <OffscreenUi.h>
1918 #include <CursorManager.h>
@@ -42,7 +41,6 @@ ApplicationOverlay::ApplicationOverlay() · 22 unmodified lines
4241 _domainStatusBorder = geometryCache->allocateID();
4342 _magnifierBorder = geometryCache->allocateID();
4443 _qmlGeometryId = geometryCache->allocateID();
45− _rearViewGeometryId = geometryCache->allocateID();
4644 }
4745
4846 ApplicationOverlay::~ApplicationOverlay() {
@@ -51,7 +49,6 @@ ApplicationOverlay::~ApplicationOverlay() { · 2 unmodified lines
5149 geometryCache->releaseID(_domainStatusBorder);
5250 geometryCache->releaseID(_magnifierBorder);
5351 geometryCache->releaseID(_qmlGeometryId);
54− geometryCache->releaseID(_rearViewGeometryId);
5552 }
5653 }
5754
@@ -86,7 +83,6 @@ void ApplicationOverlay::renderOverlay(RenderArgs* renderArgs) { · 28 unmodified lines
8683 // Now render the overlay components together into a single texture
8784 renderDomainConnectionStatusBorder(renderArgs); // renders the connected domain line
8885 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
9086 renderOverlays(renderArgs); // renders Scripts Overlay and AudioScope
9187 renderQmlUi(renderArgs); // renders a unit quad with the QML UI texture, and the text overlays from scripts
9288 renderStatsAndLogs(renderArgs); // currently renders nothing
@@ -163,45 +159,6 @@ void ApplicationOverlay::renderOverlays(RenderArgs* renderArgs) { · 70 unmodified lines
163159 qApp->getOverlays().renderHUD(renderArgs);
164160 }
165161
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−
205162 void ApplicationOverlay::renderStatsAndLogs(RenderArgs* renderArgs) {
206163
207164 // Display stats and log text onscreen