diff options
author | Silvan Jegen <s.jegen@gmail.com> | 2018-09-22 20:01:40 +0200 |
---|---|---|
committer | Silvan Jegen <s.jegen@gmail.com> | 2018-09-22 20:05:53 +0200 |
commit | 5d5bc3e446ee50601f98ca30d4f21172d6e75e29 (patch) | |
tree | abdbe68d23373c095e2d50b2cd8f15af40dfdb65 /helpscreen.c |
Initial commit
Diffstat (limited to 'helpscreen.c')
-rw-r--r-- | helpscreen.c | 31 |
1 files changed, 31 insertions, 0 deletions
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;
+ }
+ }
+ }
+}
+
+
|