Commit f08ed21b authored by Sylvain Thery's avatar Sylvain Thery

one drawer sublist function added

parent 461e5daf
...@@ -142,6 +142,12 @@ public: ...@@ -142,6 +142,12 @@ public:
*/ */
void callSubLists(std::vector<int> indices, float opacity); void callSubLists(std::vector<int> indices, float opacity);
/**
* call a set of sub-lists
*/
void callSubLists(int first, int nb, float opacity);
/** /**
* use as glLineWidth * use as glLineWidth
*/ */
......
...@@ -208,6 +208,27 @@ void Drawer::callSubList(int index, float opacity) ...@@ -208,6 +208,27 @@ void Drawer::callSubList(int index, float opacity)
m_shader->disableVertexAttribs(); m_shader->disableVertexAttribs();
} }
void Drawer::callSubLists(int first, int nb, float opacity)
{
m_shader->setOpacity(opacity);
m_shader->enableVertexAttribs();
int last = first+nb;
for (int i = first; i< last; ++i)
if (i < int(m_begins.size()))
{
PrimParam* pp = & (m_begins[i]);
if (pp->mode == GL_POINTS)
glPointSize(pp->width);
if ((pp->mode == GL_LINES) || (pp->mode == GL_LINE_LOOP))
glLineWidth(pp->width);
glDrawArrays(pp->mode, pp->begin, pp->nb);
}
m_shader->disableVertexAttribs();
}
void Drawer::callSubLists(std::vector<int> indices, float opacity) void Drawer::callSubLists(std::vector<int> indices, float opacity)
{ {
m_shader->setOpacity(opacity); m_shader->setOpacity(opacity);
......
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