您好,欢迎访问三七文档
当前位置:首页 > 办公文档 > 演讲稿/致辞 > Vega Prime全面教程
·1VegaVegaPrime·2TheVegaPrime™DesktopTutor·3VP·4ACF·5·6············#includevpApp.hintmain(intargc,char*argv[]){//vp::initialize(argc,argv);//vpAppvpApp*app=newvpApp;//acfif(argc=1)app-define(simple.acf);elseapp-define(argv[1]);//app-configure();//app-run();app-unref();//vp::shutdown();return0;}••••••••vpKernel::define()vpKernel::define(constchar*filename)while(s_vpKernel-beginFrame()!=0)s_vpKernel-endFrame();···•••••••••vpKernel::configure()vpKernel::configure()vpKernel::isConfigured()vpKernel::isConfigured()vpKernel::instance()vpKernel::instance()•••••vpKernel::update()vpKernel::update()vpPipeline::vpPipeline()vpPipeline::vpPipeline()vpPipeline::addWindow()vpPipeline::addWindow(vpWindow*window,intlocation=-1)vpPipeline::removeWindow()vpPipeline::removeWindow(vpWindow*window)vpPipeline::erase_window()vpPipeline::erase_window(const_iterator_windowit)vpPipeline::begin_window()vpPipeline::begin_window()constvpPipeline::end_window()vpPipeline::end_window()constvpPipeline::empty_window()vpPipeline::empty_window()constvpPipeline::getNumWindows()vpPipeline::getNumWindows()constvpPipeline::getWindow()vpPipeline::getWindow(intlocation)constvpPipeline::insert_window()vpPipeline::insert_window(vpWindow*window,const_iterator_windowit)vpPipeline::push_back_window()vpPipeline::push_back_window(vpWindow*window)vpPipeline::size_window()vpPipeline::size_window()constvpWindow::vpWindow()vpWindow::vpWindow()vpWindow::addChannel()vpWindow::addChannel(vpChannel*channel)vpWindow::removeChannel()vpWindow::removeChannel(vpChannel*channel)vpWindow::insertChannel()vpWindow::insertChannel(vpChannel*channel,intlocation)vpWindow::setBorderEnable()vpWindow::setBorderEnable(boolenable)vpWindow::getBorderEnable()vpWindow::getBorderEnable(const)vpWindow::setLabel()vpWindow::setLabel(constchar*label)vpWindow::getLabel()vpWindow::getLabel(const)vpWindow::setKeyboardFunc()vpWindow::setKeyboardFunc(KeyboardFuncfunc)vpWindow::getKeyboardFunc()vpWindow::getKeyboardFunc(const)vpWindow::setMouseFunc()vpWindow::setMouseFunc(MouseFuncfunc)vpWindow::getMouseFunc()vpWindow::getMouseFunc(const)vpWindow::setInputEnable()vpWindow::setInputEnable(boolenable)vpWindow::getInputEnable()vpWindow::getInputEnable(const)vpWindow::setCoordinates()vpWindow::setCoordinates(intleft,intright,intbottom,inttop)Forexample:vpWindow*window;window-setCoordinates(100,600,100,600);vpWindow::getCoordinates()vpWindow::getCoordinates(int*left,int*right,int*bottom,int*top)intleft,right,bottom,top;vpWindow*window;window-getCoordinates(&left,&right,&bottom,&top);vpWindow::setOrigin()vpWindow::setOrigin(intx,inty)vpWindow::getOrigin()vpWindow::getOrigin(int*x,int*y)vpWindow::setFullScreenEnable()vpWindow::setFullScreenEnable()vpWindow::setSize()vpWindow::setSize(intwidth,intheight)vpWindow::getSize()vpWindow::getSize(int*width,int*height)TOM#includevsgu.h#includevp.h#includevpSearchPath.h#includevpApp.h#includevuAllocTracer.h#includevuDistributed.hvuAllocTracertracer(true,true);//#########################################################//#Torunthisdistributedrenderingsample,usethe#//#DistributedRenderingUtilitestosetupamasterand#//#aslavesystem#//#########################################################classmyApp:publicvpApp{public:myApp():vpApp(){};~myApp(){};virtualvoidrun();private:};voidmyApp::run(){vuNotify::setLevel(vuNotify::LEVEL_INFO);uintframeNum;if(vuDistributed::getMode()==vuDistributed::MODE_SLAVE){uintseed=13;VUNOTIFY_PRINT((vuNotify::LEVEL_INFO,NULL,Slavesettingseedto=%d\n,seed));srand(seed);}else{uintseed=5;VUNOTIFY_PRINT((vuNotify::LEVEL_INFO,NULL,Mastersettingseedto=%d\n,seed));srand(seed);}//renderingloopwhile((frameNum=vpKernel::instance()-beginFrame())0){intmyframenum=frameNum;//basicsyncmechanism.mastersandslaveswait.nodataisexchanged.vuDistributed::sync();intrandomNum=rand();VUNOTIFY_PRINT((vuNotify::LEVEL_INFO,NULL,OriginalRandomNumber=%d\n,randomNum));intmasterData;//ifmaster,cachetherandomnumberandsendittotheslaves.if(vuDistributed::getMode()==vuDistributed::MODE_MASTER){masterData=randomNum;}//slaveswaitformastertoreceivedata.ifmastergetsherefirst,itsendsdataandimmediatelymoveson.//ifslavesgetherefirst,slavesblockwaitingformaster?xmlversion=1.0?AcfRootxmlns:xsi=:schemaLocation=urn://=urn://=urn://:vpEnv=urn://:vpMotion=urn://:AcfInfoname=Chapter2.acfvp:initializeModulevpEnv/vp:initializeModulevp:initializeModulevpMotion/vp:initializeModulevp:autoEnabletrue/vp:autoEnablevp:appToRun/vp:appToRunArgs$ACF/vp:appToRunArgsvp:comment/vp:createdByVersion1.2.0/vp:createdByVersion/vp:AcfInfovp:Kernelname=myKernelvp:setNotifyLevelLEVEL_WARN/vp:setNotifyLevelvp:setNotifyColorEnablefalse/vp:setNotifyColorEnablevp:setPriorityPRIORITY_NORMAL/vp:setPriorityvp:setProcessor-1/vp:setProcess
本文标题:Vega Prime全面教程
链接地址:https://www.777doc.com/doc-3564603 .html