1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-09-28 15:56:33 -04:00

OpenGL modernization: waterfall texture update optimization

This commit is contained in:
f4exb 2016-03-05 12:12:55 +01:00
parent c5a45e57ee
commit fa23c4536f

View File

@ -603,10 +603,18 @@ void GLSpectrum::paintGL()
};
for (int i = 0; i < m_waterfallBufferPos; i++)
if (m_waterfallTexturePos + m_waterfallBufferPos < m_waterfallTextureHeight)
{
m_glShaderWaterfall.subTexture(0, m_waterfallTexturePos, m_fftSize, 1, m_waterfallBuffer->scanLine(i));
m_waterfallTexturePos = (m_waterfallTexturePos + 1) % m_waterfallTextureHeight;
m_glShaderWaterfall.subTexture(0, m_waterfallTexturePos, m_fftSize, m_waterfallBufferPos, m_waterfallBuffer->scanLine(0));
m_waterfallTexturePos += m_waterfallBufferPos;
}
else
{
int breakLine = m_waterfallTextureHeight - m_waterfallTexturePos;
int linesLeft = m_waterfallTexturePos + m_waterfallBufferPos - m_waterfallTextureHeight;
m_glShaderWaterfall.subTexture(0, m_waterfallTexturePos, m_fftSize, breakLine, m_waterfallBuffer->scanLine(0));
m_glShaderWaterfall.subTexture(0, 0, m_fftSize, linesLeft, m_waterfallBuffer->scanLine(breakLine));
m_waterfallTexturePos = linesLeft;
}
m_waterfallBufferPos = 0;