summaryrefslogtreecommitdiff
path: root/helpscreen.c
blob: bb298bfd7cb3f5c8b937b97083af1f7d36be4508 (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

void help(SDL_Renderer* renderer)
{
	// Load help image
	SDL_Surface* surf_help = IMG_Load("helpscreen.png");
  SDL_Texture* surf_help_tex = SDL_CreateTextureFromSurface(renderer, surf_help);

	SDL_RenderClear(renderer);
	SDL_RenderCopy(renderer, surf_help_tex, NULL, NULL);
	SDL_RenderPresent(renderer);
	
	// now free the memory we used to draw this image
	SDL_FreeSurface(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;
			}
		}
	}
}