From b805cc89c91b5078e08c20987e0665506a5d42c9 Mon Sep 17 00:00:00 2001 From: f4exb Date: Fri, 3 Mar 2017 19:37:59 +0100 Subject: [PATCH] ATV Demod: replaced GL_POLYGON by GL_TRIANGLES as GL_POLYGON is deprecated and compilation fails in some environments --- plugins/channelrx/demodatv/glshaderarray.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/plugins/channelrx/demodatv/glshaderarray.cpp b/plugins/channelrx/demodatv/glshaderarray.cpp index 60f8f5d7f..58802c781 100644 --- a/plugins/channelrx/demodatv/glshaderarray.cpp +++ b/plugins/channelrx/demodatv/glshaderarray.cpp @@ -149,15 +149,21 @@ void GLShaderArray::RenderPixels(unsigned char *chrData) QOpenGLFunctions *ptrF; int intI; int intJ; - int intNbVertices = 4; + int intNbVertices = 6; QMatrix4x4 objQMatrix; GLfloat arrVertices[] = - { -1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f, 1.0f, -1.0f }; + // 2 3 + // 1 4 + //1 2 3 3 4 1 + { -1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, -1.0f, -1.0f, -1.0f }; GLfloat arrTextureCoords[] = - { 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f }; + // 1 4 + // 2 3 + //1 2 3 3 4 1 + { 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f }; QRgb *ptrLine; int intVal; @@ -209,7 +215,7 @@ void GLShaderArray::RenderPixels(unsigned char *chrData) ptrF->glEnableVertexAttribArray(1); // texture coordinates ptrF->glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 0, arrTextureCoords); - ptrF->glDrawArrays(GL_POLYGON, 0, intNbVertices); + ptrF->glDrawArrays(GL_TRIANGLES, 0, intNbVertices); //cleanup ptrF->glDisableVertexAttribArray(0);