Exemple #1
0
int main( int argc, char *argv[] )
{
	printf( APP_NAME"\n" );

	common.running = true;
	common.path = argv[0];
	{//Strip the file name + extension to get the current working directory
		int i = strlen( common.path )-1;
		while ( common.path[i] && i > 0 )
		{
			if ( common.path[i] == '/' || common.path[i] == '\\' )
			{
				common.path[i] = '\0';
				break;
			}
			i--;
		}
	}
	printf( "Path is %s\n\n", common.path );

	srand( (unsigned int)time( NULL ) );

	R_Initialise();
	Game_Initialise();
	Input_Initialise();

	while ( common.running )
	{
		Input_Poll();

		if ( common.running )
		{//If the input handler picked up an exit, don't bother with the game
			R_ClearScreen();
			Game_Render();
			SDL_GL_SwapBuffers();
		}
	}

	R_Shutdown();
	Game_Shutdown();

	printf( "Thanks for playing!\n" );

	return 0;
}
Exemple #2
0
/* Security task */
void io_task(uint_32 temp) {
   while (1) {
      Input_Poll();
      _time_delay(200);
   }
}