Showing the changes to interface/src/Application.cpp (1 of 13 files). Show all
Unified · Split
| @@ -620,10 +620,10 @@ void Application::paintGL() { · 619 unmodified lines | ||
| 620 | 620 | // Set the desired FBO texture size. If it hasn't changed, this does nothing. |
| 621 | 621 | // Otherwise, it must rebuild the FBOs |
| 622 | 622 | if (OculusManager::isConnected()) { |
| 623 | − TextureCache::getInstance()->setFrameBufferSize(OculusManager::getRenderTargetSize()); | |
| 623 | + DependencyManager::get<TextureCache>()->setFrameBufferSize(OculusManager::getRenderTargetSize()); | |
| 624 | 624 | } else { |
| 625 | 625 | QSize fbSize = _glWidget->getDeviceSize() * getRenderResolutionScale(); |
| 626 | − TextureCache::getInstance()->setFrameBufferSize(fbSize); | |
| 626 | + DependencyManager::get<TextureCache>()->setFrameBufferSize(fbSize); | |
| 627 | 627 | } |
| 628 | 628 | |
| 629 | 629 | glEnable(GL_LINE_SMOOTH); |
| @@ -713,7 +713,7 @@ void Application::paintGL() { · 83 unmodified lines | ||
| 713 | 713 | _glowEffect.prepare(); |
| 714 | 714 | |
| 715 | 715 | // Viewport is assigned to the size of the framebuffer |
| 716 | − QSize size = TextureCache::getInstance()->getPrimaryFramebufferObject()->size(); | |
| 716 | + QSize size = DependencyManager::get<TextureCache>()->getPrimaryFramebufferObject()->size(); | |
| 717 | 717 | glViewport(0, 0, size.width(), size.height()); |
| 718 | 718 | |
| 719 | 719 | glMatrixMode(GL_MODELVIEW); |
| @@ -2043,7 +2043,7 @@ void Application::init() { · 1323 unmodified lines | ||
| 2043 | 2043 | connect(_myAvatar, &MyAvatar::transformChanged, this, &Application::bumpSettings); |
| 2044 | 2044 | |
| 2045 | 2045 | // make sure our texture cache knows about window size changes |
| 2046 | − TextureCache::getInstance()->associateWithWidget(getGLWidget()); | |
| 2046 | + DependencyManager::get<TextureCache>()->associateWithWidget(getGLWidget()); | |
| 2047 | 2047 | } |
| 2048 | 2048 | |
| 2049 | 2049 | void Application::closeMirrorView() { |
| @@ -2774,7 +2774,7 @@ glm::vec3 Application::getSunDirection() { · 724 unmodified lines | ||
| 2774 | 2774 | |
| 2775 | 2775 | void Application::updateShadowMap() { |
| 2776 | 2776 | PerformanceTimer perfTimer("shadowMap"); |
| 2777 | − QOpenGLFramebufferObject* fbo = TextureCache::getInstance()->getShadowFramebufferObject(); | |
| 2777 | + QOpenGLFramebufferObject* fbo = DependencyManager::get<TextureCache>()->getShadowFramebufferObject(); | |
| 2778 | 2778 | fbo->bind(); |
| 2779 | 2779 | glEnable(GL_DEPTH_TEST); |
| 2780 | 2780 | glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); |
| @@ -2939,7 +2939,7 @@ void Application::setupWorldLight() { · 158 unmodified lines | ||
| 2939 | 2939 | } |
| 2940 | 2940 | |
| 2941 | 2941 | QImage Application::renderAvatarBillboard() { |
| 2942 | − TextureCache::getInstance()->getPrimaryFramebufferObject()->bind(); | |
| 2942 | + DependencyManager::get<TextureCache>()->getPrimaryFramebufferObject()->bind(); | |
| 2943 | 2943 | |
| 2944 | 2944 | // the "glow" here causes an alpha of one |
| 2945 | 2945 | Glower glower; |
| @@ -2950,7 +2950,7 @@ QImage Application::renderAvatarBillboard() { · 4 unmodified lines | ||
| 2950 | 2950 | QImage image(BILLBOARD_SIZE, BILLBOARD_SIZE, QImage::Format_ARGB32); |
| 2951 | 2951 | glReadPixels(0, 0, BILLBOARD_SIZE, BILLBOARD_SIZE, GL_BGRA, GL_UNSIGNED_BYTE, image.bits()); |
| 2952 | 2952 | |
| 2953 | − TextureCache::getInstance()->getPrimaryFramebufferObject()->release(); | |
| 2953 | + DependencyManager::get<TextureCache>()->getPrimaryFramebufferObject()->release(); | |
| 2954 | 2954 | |
| 2955 | 2955 | return image; |
| 2956 | 2956 | } |
| @@ -3301,12 +3301,12 @@ void Application::renderRearViewMirror(const QRect& region, bool billboard) { · 344 unmodified lines | ||
| 3301 | 3301 | |
| 3302 | 3302 | // set the bounds of rear mirror view |
| 3303 | 3303 | if (billboard) { |
| 3304 | − QSize size = TextureCache::getInstance()->getFrameBufferSize(); | |
| 3304 | + QSize size = DependencyManager::get<TextureCache>()->getFrameBufferSize(); | |
| 3305 | 3305 | glViewport(region.x(), size.height() - region.y() - region.height(), region.width(), region.height()); |
| 3306 | 3306 | glScissor(region.x(), size.height() - region.y() - region.height(), region.width(), region.height()); |
| 3307 | 3307 | } else { |
| 3308 | 3308 | // if not rendering the billboard, the region is in device independent coordinates; must convert to device |
| 3309 | − QSize size = TextureCache::getInstance()->getFrameBufferSize(); | |
| 3309 | + QSize size = DependencyManager::get<TextureCache>()->getFrameBufferSize(); | |
| 3310 | 3310 | float ratio = QApplication::desktop()->windowHandle()->devicePixelRatio() * getRenderResolutionScale(); |
| 3311 | 3311 | int x = region.x() * ratio, y = region.y() * ratio, width = region.width() * ratio, height = region.height() * ratio; |
| 3312 | 3312 | glViewport(x, size.height() - y - height, width, height); |