--- othello.old/draw.cpp +++ othello/draw.cpp @@ -136,18 +136,25 @@ } } +void handle_close (void) +{ + extern int exit_program; + exit_program = true; +} // set a graphics mode and allocate the necessary bitmaps int Draw::init_graphics() { -// set_color_depth(16); - set_color_depth(32); - if (set_gfx_mode(GFX_AUTODETECT, 800, 600, 0, 0) < 0) + set_color_depth (24); + + if (set_gfx_mode(GFX_AUTODETECT_WINDOWED, 800, 600, 0, 0) < 0) { - allegro_message("Could not set 800x600x24 graphics mode.\n"); - return 0; + allegro_message ("Couldn't set 800x600x24 graphics mode.\n"); + return 0; } + set_close_button_callback (handle_close); + // show the mouse show_mouse(screen);