multithreading - Cocos, how to render to a CCRenderTexture from a background thread -


i have render loop want run in background can control speed of playback loop making animate either slow or fast. right i'm using sleep , calling begin , end on ccrendertexture in main thread each time want use sprite:

[self performselectoronmainthread:@selector(visit) withobject:nil waituntildone:yes];  - (void)visit {     [target begin];     [[self.currentline.brush sprite] visit];     [target end]; } 

this hack got working of course makes run slow. calling begin , end in background thread causes nothing render @ all

i want able call begin, drawing in background thread , call end i've tried has either done nothing or made eaglview flip out.

the ccrendertexure works redirecting opengl output onto drawing gets done saved on sprite. means in single operation need call begin drawing , call end.

when running on background thread ccdirector making it's own draw calls in main thread when call begin , try multiple functions in state director drawing causing sorts of strange errors.

end needs called before normal rendering operations resume.


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -