Hi Ralf,
Thanks for the clarification, I'm afraid my trip meant not following
threads too closely.
I've reviewed the code and the if (!array->getVertex..()) line is
wrong, and Ulrich pointed to the correct implementation.
I've fixed the relevant code and checked it into SVN.
Robert.
On 10/19/07, Ralph Kern <[EMAIL PROTECTED]> wrote:
> Robert Osfield schrieb:
> > On 10/19/07, Ulrich Hertlein <[EMAIL PROTECTED]> wrote:
> >> Hello Christian,
> >>
> >> Quoting Christian Muschick <[EMAIL PROTECTED]>:
> >>> My last request concerning this question didn't get any reply, so let me
> >>> try this reformulated version:
> >>> ...
> >>> 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?
> >> This certainly looks like a type to me too (copy-and-paste anti-pattern).
> >> I assume it should read 'if(array->getVertexBufferObject())...' so that if
> >> the
> >> array has a VBO associated it's used.
> >>
> >> But I guess in the end Robert has to check that.
> >
> > I'm rather lost on this topic as I've just spotted this single email
> > on its own, which bit of OSG code are we talking about?
> >
> > Robert.
>
> from the original post:
>
> 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;
> }
>
> regards Ralph
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org