int main() { int ok; allegro_init(); install_timer(); do { set_color_depth(8); if (set_gfx_mode (GFX_AUTODETECT, 640, 480, 0, 0) < 0) { allegro_message ("Error setting plain graphics mode:\n%s\n", allegro_error); return -1; } install_allegro_gl(); install_keyboard(); install_mouse(); ok = setup(); remove_keyboard(); remove_mouse(); if (ok) run_demo(); remove_allegro_gl(); } while (ok); return 0; }
void gui_enter() { int x = 1; DIALOG_PLAYER *dp; while (keypressed()) readkey(); while (key[KEY_F11]) rest(100); gui_update(); if (curtube != 3 && !mouse_amx) install_mouse(); set_color_depth(dcol); show_mouse(screen); bemgui[0].x = (windx / 2) - 36; bemgui[0].y = windy - 8; bemgui[0].fg = makecol(255,255,255); dp=init_dialog(bemgui, 0); while (x && !key[KEY_F11] && !key[KEY_ESC]) { x = update_dialog(dp); } shutdown_dialog(dp); show_mouse(NULL); set_color_depth(8); if (curtube != 3 && !mouse_amx) remove_mouse(); while (key[KEY_F11]) rest(100); video_clearscreen(); }
void main_setmouse() { if (curtube != 3) { if (mouse_amx) install_mouse(); else remove_mouse(); } }
void S9xTextMode () { if (!in_text_mode) { set_color_depth (8); remove_keyboard (); remove_mouse (); set_gfx_mode (GFX_TEXT, 0, 0, 0, 0); in_text_mode = TRUE; } }
void GameExit(void) { remove_keyboard(); remove_timer(); remove_mouse(); allegro_exit(); return; }
int cControls::Exit() { if(!m_exited) { remove_keyboard(); remove_joystick(); remove_mouse(); FreeAll(); m_exited = true; } return 0; }
/* exit_window_modules: * Removes the modules that depend upon the main window: * - keyboard (DirectInput), * - mouse (DirectInput), * - joystick (DirectInput), * - sound (DirectSound), * - sound input (DirectSoundCapture). * If WM is not NULL, record which modules are really removed. */ static void exit_window_modules(struct WINDOW_MODULES *wm) { if (wm) memset(wm, 0, sizeof(*wm)); if (_keyboard_installed) { if (wm) wm->keyboard = TRUE; remove_keyboard(); } if (_mouse_installed) { if (wm) wm->mouse = TRUE; remove_mouse(); } if (_joystick_installed) { if (wm) { wm->joystick = TRUE; wm->joy_type = _joy_type; } remove_joystick(); } if (_sound_installed) { if (wm) { wm->sound = TRUE; wm->digi_card = digi_card; wm->midi_card = midi_card; } remove_sound(); } if (_sound_input_installed) { if (wm) { wm->sound_input = TRUE; wm->digi_input_card = digi_input_card; wm->midi_input_card = midi_input_card; } remove_sound_input(); } }
void Graphic::deinit() { for (int i=0; i<MAX_SPRITE; i++) { imageDestroy(this->pSprites[i]); } for (int i=0; i<MAX_SPRITE_PLAYER; i++) { imageDestroy(this->pSpritesPlayer[i]); } imageDestroy(pBuffer); remove_mouse(); remove_keyboard(); allegro_exit(); }
void main_restart() { bempause = 1; startblit(); if (curtube == 3 || mouse_amx) remove_mouse(); cmos_save(models[oldmodel]); oldmodel = curmodel; model_init(); main_reset(); if (curtube == 3 || mouse_amx) install_mouse(); endblit(); bempause = 0; }
void exit_module_gui() { save_gui_config(); // destroy shortcuts ASSERT(shortcuts != NULL); for (Shortcut* shortcut : *shortcuts) delete shortcut; delete shortcuts; shortcuts = NULL; delete manager; // Now we can destroy theme CurrentTheme::set(NULL); delete ase_theme; remove_keyboard(); remove_mouse(); main_clipboard->dispose(); main_display->dispose(); }
optionsScreen::~optionsScreen() { remove_mouse(); disable_hardware_cursor(); }