Re: [osg-users] OSGQSG: Error

2008-12-04 Thread Fred
page 63, fig 2-9 The State example scene graph displayed in osgviewer TBD move TBD move? ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

[osg-users] OSGQSG: Error

2008-12-03 Thread Fred
http://www.skew-matrix.com/OSGQSG/ p37, Memeory Management Examples. Misspelled Memory in the errata. - p37, Memory Management Examples. There are multiple solutions to the dilemma of how to return a Referenced object address. The method employed in this book's example code is

Re: [osg-users] OSGQSG: Error

2008-12-03 Thread Paul Martz
Misspelled Memory in the errata. Fixed, thanks. Why is it return grp.get(); rather than return grp; Isn't grp.get() a pointer to an osg::Group? osg::ref_ptr has a constructor that takes an address. -Paul ___ osg-users mailing list

Re: [osg-users] OSGQSG: Error

2008-12-03 Thread Fred
So when I see things like the following in the OSG code base is it wrong? ApplicationUsage* ApplicationUsage::instance() { static osg::ref_ptrApplicationUsage s_applicationUsage = new ApplicationUsage; return s_applicationUsage.get(); } To me this looks like your first example. // DON'T

Re: [osg-users] OSGQSG: Error

2008-12-03 Thread Robert Osfield
Hi Fred, Returning a C pointer is more flexible, and as long as ref counting is managed cleanly everything works fine, so the ApplicationUsage::instance() code you suggest is perfectly fine, and avoids thrashing the reference count something that is helps on the performance front. One little

Re: [osg-users] OSGQSG: Error

2008-12-03 Thread Paul Martz
So when I see things like the following in the OSG code base is it wrong? ApplicationUsage* ApplicationUsage::instance() { static osg::ref_ptrApplicationUsage s_applicationUsage = new ApplicationUsage; return s_applicationUsage.get(); } In the code above, s_applicationUsage is

Re: [osg-users] OSGQSG: Error

2008-12-03 Thread Fred
Ah yes, static makes a world of difference. page 47 osg::ref_ptrosg::Geode geode0 = new osg::Geode; group-addChild( Geode0.get() ); osg::ref_ptrosg::Geode geode1 = new osg::Geode; group-addChild( Geode1.get() ); Upper case problem with Geode0 and Geode1. They should be geode0 and

Re: [osg-users] OSGQSG: Error

2008-12-03 Thread Paul Martz
reprinting. -Paul -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Fred Sent: Wednesday, December 03, 2008 2:17 PM To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] OSGQSG: Error Ah yes, static makes a world of difference