本文整理汇总了C++中Menu::Display方法的典型用法代码示例。如果您正苦于以下问题:C++ Menu::Display方法的具体用法?C++ Menu::Display怎么用?C++ Menu::Display使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Menu
的用法示例。
在下文中一共展示了Menu::Display方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawLevel
//----------------------------DRAW LABYRINTHE - PLAYER - ENEMIES - UI
void DrawLevel() {
glPushMatrix();
if (inGame)
{
// Translate Map
glTranslatef(-player.GetPos().x + (windowWidth / 2), -player.GetPos().y + (windowHeight / 2), 0);
// Draw map
lvl.DisplayMap();
//Draw Enemies
lvl.DrawSpecialCases();
//Draw Enemies
lvl.DrawEnemies();
if (player.GetPos().z == 1) { // If the player is UP
// Draw UpCase under the player and his fire
lvl.DrawUpCase();
}
//Draw Fires
lvl.DrawAllFires();
// Add player
player.Draw(inGame);
if (player.GetPos().z == 0) { // If the player is DOWN
// Draw UpCase over the player and his fire
lvl.DrawUpCase();
}
glLoadIdentity();
glutSwapBuffers();
glPopMatrix();
//Draw HUD
hud.displayScore(lvl.HUD_Score(), player.GetLife(), player.GetWeapon());
}
else
{
lvl.DisplayMap();
//Draw Menu
menu.Display();
// Add player
player.Draw(inGame);
glLoadIdentity();
glutSwapBuffers();
glPopMatrix();
}
}
示例2: main
//.........这里部分代码省略.........
qu= al_create_event_queue();
if(!qu){
cout<<"error creando queue"<<endl;
}
al_register_event_source(qu, al_get_display_event_source(Screen));
timer = al_create_timer(1.0 / 35);
if(!timer){
cout<<"error iniciando timer"<<endl;
}
al_register_event_source(qu, al_get_timer_event_source(timer));
al_register_event_source(qu, al_get_keyboard_event_source());
//}}}1
// iniciar clases y timer{{{1
// 0 inicio
// 1 menu
// 2 core
Inicio inicio;
Menu menu;
Core core;
inicio.Iniciar();
core.Iniciar_core(Screen);
al_start_timer(timer);
Image = al_load_bitmap("data/test.png"); ///load the bitmap from a file
background= al_load_bitmap("data/background.png");
// ALLEGRO_COLOR clearcol=al_map_rgb(255,255,255);
//}}}1
// main loop {{{1
while(Exit == false){
al_wait_for_event(qu, &Event);
if(al_is_event_queue_empty(qu)){
if(estado==0){
inicio.Display(Screen);
menu.Iniciar_menu(Screen);
estado=1;
}
if(estado==1){
menu.Display(Screen);
core.Iniciar_core(Screen);
}
if(estado==2){
x+=1;
core.Animar();
al_draw_bitmap(background,0,0,0);
core.Display(Screen);
al_draw_bitmap(Image,x,y,0);
}
al_flip_display();
}
if(Event.type == ALLEGRO_EVENT_DISPLAY_CLOSE)
{
Exit = true;
}
if(Event.type == ALLEGRO_EVENT_TIMER){
}
if(Event.type==ALLEGRO_EVENT_KEY_DOWN){
Exit=true;
}
}
return 0;
}