From 5d5bc3e446ee50601f98ca30d4f21172d6e75e29 Mon Sep 17 00:00:00 2001 From: Silvan Jegen Date: Sat, 22 Sep 2018 20:01:40 +0200 Subject: Initial commit --- helpscreen.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 helpscreen.c (limited to 'helpscreen.c') diff --git a/helpscreen.c b/helpscreen.c new file mode 100644 index 0000000..dbbbce0 --- /dev/null +++ b/helpscreen.c @@ -0,0 +1,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; + } + } + } +} + + -- cgit v1.2.1-18-gbd029