今天使用的pthread我面臨更新在cocos2d-X框架對象的問題。 我嘗試下載異步線程一些文本,然後在CCTextFieldTTF更新文本,之後文本字段中消失。在cocos2d-X
void HelloWorld::callbackFunc(void *Layer, std::vector<promowall::CItem> Items) {
cocos2d::CCLayer *layer = static_cast<cocos2d::CCLayer *>(Layer);
cocos2d::CCLabelTTF *label = dynamic_cast<cocos2d::CCLabelTTF *>(layer->getChildByTag(10));
label->setString("test");
}
如果有人能幫我解釋我該如何使用openGl和pthreads,我將非常感激。