Vega Prime入门教程15.11:导出acf为源码

Vega Prime入门教程索引:Vega Prime入门教程索引

导出

打开C:\Presagis\Suite22\Vega_Prime_22_0\resources\samples\vegaprime\vp\vp_simple中的示例acf

默认工程的acf

点击菜单 File -> Export CPP

导出菜单

弹出配置界面,设置

导出设置

Generate main program勾选上,就会在代码中生成main函数

点击Export按钮导出代码

记得备份原始文件

编译

导出的代码为20k,原始代码为1k

导出代码

原始main

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
int main(int argc, char *argv[])
{
vuAllocTracer tracer;
// initialize vega prime
vp::initialize(argc, argv);

// initialize addition modules here
//vpModule::initializeModule(modulename);

// create a vpApp instance
vpApp *app = new vpApp;

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

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

// runtime loop
app->run();

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

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

return 0;
}

导出main

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//
// Main Program
//

int main(int argc, char *argv[])
{
// initialize Vega Prime
vp::initialize(argc, argv);

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

// use the code generated by LynX Prime
define();

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

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

// call the unconfig code generated by LynX Prime
unconfigure();

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

// shutdown Vega Prime
vp::shutdown();

return 0;

}

相当于把acf展开为API代码

VS

打开工程,编译,运行

运行效果


Vega Prime入门教程15.11:导出acf为源码
https://blog.jackeylea.com/vegaprime/export-acf-to-source-code/
作者
JackeyLea
发布于
2023年12月25日
许可协议