Hi Noah,
I presume you have a global C pointer to texture1, and this pointer is
left dangling when the Texture object it once pointed too gets deleted
automatically be the OSG's ref counting when the texture2 is assigned.
The solution is to use a ref_ptr<osg::Texture> instead of a C*.
Robert.
On 4/6/07, Noah Brickman <[EMAIL PROTECTED]> wrote:
In my code I'm creating some geometry and assigning a texture with...
txState->setTextureAttributeAndModes(0, texture1, ON);
geode->setStateSet( txState1 );
I create a hotkey which changes the texure with...
txState->setTextureAttributeAndModes(0, texture2, ON);
This works fine but when I try to toggle back to the original texture with
txState->setTextureAttributeAndModes(0, texture1, ON);
The program crashes. I've tried to implement this a couple different ways
(assigning a new state object, etc. but I always get a crash when I switch
back to the first texture. What is the proper way to do this?
Thanks.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/