Two or more RenderTexture + DrawNode

Two or more RenderTexture + DrawNode


Hello guys.

I’m having a problem creating 2 RenderTexture and using a DrawNode to draw it as if it were an eraser.

I’ll try to explain better: In the bottom of the app has a red rectangle and another green, when I touch the screen, a circle should be drawn as if it were the representation of my finger.

I use different variables, with different values, but only 1 works, if I comment the first one, the second one starts to work.

I’m attaching the complete example with no dependencies, just copy and put in any project to test.

Could you help me?

Scene_Test.cpp (4.6 KB)
Scene_Test.h (1.1 KB)

Example of my screen:


So you want your finger to act as an eraser on both the red and green sections?


Yes, but it’s only working in red, but if I comment on these lines:

void Scene_Test::update(float delta)
    //if (_queue_to_process1.size() > 0)
    //    EraseWithBlend(_render_1, _queue_to_process1);
    if (_queue_to_process2.size() > 0)
        EraseWithBlend(_render_2, _queue_to_process2);

The red stops working and the green one starts to run.

I can not understand why the 2 do not work together.


I’d need to look more at your code to see what is happening.


Thank you for your help.