ATV Demod: replaced GL_POLYGON by GL_TRIANGLES as GL_POLYGON is deprecated and compilation fails in some environments

pull/27/head v3.2.0
f4exb 2017-03-03 19:37:59 +01:00
rodzic d5f02aee06
commit b805cc89c9
1 zmienionych plików z 10 dodań i 4 usunięć

Wyświetl plik

@ -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);