[osg-users] Questions about Geometry implementation details

Christian Muschick christian.muschick at gmail.com
Thu Oct 18 08:21:28 PDT 2007


Hello!

My last request concerning this question didn't get any reply, so let me
try this reformulated version:

In Geometry.cpp, there are several lines of code that don't make sense
to me. More precisely, the conditions in a few if-statements seem to be
incorrect.
As an example, in Geometry::getOrCreateVertexBuffer, it says
{
     ArrayList arrayList;
     getArrayList(arrayList);

     osg::VertexBufferObject* vbo = 0;

     ArrayList::iterator vitr;
     for(vitr = arrayList.begin();
         vitr != arrayList.end() && !vbo;
         ++vitr)
     {
         osg::Array* array = *vitr;
         if (!array->getVertexBufferObject()) vbo =
array->getVertexBufferObject(); ///< This will only set vbo to NULL!?
     }

     if (!vbo) vbo = new osg::VertexBufferObject;
}

In the loop, vbo will never get a value different from the null-pointer.
Is this on purpose? Did I miss something entirely?


Variations of this issue can be seen at lines 1123, 1170 and 1178.
Please have a look at this and correct me if I'm wrong.

regards
cm





More information about the osg-users mailing list