Create sprite from RenderTexture (without sharing)

Hello!

I render into a RenderTexture and later I grab the texture from the RenderTexture to create a Sprite:

Texture2D* tex = myRenderTexture->getSprite()->getTexture();
Sprite* sprite = Sprite::createWithTexture(tex);
mScene->addChild(sprite, 7);

Whenever I draw again into the RenderTexture, my sprite is also affected! It seems like the Sprite stores the Texture Pointer that points to the texture of the RenderTexture. How can I create a Sprite that uses a clone of the RenderTexture’s texture and thus does NOT get affected when I render into the RenderTexture again?

In other words I want this:

  1. Render into RenderTexture
  2. Fetch texture from RenderTexture and create Sprite A from it
  3. Show Sprite A in scene
  4. Render again into RenderTexture wihout (!) modifying what Sprite A is showing
  5. Again grab texture from RenderTexture and update the texture of A (from now on Sprite shows updated texture)
    and so on…

Thanks!

Can you do this:

Sprite* sprite = myRenderTexture->getSprite();