mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-07 16:34:45 -04:00
Reorder glPushMatrix and glBindTexture to ease future migration to Open GL ES 2.0
This commit is contained in:
+10
-10
@@ -689,16 +689,15 @@ void GLSpectrum::paintGL()
|
||||
|
||||
// paint left scales (time and power)
|
||||
if(m_displayWaterfall || m_displayMaxHold || m_displayCurrent || m_displayHistogram ) {
|
||||
glPushMatrix();
|
||||
glTranslatef(m_glLeftScaleRect.x(), m_glLeftScaleRect.y(), 0);
|
||||
glScalef(m_glLeftScaleRect.width(), m_glLeftScaleRect.height(), 1);
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, m_leftMarginTexture);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(m_glLeftScaleRect.x(), m_glLeftScaleRect.y(), 0);
|
||||
glScalef(m_glLeftScaleRect.width(), m_glLeftScaleRect.height(), 1);
|
||||
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glBegin(GL_QUADS);
|
||||
glTexCoord2f(0, 1);
|
||||
@@ -711,11 +710,16 @@ void GLSpectrum::paintGL()
|
||||
glVertex2f(0, 0);
|
||||
glEnd();
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
// paint frequency scale
|
||||
if(m_displayWaterfall || m_displayMaxHold || m_displayCurrent || m_displayHistogram ) {
|
||||
glPushMatrix();
|
||||
glTranslatef(m_glFrequencyScaleRect.x(), m_glFrequencyScaleRect.y(), 0);
|
||||
glScalef(m_glFrequencyScaleRect.width(), m_glFrequencyScaleRect.height(), 1);
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, m_frequencyTexture);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
@@ -723,11 +727,6 @@ void GLSpectrum::paintGL()
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(m_glFrequencyScaleRect.x(), m_glFrequencyScaleRect.y(), 0);
|
||||
glScalef(m_glFrequencyScaleRect.width(), m_glFrequencyScaleRect.height(), 1);
|
||||
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glBegin(GL_QUADS);
|
||||
glTexCoord2f(0, 1);
|
||||
@@ -740,6 +739,7 @@ void GLSpectrum::paintGL()
|
||||
glVertex2f(0, 0);
|
||||
glEnd();
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
|
||||
glPopMatrix();
|
||||
|
||||
// paint channels
|
||||
|
||||
Reference in New Issue
Block a user