src/game.c
/* The main game loop. This is called by the main() function. */
The main game loop. This is called by the main() function.
The main game loop . This is called by the main () function .
void game_loop() {
	event_result_t ev = EV_NONE;
	SDL_bool running = SDL_TRUE;
	Uint8 r = 0, g = 64, b = 128;
	int i;
	while(running) {
		ev = event_process();
		switch(ev) {
		case EV_QUIT:
			running = SDL_FALSE;
			break;
		}
		r++; g--; b;
		for(i = 0; i < RENDER_WIDTH * RENDER_HEIGHT; i++) {
			pixels[i] = RGB(r++, g++, b++);
		}
		video_update();
	}
}
void game_loop ( ) { event_result_t ev = EV_NONE ; SDL_bool running = SDL_TRUE ; Uint8 r = 0 , g = 64 , b = 128 ; int i ; while ( running ) { ev = event_process ( ) ; switch ( ev ) { case EV_QUIT : running = SDL_FALSE ; break ; } r ++ ; g -- ; b ; for ( i = 0 ; i < RENDER_WIDTH * RENDER_HEIGHT ; i ++ ) { pixels [ i ] = RGB ( r ++ , g ++ , b ++ ) ; } video_update ( ) ; } }
The main game loop.
The main game loop .
/* This variable contains events that are passed to the game loop by the
	   input system. */ /* This variable indicates whether or not the game loop should continue
	   running. If it is set to SDL_FALSE, the game loop will end. */ /* These are variables used by the sample video output. Delete these and
	   replace them with your own! :) */ /* The game loop. This calls all of the functions necessary to update the
	   scene and display it on screen. */ /* This calls the event/input system. */ /* This handles all relevant return values from the input system. */ /* A quit message was received, so we'll set the game loop to
			   stop running after this cycle. */ /* Create a slightly trippy effect just to show that
		   everything's working. :)

		   Replace this with your own drawing routines. */ /* Updates the onscreen buffer with what we just plotted. */