本文整理汇总了C++中Viewer::create方法的典型用法代码示例。如果您正苦于以下问题:C++ Viewer::create方法的具体用法?C++ Viewer::create怎么用?C++ Viewer::create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Viewer
的用法示例。
在下文中一共展示了Viewer::create方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WinMain
//.........这里部分代码省略.........
}
//��� Create viewport
switch (scrndevice)
{
case SCREEN_DIB:
if (bpp == 8)
{
Vport = new VngoVportDB8(width,height,
((VngoDIB*)Screen)->gmap,0,Palette,
VNGO_ZBUFFER_DEV);
}
else
{
Vport = new VngoVportDB16(width,height,
((VngoDIB*)Screen)->gmap,0,Palette,
VNGO_ZBUFFER_DEV);
}
break;
case SCREEN_DDRAW:
if (bpp == 8)
{
Vport = new VngoVportDD8(((VngoDirectDraw*)Screen)->SurfaceManager,
0, Palette,
VNGO_ZBUFFER_DEV);
}
else
{
Vport = new VngoVportDD16(((VngoDirectDraw*)Screen)->SurfaceManager,
0, Palette,
VNGO_ZBUFFER_DEV);
}
break;
case SCREEN_D3D:
{
VngoRect rct(0,0,width,height);
Vport = new VngoVportD3D(rct, Palette,
VNGO_ZBUFFER_DEV, Screen);
}
break;
}
if (!Vport)
return 1;
gberg_color(Palette->get_index(VngoColor24bit(255,255,255)),
VNGO_TRANSPARENT);
//��� Create viewer application instance
Viewer *view = new Viewer;
if (!view
|| !view->create())
return 1;
//��� Main Loop
while (PumpWindows())
{
Devs->update();
view->process_events();
view->render();
Screen->flip();
}
//��� Destroy viewer application
delete view;
//����������������������������������������������������������� Termination
if (Vport)
{
delete Vport;
Vport=0;
}
if (Palette)
{
delete Palette;
Palette=0;
}
if (Screen)
{
delete Screen;
Screen=0;
}
if (Devs)
{
delete Devs;
Devs=0;
}
if (MythOS)
{
delete MythOS;
MythOS=0;
}
return 0;
}