您的位置:首页 > 其它

一个vp程序的基本流程

2006-03-29 21:27 295 查看
一个vp程序的基本流程,曾经为一个因漏写unconfigure()导致的内存泄露问题调了很久。

int main(int argc, char *argv[])
{

// initialize vega prime
vp::initialize(argc, argv);

// create my app instance
myApp *app = new myApp;

// load the acf file
if (argc <= 1)
app->define("des.acf");
else app->define(argv[1]);

// configure my app
app->configure();

// execute the main runtime loop
app->run();

// unconfigure my app

unconfigure();

// delete my app instance
app->unref();

// shutdown vega prime
vp::shutdown();

return 0;

}

其中

class myApp : public vpApp

其中对vpApp:run()进行重载

void myApp::run(void)
{
while( s_vpKernel->beginFrame() != 0){
s_vpKernel->endFrame();
/////////////////////////////////////////////your code//////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: