本文整理汇总了C++中Communication::GetCommand方法的典型用法代码示例。如果您正苦于以下问题:C++ Communication::GetCommand方法的具体用法?C++ Communication::GetCommand怎么用?C++ Communication::GetCommand使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Communication
的用法示例。
在下文中一共展示了Communication::GetCommand方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
//BITMAP *the_image;
//PALETTE the_palette;
if (allegro_init() != 0)
return 1;
/*if (argc != 2) {
allegro_message("Usage: 'exbitmap filename.[bmp|lbm|pcx|tga]'\n");
return 1;
}*/
install_keyboard();
if (set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0) != 0) {
//if (set_gfx_mode(GFX_AUTODETECT, 640, 480, 0, 0) != 0) {
if (set_gfx_mode(GFX_SAFE, 640, 480, 0, 0) != 0) {
set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);
allegro_message("Unable to set any graphic mode\n%s\n", allegro_error);
return 1;
}
}
///* read in the bitmap file */
//the_image = load_bitmap(argv[1], the_palette);
//if (!the_image) {
// set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);
// allegro_message("Error reading bitmap file '%s'\n", argv[1]);
// return 1;
//}
///* select the bitmap palette */
//set_palette(the_palette);
Communication* comm = new Communication();
// create menu screen.
ScreenManager* mScreenManager= new ScreenManager();
Model* model = new Model();
mScreenManager->Initialize(model);
mScreenManager->ChangeScreen(0);
// force draw;
mScreenManager->Redraw();
Command cmd = NOCOMMAND;
while (cmd != QUIT)
{
cmd = comm->GetCommand();
mScreenManager->HandleCommand(cmd);
}
// /* blit the image onto the screen */
// blit(the_image, screen, 0, 0, (SCREEN_W-the_image->w)/2,
//(SCREEN_H-the_image->h)/2, the_image->w, the_image->h);
// /* destroy the bitmap */
// destroy_bitmap(the_image);
// readkey();
return 0;
}