Пример #1
0
int main ( int argc, char** argv )
{
    printf("Starting test ... \n");

    gamepad_buttons[0] = 0; // all up
    gamepad_buttons[1] = 0;
    
    game_init();

    printf("  Game init done. \n");

    // program main loop
    for (int i=0;i<EMU_FRAMES;i++) {
        handle_gamepad();

        // update game
        game_frame();

        // update time
        vga_frame++;

        // one sound buffer per frame 
        game_snd_buffer(audio,BITBOX_SNDBUF_LEN); 

        refresh_screen();
    } // end main loop

    // all is well ;)
    printf("  Test OK !\n");
    return 0;
}
Пример #2
0
/*
	handle_input() - Determine the input type assigned to the class
					 and execute the relavent routine to handle inputs.
 */
void player::handle_input()
{
#ifdef WIN32
	if( ( ( input_type * )input )->get_input_type() == INPUT_TYPE_GAMEPAD )
		handle_gamepad();
#endif
	if( ( ( input_type * )input )->get_input_type() == INPUT_TYPE_KEYBOARD )
		handle_keyboard();
}