On 6/30/06, Manoj Radhakrishnan <[EMAIL PROTECTED]> wrote:
Dear All,Sorry for disturbing you more. I am a newcomer in graphics programming. May I ask one clarification.... There are 14 primitives(Cuboid, Torus, Cylinder etc...) supported in my application. For this I use derived class of osg::Geode for each primitives. There is a UpdateGeometry() function in each class. This function is called each time when any change in shape. Please see some code in this function.... The tesselation code will change according to the changes needed and kept the vertices and normals as member variable of this class // Remove all the drawables in the geode while(getNumDrawables()) removeDrawable(0, 1); osg::Geometry* meshGeometry = new osg::Geometry; ... .... // Add the geometry to the geode addDrawable(meshGeometry); Now adding vertex array, normal array, primitiveset, color array, color indices and stateset after dynamically creating the respective classes. How to deallocate the above objects ?. I think delete operator not working with these objects. Is this is a correct way ? I think this will result in memory leaks. Thanks in advance,
Use OSG's ref_ptr, for more informations, look at : http://dburns.dhs.org/OSG/Articles/RefPointers/RefPointers.html -- Serge Lages http://www.magrathea-engine.org _______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
