Hi You need single vbo for each array you want to use, or merge all data to single array and specify offsets into array when feeding data to gl
23.07.2012, 20:06, "Jean Delaballe" <[email protected]>: > Hi, > > I am a 3D developer with quiete knowledges. I am use to use OpenGL. For some > task I have to use OpenSceneGraph and use VBO inside it. > I know I can use osg::Geometry but for some reasons (not to be developped > here) I can't. So I need to use VBO directly in my code. > > I succeeded (it seems) to make VBO run with a single array (which is an osg > array). But anytimes I tried to make it handle a second array, the program > crash. Here are some code I can do: > > Code: > > osg::State* state = renderInfo.getState(); > osg::Drawable::Extensions* extensions = osg::Drawable::getExtensions > (renderInfo.getContextID(), true); > state->disableAllVertexArrays(); > > // bind vbo > _vbo->bindBuffer (renderInfo.getContextID()); > > // allocate memory > _vertexArray->setVertexBufferObject (_vbo); > _attribArray->setVertexBufferObject (_vbo); > > // set the pointers > state->setVertexPointer(_vertexArray.get()); > state->setVertexAttribPointer (6, _attribArray.get(), false); > > // draw > glDrawArrays (_GLmode, 0, _vertexArray->size()); > > _vbo->unbindBuffer(renderInfo.getContextID()); > > Each time I don't use the _attribArray, the program runs and display things > correctly. It is the same if I don't ask _attribArray to use the VBO. But > each time I ask it to use the VBO the program crashes. > > I also tried to tell the buffer size, to explicitly give the buffer data > (threw extensions->glBufferData and such), but without any success. > > Do you know how I could resolve this ? > > Thank you! > > Cheers, > Silence > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=48994#48994 > > _______________________________________________ > 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

