Code: Select all
if( _image )
{
_image->remove();
} else
{
dimension2du center = _guienvironment->getVideoDriver()->getScreenSize() / 2;
_image= _guienvironment->addImage( recti( center.Width - 100, center.Height - 200, center.Width + 100, center.Height + 200 ), 0, -1, 0, false );
}
Using the snippet I have two problems:
1. With scenenodes and sorts I'd like to use {... if( sn->drop() ) sn = 0; ...}, nulling the member. How should I do this with gui elements?
2. When the image is create in the else block, the reference is 1. But before remove() it is 4 although nowhere inmy code _image is grabbed. So what going on here?
Thanks,