Maxime BOUCHER wrote:
Thanks for replying!


Paul Melis wrote:
What kind of PrimitiveSet do you want to erase elements from? E.g. all DrawElementsXXX classes derive from std::vector, so you should be able to use the methods from vector on those.


OK, it's interesting.
I mainly work on DrawArrayLength. What can I do with it?
From <include/osg/PrimitiveSet>:

class OSG_EXPORT DrawArrayLengths : public PrimitiveSet, public VectorGLsizei
{
   public:
[...]

where VectorGLsizei is (basically) std::vector<GLsizei>. So you can just do

osg::DrawArrayLengths *arr = new osg::DrawArrayLengths();
arr->push_back(5);
arr->erase(arr->begin()+10, arr->begin()+20);


 wrote:
What exactly do you mean "attacking", are you trying to remove primitive from primitive sets. 
Indices are deprecated and they are not encouraged to be used anymore. The "dirty" way is the 
"classical" way.


Yes, I want to remove primitives removing their indices.
Can I ask you since which version indices are deprecated?
Have you an example of the dirty way? I don't get what you mean.
With "indices" do you mean OpenGL indices here (as in drawing primitives by index), or do you mean indices in the DrawArrayLengths array? Rabbi means the former is generally not recommended for performance reasons. The latter is something completely different and is no problem.

Paul
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to