History

Removing almost all the QFramebufferObject (instead in overlay layer) in favor of gpu::Framebuffer, eveyrthing seems to work properly

Sam Gateau committed 11 years ago

Commit fec52f61 parent 870302313 files · +133 −288Browse files

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

Unified · Split

interface/src/Application.cpp+4−8
@@ -35,7 +35,6 @@ · 34 unmodified lines
3535 #include <QMouseEvent>
3636 #include <QNetworkReply>
3737 #include <QNetworkDiskCache>
38−#include <QOpenGLFramebufferObject>
3938 #include <QObject>
4039 #include <QWheelEvent>
4140 #include <QScreen>
@@ -798,7 +797,6 @@ void Application::paintGL() { · 756 unmodified lines
798797 DependencyManager::get<GlowEffect>()->prepare();
799798
800799 // Viewport is assigned to the size of the framebuffer
801− // QSize size = DependencyManager::get<TextureCache>()->getPrimaryFramebufferObject()->size();
802800 QSize size = DependencyManager::get<TextureCache>()->getFrameBufferSize();
803801 glViewport(0, 0, size.width(), size.height());
804802
@@ -2637,11 +2635,8 @@ void Application::updateShadowMap() { · 1832 unmodified lines
26372635 activeRenderingThread = QThread::currentThread();
26382636
26392637 PerformanceTimer perfTimer("shadowMap");
2640−// QOpenGLFramebufferObject* fbo = DependencyManager::get<TextureCache>()->getShadowFramebufferObject();
2641−// fbo->bind();
26422638 auto shadowFramebuffer = DependencyManager::get<TextureCache>()->getShadowFramebuffer();
2643− GLuint shadowFBO = gpu::GLBackend::getFramebufferID(shadowFramebuffer);
2644− glBindFramebuffer(GL_FRAMEBUFFER, shadowFBO);
2639+ glBindFramebuffer(GL_FRAMEBUFFER, gpu::GLBackend::getFramebufferID(shadowFramebuffer));
26452640
26462641 glEnable(GL_DEPTH_TEST);
26472642 glClear(GL_DEPTH_BUFFER_BIT);
@@ -2838,7 +2833,8 @@ PickRay Application::computePickRay(float x, float y) { · 190 unmodified lines
28382833 }
28392834
28402835 QImage Application::renderAvatarBillboard() {
2841− DependencyManager::get<TextureCache>()->getPrimaryFramebufferObject()->bind();
2836+ auto primaryFramebuffer = DependencyManager::get<TextureCache>()->getPrimaryFramebuffer();
2837+ glBindFramebuffer(GL_FRAMEBUFFER, gpu::GLBackend::getFramebufferID(primaryFramebuffer));
28422838
28432839 // the "glow" here causes an alpha of one
28442840 Glower glower;
@@ -2851,7 +2847,7 @@ QImage Application::renderAvatarBillboard() { · 6 unmodified lines
28512847 QImage image(BILLBOARD_SIZE, BILLBOARD_SIZE, QImage::Format_ARGB32);
28522848 glReadPixels(0, 0, BILLBOARD_SIZE, BILLBOARD_SIZE, GL_BGRA, GL_UNSIGNED_BYTE, image.bits());
28532849
2854− DependencyManager::get<TextureCache>()->getPrimaryFramebufferObject()->release();
2850+ glBindFramebuffer(GL_FRAMEBUFFER, 0);
28552851
28562852 return image;
28572853 }