From 038b62528c49d6176274acbe77500f66422990ed Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Wed, 6 Jan 2016 11:41:13 +0100 Subject: Revert "VoronoiSplat: upated to use Qt's FBO wrapper." This reverts commit 87292bf4cc56194aa6122456d7417fa5f9bd1a09. --- voronoisplat.cpp | 9 +++++++-- voronoisplat.h | 3 +-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/voronoisplat.cpp b/voronoisplat.cpp index 9c95950..7695d97 100644 --- a/voronoisplat.cpp +++ b/voronoisplat.cpp @@ -2,6 +2,9 @@ #include +#include +#include + #include "scale.h" #include "skelft.h" @@ -21,13 +24,13 @@ static int nextPow2(int n) VoronoiSplatTexture::VoronoiSplatTexture(const QSize &size) : gl(QOpenGLContext::currentContext()) - , m_FBO(size) , m_cmap(3*COLORMAP_SAMPLES) { int baseSize = nextPow2(std::min(size.width(), size.height())); m_size.setWidth(baseSize); m_size.setHeight(baseSize); + gl.glGenFramebuffers(1, &m_FBO); setupShaders(); setupVAOs(); setupTextures(); @@ -202,6 +205,8 @@ VoronoiSplatTexture::~VoronoiSplatTexture() gl.glDeleteTextures(1, &m_colormapTex); gl.glDeleteTextures(1, &m_tex); + gl.glDeleteFramebuffers(1, &m_FBO); + delete m_program1; delete m_program2; } @@ -229,7 +234,7 @@ bool VoronoiSplatTexture::updateTexture() updateColormap(); } - m_FBO.bind(); + gl.glBindFramebuffer(GL_FRAMEBUFFER, m_FBO); // The first pass m_program1->bind(); diff --git a/voronoisplat.h b/voronoisplat.h index 29c7f47..78dfd3e 100644 --- a/voronoisplat.h +++ b/voronoisplat.h @@ -3,7 +3,6 @@ #include #include -#include #include #include #include @@ -49,7 +48,7 @@ private: QOpenGLFunctions gl; QOpenGLShaderProgram *m_program1, *m_program2; - QOpenGLFramebufferObject m_FBO; + GLuint m_FBO; GLuint m_VBOs[3]; GLuint m_textures[2], m_colormapTex, m_tex; QOpenGLVertexArrayObject m_sitesVAO, m_2ndPassVAO; -- cgit v1.2.3