Re: Change scene

New Message Reply Date view Thread view Subject view Author view

Mario Veraart (rioj7++at++fel.tno.nl)
Mon, 31 Aug 1998 14:43:26 +0200 (MET DST)


Scott Herod wrote:
>
> Mario Veraart wrote:
>
> > > Is there a simple methord to free
> > > all
> > > the resources taken by a scene node?
> >
> > Just call pfDelete() on the node that you want to delete and
> > everything below it is deleted as well. Be aware that it will take a
> > few frames until the resources are really free, this is because the
> > cull and draw might be needing this stuff.
>
> Is that really true? I don't think that removing a DCS for
> example correctly deletes things like GeoStates attached to a
> GeoSet under the DCS. As an example, attach something like the
> following to the bottom of the simple.C code. I can send you
> the entire source if necessary.
>
> Scott Herod
> herod++at++evt.com
> sherod++at++colorado.edu
>
> // ========== Delete Test ==================
>
> printf("GeoState ref count = %d.\n", geostate->getRef());
> printf("Delete DCS attempt = %d.\n", pfDelete(dcs));
>
> scene->removeChild(dcs);
>
> printf("Delete DCS attempt = %d.\n", pfDelete(dcs));
> printf("GeoState ref count = %d.\n", geostate->getRef());
>
> printf("Delete GeoState attempt = %d.\n", pfDelete(geostate));
>
> // ========== Delete Test ==================
>
> pfExit();
> return 0;
>
I think the reason why it is not deleted is that performer pospones
the deletion a few frames to be sure that nobody accesses this node.
Try this inside the mainloop or add a few pfFrame() calls after
the pfDelete (haven't tried it myself).

Mario


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 31 1998 - 05:44:57 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.