While this did not directly solve the problem, it pointed me to it. By
calling state.disableAllVertexArrays() before doing the state.set*
calls, it now works. I am going through to find out if there is one
specific array that was causing the issue and also to see if I can
recreate the same thing using raw gl calls as well. I will post what I
find so if anyone else ever has this problem the answer will be
available. Thanks Robert!

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Robert
Osfield
Sent: Thursday, September 13, 2012 9:18 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Using glDrawElements causes crash with
osg::Stats

Hi Karl,

On 13 September 2012 12:30, Cary, Karl A. <[email protected]> wrote:
> It is crashing in the glDrawElements call, which I can't step in to. 
> All the data passed in looks valid in the debugger.

This suggest to me that one of the vertex attribute arrays has been left
enabled and the OpenGL driver is attempting to read from it past the end
of the data that had previous set up for that array.  For instance,
perhaps the colour array is left on.  Have a look at the
osg::Geometry::drawImplementation(osg::RenderInfo&) method, it has a
code block where it does:

    state.lazyDisablingOfVertexAttributes();

    // then does all the state.setVertexPointer(..) that are required

    state.applyDisablingOfVertexAttributes();

    // dispatch primitive data

Perhaps something like this would work for your app.

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

Reply via email to