summaryrefslogtreecommitdiff
path: root/helpscreen.c
blob: dbbbce091b33822e94380a801e4beb215fe68a5c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

void help( SDL_Surface * surf_screen )
{
	// Load help image
	SDL_Surface *surf_help = IMG_Load( "helpscreen.png" );

	// Draw this image onto screen
	SDL_BlitSurface( surf_help, NULL, surf_screen, NULL);
	SDL_Flip( surf_screen );
	
	// now free the memory we used to draw this image
	free( surf_help );
	
	// Now wait until the user presses a key
	SDL_Event event;
	int waiting_for_user = 1;
	
	while ( waiting_for_user )
	{
		while ( SDL_PollEvent( &event ) )
		{
			if ( event.type == SDL_KEYDOWN )
			{
				waiting_for_user = 0;
				break;
			}
		}
	}
}