一个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//
/
}
}