[osg-users] Ref_ptr question : argument and return

Vincent Bourdier vincent.bourdier at gmail.com
Mon Sep 22 08:23:22 PDT 2008


Hi all,

I read that all the objects that inherit from Referenced need to be in a
ref_ptr.
Ok that sounds good , but :

In this case I don't know if I need to put the ref_prt in argument or if
only the ptr is needed.

bool VisualEffects::setTransparency(string name, float alpha){
    osg::ref_ptr<osg::Node> node = getNode(name);
    return VisualEffects::setTransparency(node.get(), alpha); //node ? or
node.get() ?
}

If call the second function without ref_prt,
I just need to understand if it can make an error, and if it depends on the
code on setTransparency(node, alpha), based on a ref_prt or not... (imagine
I don't know)

thanks a lot,

Regards,

Vincent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080922/06123618/attachment-0002.htm>


More information about the osg-users mailing list