Hi all. I've been looking at all the new stuff in Cocos2d and have a couple of problems I'm having with CCRenderTexture.
I am playing around with a simple paint program. I have one background image that I've loaded from resources, a CCRenderTexture which I draw into with either OpenGL calls or Sprite visit's.
The drawing works OK the first time with my drawing appearing over the background, but I also want to be able to clear the draw area. I am using [drawSpace clear:0 g:0 b:0 a:0] to do this and while it clears the data away, leaving the background showing through, from that moment on none of my drawing works. Nothing appears. I've checked to see that the coordinates are all OK and they are. Is there anything else I need to do after or before a clear to make sure things work again?
Secondly. I have a question about speed. While Cocos stays at 60fps when my display is static, as I am drawing to the texture the framerate drops quite a bit until I stop drawing on it. Is there anything I can do to speed this is up? Can I selectively draw to the texture in a smaller rect to save speed? My drawing is simply:
[drawSpace begin];
glLineWidth( 5.0f );
glColor4ub(255,0,0,255);
ccDrawLine( start, end );
[drawSpace end];
Thanks