History

move TextureCache out of interface and Application

ZappoMan committed 11 years ago

Commit e253b8a1 parent 0b85a4c10 files · +49 −20Browse files

Showing the changes to interface/src/Application.cpp (1 of 10 files). Show all

Unified · Split

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

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