1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-09-01 04:37:52 -04:00

OpenGL modernization: draw waterfall frame box teh new way

This commit is contained in:
f4exb 2016-03-03 22:57:34 +01:00
parent ee6223618a
commit a33eb6555f

View File

@ -675,22 +675,25 @@ void GLSpectrum::paintGL()
glPopMatrix(); glPopMatrix();
// draw rect around
#ifdef GL_DEPRECATED
glPushMatrix(); glPushMatrix();
glTranslatef(m_glWaterfallRect.x(), m_glWaterfallRect.y(), 0); glTranslatef(m_glWaterfallRect.x(), m_glWaterfallRect.y(), 0);
glScalef(m_glWaterfallRect.width(), m_glWaterfallRect.height(), 1); glScalef(m_glWaterfallRect.width(), m_glWaterfallRect.height(), 1);
// draw rect around
glEnable(GL_BLEND); glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glLineWidth(1.0f); glLineWidth(1.0f);
glColor4f(1, 1, 1, 0.5); glColor4f(1, 1, 1, 0.5);
#ifdef GL_DEPRECATED
glBegin(GL_LINE_LOOP); glBegin(GL_LINE_LOOP);
glVertex2f(1, 1); glVertex2f(1, 1);
glVertex2f(0, 1); glVertex2f(0, 1);
glVertex2f(0, 0); glVertex2f(0, 0);
glVertex2f(1, 0); glVertex2f(1, 0);
glEnd(); glEnd();
glDisable(GL_BLEND);
glPopMatrix();
#else #else
{ {
GLfloat q3[] { GLfloat q3[] {
@ -700,22 +703,11 @@ void GLSpectrum::paintGL()
1, 0 1, 0
}; };
#ifdef GL_ANDROID QVector4D color(1.0f, 1.0f, 1.0f, 0.5f);
glEnableVertexAttribArray(GL_VERTEX_ARRAY); m_glShaderSimple.drawContour(m_glWaterfallBoxMatrix, color, q3, 4);
glVertexAttribPointer(GL_VERTEX_ARRAY, 2, GL_FLOAT, GL_FALSE, 0, q3);
glDrawArrays(GL_LINE_LOOP, 0, 4);
glDisableVertexAttribArray(GL_VERTEX_ARRAY);
#else
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(2, GL_FLOAT, 0, q3);
glDrawArrays(GL_LINE_LOOP, 0, 4);
glDisableClientState(GL_VERTEX_ARRAY);
#endif
} }
#endif #endif
glDisable(GL_BLEND);
glPopMatrix();
} }
// paint histogram // paint histogram