In cocos2d, it can use the follow lines to create a thread running in the background to load audio asynchronously.
NSOperationQueue queue = autorelease];
NSInvocationOperationasyncSetupOperation =
[[NSInvocationOperation alloc] initWithTarget:self
selector:@selector(initAudioAsync)
object:nil];
But how can I do that in cocos2d-x. I haven’t found its corresponding methods.Please help.
You can use pthread to create a new thread. It isn’t very convenient but it works.
Thanks a lot. I will have a try.