#include #include #include #include "buffering.h" #include "mouse_function.h" #include "main_menu.h" using namespace std; void setup() { allegro_init(); set_color_depth(32); install_keyboard(); install_mouse(); install_timer(); /*don't know if you need this*/ if (set_gfx_mode(GFX_AUTODETECT_WINDOWED,1024,768,0,0)!=0) { set_gfx_mode(GFX_TEXT,0,0,0,0); allegro_message(allegro_error); exit(1); } show_mouse(screen); } int main(void) { setup(); // sets up the screen buffering game_screen; // creates an object where our screen will be held, handles // double buffering for us. main_menu my_main_menu(game_screen); // we want to set up the main menu so we pass // it a reference to game screen so it knows where to set up stuff. kind of important :-D while(!key[KEY_ESC]) { my_main_menu.render_menu();// puts the main menu onto the buffer game_screen.render(); // puts the buffer onto the viewable screen removing the flickering } return 0; } END_OF_MAIN()