Hello Antonio,

Antonio Bleile wrote:
> how about this code here:
> 
> ImagePtr img1 = Image::create();
> 
> beginEditCP(img1);
>   img1->set(Image::OSG_RGBA_PF, 512, 512);
> endEditCP(img1);
> 
> beginEditCP(m_pCopyTexture2);
>   m_pCopyTexture2->setMinFilter(GL_LINEAR);
>   m_pCopyTexture2->setMagFilter(GL_LINEAR);
>   m_pCopyTexture2->setTarget(GL_TEXTURE_2D);
>   m_pCopyTexture2->setInternalFormat(GL_RGBA8);
>   m_pCopyTexture2->setImage(img1);
> endEditCP(m_pCopyTexture2);
> 
> When am I supposed to delete img1? Is the destructor
> of the texture taking care?

yes, as far as I can see it does (the onDestroy method calls subRefCP on 
_sfImage.getValue() ). Does it not work for you ?

> If I use subRefCP of the
> image immediately, the system crashes. If I apply the
> OpenGL metaphor on this sample, I would expect that
> I can delete the image. But obviously the image is
> uploaded to texture memory later....

yes, at this point here there is no OpenGL context active (or more 
precisely OpenSG does not expect one to be active).

        Hope it helps,
                Carsten

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to