示例#1
0
文件: tester.c 项目: andybest/bitbox
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
文件: player.cpp 项目: sturd/glBase
/*
	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();
}