Showing the changes to interface/src/Application.cpp (1 of 10 files). Show all
Unified · Split
| @@ -177,6 +177,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 176 unmodified lines | ||
| 177 | 177 | _touchAvgY(0.0f), |
| 178 | 178 | _isTouchPressed(false), |
| 179 | 179 | _mousePressed(false), |
| 180 | + _textureCache(NULL), | |
| 180 | 181 | _audio(), |
| 181 | 182 | _enableProcessVoxelsThread(true), |
| 182 | 183 | _octreeProcessor(), |
| @@ -194,6 +195,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 11 unmodified lines | ||
| 194 | 195 | _isVSyncOn(true), |
| 195 | 196 | _aboutToQuit(false) |
| 196 | 197 | { |
| 198 | + _textureCache = TextureCache::getInstance(); | |
| 197 | 199 | |
| 198 | 200 | // read the ApplicationInfo.ini file for Name/Version/Domain information |
| 199 | 201 | QSettings applicationInfo(Application::resourcesPath() + "info/ApplicationInfo.ini", QSettings::IniFormat); |
| @@ -621,10 +623,10 @@ void Application::paintGL() { · 421 unmodified lines | ||
| 621 | 623 | // Set the desired FBO texture size. If it hasn't changed, this does nothing. |
| 622 | 624 | // Otherwise, it must rebuild the FBOs |
| 623 | 625 | if (OculusManager::isConnected()) { |
| 624 | − _textureCache.setFrameBufferSize(OculusManager::getRenderTargetSize()); | |
| 626 | + _textureCache->setFrameBufferSize(OculusManager::getRenderTargetSize()); | |
| 625 | 627 | } else { |
| 626 | 628 | QSize fbSize = _glWidget->getDeviceSize() * getRenderResolutionScale(); |
| 627 | − _textureCache.setFrameBufferSize(fbSize); | |
| 629 | + _textureCache->setFrameBufferSize(fbSize); | |
| 628 | 630 | } |
| 629 | 631 | |
| 630 | 632 | glEnable(GL_LINE_SMOOTH); |
| @@ -2042,6 +2044,9 @@ void Application::init() { · 1411 unmodified lines | ||
| 2042 | 2044 | |
| 2043 | 2045 | // save settings when avatar changes |
| 2044 | 2046 | connect(_myAvatar, &MyAvatar::transformChanged, this, &Application::bumpSettings); |
| 2047 | + | |
| 2048 | + // make sure our texture cache knows about window size changes | |
| 2049 | + _textureCache->associateWithWidget(getGLWidget()); | |
| 2045 | 2050 | } |
| 2046 | 2051 | |
| 2047 | 2052 | void Application::closeMirrorView() { |
| @@ -2772,7 +2777,7 @@ glm::vec3 Application::getSunDirection() { · 724 unmodified lines | ||
| 2772 | 2777 | |
| 2773 | 2778 | void Application::updateShadowMap() { |
| 2774 | 2779 | PerformanceTimer perfTimer("shadowMap"); |
| 2775 | − QOpenGLFramebufferObject* fbo = _textureCache.getShadowFramebufferObject(); | |
| 2780 | + QOpenGLFramebufferObject* fbo = _textureCache->getShadowFramebufferObject(); | |
| 2776 | 2781 | fbo->bind(); |
| 2777 | 2782 | glEnable(GL_DEPTH_TEST); |
| 2778 | 2783 | glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); |
| @@ -2937,7 +2942,7 @@ void Application::setupWorldLight() { · 158 unmodified lines | ||
| 2937 | 2942 | } |
| 2938 | 2943 | |
| 2939 | 2944 | QImage Application::renderAvatarBillboard() { |
| 2940 | − _textureCache.getPrimaryFramebufferObject()->bind(); | |
| 2945 | + _textureCache->getPrimaryFramebufferObject()->bind(); | |
| 2941 | 2946 | |
| 2942 | 2947 | // the "glow" here causes an alpha of one |
| 2943 | 2948 | Glower glower; |
| @@ -2948,7 +2953,7 @@ QImage Application::renderAvatarBillboard() { · 4 unmodified lines | ||
| 2948 | 2953 | QImage image(BILLBOARD_SIZE, BILLBOARD_SIZE, QImage::Format_ARGB32); |
| 2949 | 2954 | glReadPixels(0, 0, BILLBOARD_SIZE, BILLBOARD_SIZE, GL_BGRA, GL_UNSIGNED_BYTE, image.bits()); |
| 2950 | 2955 | |
| 2951 | − _textureCache.getPrimaryFramebufferObject()->release(); | |
| 2956 | + _textureCache->getPrimaryFramebufferObject()->release(); | |
| 2952 | 2957 | |
| 2953 | 2958 | return image; |
| 2954 | 2959 | } |