示例#1
0
文件: Record.cpp 项目: Gavleen/repo
void init() {
	int depth, res;
	allegro_init();
	depth = desktop_color_depth();
	if (depth == 0) depth = 32;
	set_color_depth(depth);
	res = set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0);
	if (res != 0) {
		allegro_message(allegro_error);
		exit(-1);
	}
 install_sound(DIGI_AUTODETECT,MIDI_AUTODETECT, NULL);
	  install_sound_input(DIGI_AUTODETECT,MIDI_NONE);
	install_timer();
	install_keyboard();
	install_mouse();
	/* add other initializations here */
}
示例#2
0
/* init_window_modules:
 *  Initialises the modules that are specified by the WM argument.
 */
static int init_window_modules(struct WINDOW_MODULES *wm)
{
   if (wm->keyboard)
      install_keyboard();

   if (wm->mouse)
      install_mouse();

   if (wm->joystick)
      install_joystick(wm->joy_type);

   if (wm->sound)
      install_sound(wm->digi_card, wm->midi_card, NULL);

   if (wm->sound_input)
      install_sound_input(wm->digi_input_card, wm->midi_input_card);

   return 0;
}