本文整理汇总了C++中MyApp::run方法的典型用法代码示例。如果您正苦于以下问题:C++ MyApp::run方法的具体用法?C++ MyApp::run怎么用?C++ MyApp::run使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MyApp
的用法示例。
在下文中一共展示了MyApp::run方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char** argv)
{
MyApp app;
if (!app.init(&argc, argv))
return 1;
app.run();
return 0;
}
示例2: main
int main( int argc, char** argv )
{
Feel::Environment env( _argc=argc,_argv=argv,_desc=makeOptions(),_about=makeAbout() );
MyApp myapp;
myapp.run();
}
示例3: main
int main(int argc, char** argv)
{
MyApp app;
app.setConfig("config.json");
app.setDesign("selection/Design.json");
if (!app.init(&argc, argv))
return 1;
app.run();
return 0;
}
示例4: main
//.........这里部分代码省略.........
sge_PutPixel(s,x+32,y+50,c.toColor(s));
}
for(x=0;x<32;x++)
{
int y=spline3(x/32.0,v2,v3,v4,v5);
sge_PutPixel(s,x+64,y+50,c.toColor(s));
}
for(x=0;x<32;x++)
{
int y=spline3(x/32.0,v3,v4,v5,v6);
sge_PutPixel(s,x+96,y+50,c.toColor(s));
}
SDL_Flip(s);
// SDL_Delay(1000);
}
else if(test==9)
{
SplineMap<float> m(64,64,50);
int w=64;
VoxelView v(w,w*2,Pos3D(0,0,0),false);
int z=0;
for(int x=0;x<w;x++)
{
float h=20+x/16.0;
for(int y=0;y<h;y++)
{
float a=std::min(1.0f,h-y);
// if(a<1)
if(a>0)
{
cdebug(a);
v.set(Pos3D(x,y,z),Color(0xFF,0xFF,0xFF,a));//Color(0xAA*a,0xAA*a,0));//,a));
}
}
}
av->insert(new VoxelImage(v.getSurface(),Pos3D(0,0,0)));
}
else if(test==10)
{
SDL_Surface *s=getScreen().surface();
for(int x=0;x<100;x++)
{
float h=20+x/16.0;
for(int y=0;y<h;y++)
{
float a=std::min(1.0f,h-y);
if(a>0)
{
sge_PutPixelAlpha(s,x,100-y,SDL_MapRGBA(s->format,0xFF,0xFF,0xFF,a*0xFF),a*0xFF);
}
}
}
SDL_Flip(s);
SDL_Delay(1000);
}
else if(test==11 || test==12)
{
int w=8;
SplineMap<float> m(POINTS_PER_TILE*(w+2),POINTS_PER_TILE*(w+2),40);
SplineMap<float> gm(POINTS_PER_TILE*(w+2),POINTS_PER_TILE*(w+2),10);
if(test==12)
w=2;
for(int y=0;y<w;y++)
for(int x=0;x<w;x++)
{
int mx=x*(POINTS_PER_TILE);
int my=y*(POINTS_PER_TILE/2);
if(y&1)
mx+=(POINTS_PER_TILE/2);
av->insert(new VoxelImage(makeTerrainTile(m,gm,mx,my),Pos3D(mx*TILE_WIDTH/POINTS_PER_TILE,0,my*TILE_WIDTH/POINTS_PER_TILE)));
}
}
else if(test==13)
{
AGSurface s=makeWaterTile();
av->insert(new VoxelImage(s,Pos3D(64,0,0)));
av->insert(new VoxelImage(s,Pos3D(0,0,0)));
av->insert(new VoxelImage(s,Pos3D(64+32,0,32)));
av->insert(new VoxelImage(s,Pos3D(32,0,32)));
av->insert(new VoxelImage(s,Pos3D(64+32,0,-32)));
av->insert(new VoxelImage(s,Pos3D(32,0,-32)));
}
else if(test==14)
{
AGSurface s=makeWaterTile();
std::string ms=toPNG(s.surface());
s=fromPNG(ms);
av->insert(new VoxelImage(s,Pos3D(64,0,0)));
}
app.setMainWidget(av);
app.run();
}
示例5: main
int main(int argc, char **argv) {
MyApp app;
return app.run(argc, argv);
}