2011-03-01 50 views
5

我很高兴在今天下午几小时的黑客攻击后让我的第一个C++应用程序工作。该应用程序在视频中交易时间维度的X维度。线程:在C++ Cinder应用程序的后台进行处理,以保持UI的响应

如何优化源将受到欢迎任何建议,但我感兴趣的是如何做到这一点我做的图像处理在update()中,这种方式不会导致应用程序无法响应。

(在libcinder论坛Crossposted:http://forum.libcinder.org/#Topic/23286000000669039

+0

所以你还有问题吗?否则可能标记为已解决。它仍然显示在未解答的问题。 – nus 2011-08-16 10:02:11

+0

怎么样?在标题中加入[已解决]? – forresto 2011-08-17 12:32:54

+0

下面有一个框...添加您的编辑作为答案,然后接受它。 – 2011-08-17 12:38:09

回答

1

答案似乎是线程。它与Cinder一样工作:

void MyApp::setup() 
{ 
    thread(&MyApp::processFrame, this); 
} 
void MyApp::processFrame() 
{ 
    // TODO define mFrameTemp here 
    // Copy to the texture which we'll actually render 
    mFrame = mFrameTemp; 
} 
void MyApp::draw() 
{ 
    if (mFrame) 
    gl::draw(mFrame, mFrame.getBounds()); 
} 
相关问题