History

make TextureCache work with DependancyManager

ZappoMan committed 11 years ago

Commit 7d75d2d1 parent c6b033f13 files · +70 −78Browse files

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

Unified · Split

interface/src/Application.cpp+9−9
@@ -620,10 +620,10 @@ void Application::paintGL() { · 619 unmodified lines
620620 // Set the desired FBO texture size. If it hasn't changed, this does nothing.
621621 // Otherwise, it must rebuild the FBOs
622622 if (OculusManager::isConnected()) {
623− TextureCache::getInstance()->setFrameBufferSize(OculusManager::getRenderTargetSize());
623+ DependencyManager::get<TextureCache>()->setFrameBufferSize(OculusManager::getRenderTargetSize());
624624 } else {
625625 QSize fbSize = _glWidget->getDeviceSize() * getRenderResolutionScale();
626− TextureCache::getInstance()->setFrameBufferSize(fbSize);
626+ DependencyManager::get<TextureCache>()->setFrameBufferSize(fbSize);
627627 }
628628
629629 glEnable(GL_LINE_SMOOTH);
@@ -713,7 +713,7 @@ void Application::paintGL() { · 83 unmodified lines
713713 _glowEffect.prepare();
714714
715715 // Viewport is assigned to the size of the framebuffer
716− QSize size = TextureCache::getInstance()->getPrimaryFramebufferObject()->size();
716+ QSize size = DependencyManager::get<TextureCache>()->getPrimaryFramebufferObject()->size();
717717 glViewport(0, 0, size.width(), size.height());
718718
719719 glMatrixMode(GL_MODELVIEW);
@@ -2043,7 +2043,7 @@ void Application::init() { · 1323 unmodified lines
20432043 connect(_myAvatar, &MyAvatar::transformChanged, this, &Application::bumpSettings);
20442044
20452045 // make sure our texture cache knows about window size changes
2046− TextureCache::getInstance()->associateWithWidget(getGLWidget());
2046+ DependencyManager::get<TextureCache>()->associateWithWidget(getGLWidget());
20472047 }
20482048
20492049 void Application::closeMirrorView() {
@@ -2774,7 +2774,7 @@ glm::vec3 Application::getSunDirection() { · 724 unmodified lines
27742774
27752775 void Application::updateShadowMap() {
27762776 PerformanceTimer perfTimer("shadowMap");
2777− QOpenGLFramebufferObject* fbo = TextureCache::getInstance()->getShadowFramebufferObject();
2777+ QOpenGLFramebufferObject* fbo = DependencyManager::get<TextureCache>()->getShadowFramebufferObject();
27782778 fbo->bind();
27792779 glEnable(GL_DEPTH_TEST);
27802780 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
@@ -2939,7 +2939,7 @@ void Application::setupWorldLight() { · 158 unmodified lines
29392939 }
29402940
29412941 QImage Application::renderAvatarBillboard() {
2942− TextureCache::getInstance()->getPrimaryFramebufferObject()->bind();
2942+ DependencyManager::get<TextureCache>()->getPrimaryFramebufferObject()->bind();
29432943
29442944 // the "glow" here causes an alpha of one
29452945 Glower glower;
@@ -2950,7 +2950,7 @@ QImage Application::renderAvatarBillboard() { · 4 unmodified lines
29502950 QImage image(BILLBOARD_SIZE, BILLBOARD_SIZE, QImage::Format_ARGB32);
29512951 glReadPixels(0, 0, BILLBOARD_SIZE, BILLBOARD_SIZE, GL_BGRA, GL_UNSIGNED_BYTE, image.bits());
29522952
2953− TextureCache::getInstance()->getPrimaryFramebufferObject()->release();
2953+ DependencyManager::get<TextureCache>()->getPrimaryFramebufferObject()->release();
29542954
29552955 return image;
29562956 }
@@ -3301,12 +3301,12 @@ void Application::renderRearViewMirror(const QRect& region, bool billboard) { · 344 unmodified lines
33013301
33023302 // set the bounds of rear mirror view
33033303 if (billboard) {
3304− QSize size = TextureCache::getInstance()->getFrameBufferSize();
3304+ QSize size = DependencyManager::get<TextureCache>()->getFrameBufferSize();
33053305 glViewport(region.x(), size.height() - region.y() - region.height(), region.width(), region.height());
33063306 glScissor(region.x(), size.height() - region.y() - region.height(), region.width(), region.height());
33073307 } else {
33083308 // 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();
33103310 float ratio = QApplication::desktop()->windowHandle()->devicePixelRatio() * getRenderResolutionScale();
33113311 int x = region.x() * ratio, y = region.y() * ratio, width = region.width() * ratio, height = region.height() * ratio;
33123312 glViewport(x, size.height() - y - height, width, height);

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