Hi Otto
We don't have enough information to solve you problem. Have you try to debug you application ? Have you an available callstack to found where you application crash ? Have you a simple program test which isolate the problem ? but more simply, is your datasetList array store texture pointer in osg::ref_ptr ? Nobody can help you with this too little description. This probably a misusing of osg code more than a bug in OSG. HTH David Callu 2009/10/27 Otto Cologne <schur...@gmx.de> > Hi, > > I'm having a crash with setTextureAttributeAndModes I don't know how to > fix. > > To explain the issue. I have a list of data sets which hold a pointer to a > osg::Texture3D. The texture mixing is done in a shader and my texture update > function containing the following loop is called from an update callback. > Since the order of the textures can/must change i loop over the textures and > do this > > > Code: > > osg::StateSet* sliceState = m_sliceNode->getOrCreateStateSet(); > for ( size_t i = 0; i < datasetList.size(); ++i) > { > osg::Texture3D* texture3D = datasetList[i] )->getTexture3D(); > sliceState->setTextureAttributeAndModes( i, texture3D, > osg::StateAttribute::ON ); > } > > > > > This works just find when adding one texture after another. However when > the order changes, thus overwriting a different order it crashes. So > apparently I'm doing it wrong. > > Any help would be greatly appreciated. > ... > > Thank you! > > Cheers, > Otto > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=18753#18753 > > > > > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org