From dc9b56a7650dd65d574c0e33ea7cb9e1612622f7 Mon Sep 17 00:00:00 2001 From: Silvan Jegen Date: Mon, 7 Jan 2019 21:59:53 +0100 Subject: Start porting code to SDL2 (WIP) --- helpscreen.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'helpscreen.c') diff --git a/helpscreen.c b/helpscreen.c index dbbbce0..bebc936 100644 --- a/helpscreen.c +++ b/helpscreen.c @@ -1,12 +1,19 @@ -void help( SDL_Surface * surf_screen ) +void help(SDL_Renderer* renderer, SDL_Texture * surf_screen ) { // Load help image - SDL_Surface *surf_help = IMG_Load( "helpscreen.png" ); + SDL_Surface* surf_help = IMG_Load( "helpscreen.png" ); + SDL_Texture* surf_help_tex = SDL_CreateTextureFromSurface(renderer, surf_help); // Draw this image onto screen - SDL_BlitSurface( surf_help, NULL, surf_screen, NULL); - SDL_Flip( surf_screen ); + //SDL_BlitSurface( surf_help, NULL, surf_screen, NULL); + //SDL_Flip( surf_screen ); + + SDL_UpdateTexture(surf_screen, NULL, surf_help_tex, 640 * sizeof (Uint32)); + + SDL_RenderClear(renderer); + SDL_RenderCopy(renderer, surf_screen, NULL, NULL); + SDL_RenderPresent(renderer); // now free the memory we used to draw this image free( surf_help ); @@ -27,5 +34,3 @@ void help( SDL_Surface * surf_screen ) } } } - - -- cgit v1.2.1-18-gbd029