1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 17:58:43 -05:00

ATV demod: ATV screen: reviewed screen shader intialization sequences

This commit is contained in:
f4exb 2017-02-25 06:56:09 +01:00
parent 1d0cf9582d
commit 6636fc75fa

View File

@ -39,9 +39,9 @@ ATVScreen::ATVScreen(QWidget* parent) :
m_blnDataChanged = false; m_blnDataChanged = false;
m_blnGLContextInitialized = false; m_blnGLContextInitialized = false;
m_intAskedCols = 0; //Par défaut
m_intAskedRows = 0; m_intAskedCols = ATV_COLS;
m_intAskedRows = ATV_ROWS;
} }
ATVScreen::~ATVScreen() ATVScreen::~ATVScreen()
@ -129,10 +129,6 @@ void ATVScreen::initializeGL()
connect(objGlCurrentContext, &QOpenGLContext::aboutToBeDestroyed, this, connect(objGlCurrentContext, &QOpenGLContext::aboutToBeDestroyed, this,
&ATVScreen::cleanup); // TODO: when migrating to QOpenGLWidget &ATVScreen::cleanup); // TODO: when migrating to QOpenGLWidget
//Par défaut
m_intAskedCols = ATV_COLS;
m_intAskedRows = ATV_ROWS;
m_blnGLContextInitialized = true; m_blnGLContextInitialized = true;
m_objMutex.unlock(); m_objMutex.unlock();
@ -147,12 +143,11 @@ void ATVScreen::resizeGL(int intWidth, int intHeight)
void ATVScreen::paintGL() void ATVScreen::paintGL()
{ {
m_objMutex.lock(); if (!m_objMutex.tryLock(2))
return;
m_blnDataChanged = false; m_blnDataChanged = false;
if (m_blnGLContextInitialized)
{
if ((m_intAskedCols != 0) && (m_intAskedRows != 0)) if ((m_intAskedCols != 0) && (m_intAskedRows != 0))
{ {
m_objGLShaderArray.InitializeGL(m_intAskedCols, m_intAskedRows); m_objGLShaderArray.InitializeGL(m_intAskedCols, m_intAskedRows);
@ -161,7 +156,6 @@ void ATVScreen::paintGL()
} }
m_objGLShaderArray.RenderPixels(m_chrLastData); m_objGLShaderArray.RenderPixels(m_chrLastData);
}
m_objMutex.unlock(); m_objMutex.unlock();
} }