Hi,

On Fri, 2009-03-13 at 08:38 -0500, Allen Bierbaum wrote:
> On Fri, Mar 13, 2009 at 2:50 AM, Gerrit Voß <[email protected]> wrote:
> > Hi,
> >
> > On Thu, 2009-03-12 at 15:03 -0500, Patrick Hartling wrote:
> >> Allen Bierbaum wrote:
> >> > What is PrimeMaterial?
> >> >
> >> > I have some old code that is not compiling now because I try to do:
> >> >
> >> > OSG::ChuckMaterialMTRecPtr material = OSG::getDefaultMaterial();
> >> >
> >> > Evidently getDefaultMaterial now returns a PrimeMaterial*
> >
> > Yes but before it returned a Material *, so that piece of code
> > should have never compiled it either form, there is a cast missing.
> 
> How would you write the code above so it is safe with the new pointer types?
> 
> In other words, can I initialize a ChunkMaterialMTRecPtr from a
> ChunkMaterial* safely like this or is there a special function call to
> get the RecPtr and variants from a raw pointer?

no the conversions are completely transparent. 

> OSG::ChuckMaterialMTRecPtr material =
> dynamic_cast<OSG::ChunkMaterial*>(OSG::getDefaultMaterial());

yes that should work.

kind regards,
  gerrit



------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to