Création d'un compte pour un collaborateur extérieur au laboratoire depuis l'intranet ICube : https://intranet.icube.unistra.fr/fr/labs/member/profile

Commit 25fa9adc authored by Frédéric Larue's avatar Frédéric Larue
Browse files

QOpenGLShaderProgram replaced by GPU::Shader in SelectionToolLasso.

parent 4951e563
......@@ -61,13 +61,12 @@ void SelectionToolLasso::updateSelectionMask()
// Create the shader enabling the visualization of the selection mask.
if( !m_SelectionMaskVizShader.isLinked() )
if( !m_SelectionMaskVizShader.IsCreated() )
{
if( !m_SelectionMaskVizShader.addShaderFromSourceCode( QOpenGLShader::Vertex , s_SelectionMaskVizVPG ) ||
!m_SelectionMaskVizShader.addShaderFromSourceCode( QOpenGLShader::Fragment, s_SelectionMaskVizFPG ) ||
!m_SelectionMaskVizShader.link() )
std::string logs;
if( !GPU::CreateShaderFromSources( m_SelectionMaskVizShader, s_SelectionMaskVizVPG, s_SelectionMaskVizFPG, &logs ) )
{
std::cout << m_SelectionMaskVizShader.log().toStdString() << std::endl;
std::cout << logs << std::endl;
return;
}
}
......@@ -194,8 +193,8 @@ void SelectionToolLasso::display()
if( m_SelectionMask.IsInstantiated() )
{
m_SelectionMask.Bind( 0 );
m_SelectionMaskVizShader.bind();
m_SelectionMaskVizShader.setUniformValue( "u_SelectionMask", 0 );
m_SelectionMaskVizShader.Bind();
m_SelectionMaskVizShader.SetSampler( "u_SelectionMask", 0 );
glBegin( GL_QUADS );
glVertex2i( -1, -1 );
......@@ -204,7 +203,7 @@ void SelectionToolLasso::display()
glVertex2i( -1, 1 );
glEnd();
m_SelectionMaskVizShader.release();
m_SelectionMaskVizShader.Unbind();
m_SelectionMask.Unbind();
}
......
......@@ -33,7 +33,7 @@ class SelectionToolLasso : public SelectionTool
SelectionState m_State;
int m_SelectedPolygonPointId;
QOpenGLShaderProgram m_SelectionMaskVizShader;
GPU::Shader m_SelectionMaskVizShader;
QVector<QVector2D> m_PolygonPoints;
GPU::Texture2D m_SelectionMask;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment