Commit 669a5001 authored by Thibault Soucarre's avatar Thibault Soucarre

Correct a bug. Counters were not correctly affected by changes to modelview matrix

parent 3aebaa02
......@@ -222,6 +222,7 @@ void Render_alternate::paintGL(){
//_modelview = tmp;
}
glUseProgram(_shader.getProgramID());
glUniformMatrix4fv(glGetUniformLocation(_shader.getProgramID(), "MVP"), 1, GL_FALSE, glm::value_ptr(mvp));
/*drawing counters*/
_counters.lock();
glDrawArrays(GL_LINES, 0, _counters.getNbVertex());
......@@ -237,7 +238,6 @@ void Render_alternate::paintGL(){
tmp2 = _modelview;
_arrows.lock();
for(int i=0; i<n ; i++){
//_arrows.lock();
//change matrix to draw the current arrow
_modelview = glm::translate(_modelview, glm::vec3(_links[4*i+2], _links[4*i+3], 0));
_modelview = glm::rotate(_modelview, (float) _links[4*i], glm::vec3(0,0,1));
......
......@@ -176,8 +176,11 @@ bool Shader::charger()
// Sinon c'est que tout s'est bien passé
else
else{
m_vertex_code.clear();
m_fragment_code.clear();
return true;
}
}
......
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