Commit 249d9999 authored by Sylvain's avatar Sylvain
Browse files

minor optim String3D::drawAll

parent 7d229848
...@@ -256,14 +256,18 @@ void Strings3D::draw(unsigned int idSt, const Geom::Vec3f& pos) ...@@ -256,14 +256,18 @@ void Strings3D::draw(unsigned int idSt, const Geom::Vec3f& pos)
void Strings3D::drawAll(const Geom::Vec3f& color) void Strings3D::drawAll(const Geom::Vec3f& color)
{ {
unsigned int nb = m_strpos.size();
// nothing to do if no string !
if (nb == 0)
return;
predraw(color); predraw(color);
if (m_strpos.size() != m_strTranslate.size()) if (m_strpos.size() != m_strTranslate.size())
{ {
CGoGNerr << "Strings3D: for drawAll use exclusively addString with position"<< CGoGNendl; CGoGNerr << "Strings3D: for drawAll use exclusively addString with position"<< CGoGNendl;
return; return;
} }
unsigned int nb = m_strpos.size();
for (unsigned int idSt=0; idSt<nb; ++idSt) for (unsigned int idSt=0; idSt<nb; ++idSt)
{ {
glUniform3fv(*m_uniform_position, 1, m_strTranslate[idSt].data()); glUniform3fv(*m_uniform_position, 1, m_strTranslate[idSt].data());
......
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