From: Holger Schemel Date: Thu, 3 Sep 2020 22:50:18 +0000 (+0200) Subject: added displaying render driver on info screen page X-Git-Tag: 4.2.0.2~15 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=d4a697f4507026324c4218ba2c445d6e2e0b4dda;p=rocksndiamonds.git added displaying render driver on info screen page --- diff --git a/src/conf_gfx.c b/src/conf_gfx.c index daf471eb..0f3b6cdc 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -7897,7 +7897,7 @@ struct ConfigInfo image_config[] = { "menu.paragraph_spacing.INFO[MUSIC]", "-3" }, { "menu.paragraph_spacing.INFO[CREDITS]", "-3" }, { "menu.paragraph_spacing.INFO[PROGRAM]", "-3" }, - { "menu.paragraph_spacing.INFO[VERSION]", "-3" }, + { "menu.paragraph_spacing.INFO[VERSION]", "-2" }, { "menu.paragraph_spacing.INFO[LEVELSET]", "-3" }, { "menu.paragraph_spacing.SETUP[INPUT]", "-1" }, diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index 93c6cd01..7d0a9b5f 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -330,6 +330,15 @@ static void SDLSetAlpha(SDL_Surface *surface, boolean set, int alpha) SDL_SetSurfaceAlphaMod(surface, alpha); } +const char *SDLGetRendererName(void) +{ + static SDL_RendererInfo renderer_info; + + SDL_GetRendererInfo(sdl_renderer, &renderer_info); + + return renderer_info.name; +} + SDL_Surface *SDLGetNativeSurface(SDL_Surface *surface) { SDL_PixelFormat format; diff --git a/src/libgame/sdl.h b/src/libgame/sdl.h index acdafd5b..7cc70310 100644 --- a/src/libgame/sdl.h +++ b/src/libgame/sdl.h @@ -382,6 +382,7 @@ typedef struct UserEventInfo UserEvent; // SDL function definitions +const char *SDLGetRendererName(void); boolean SDLSetNativeSurface(SDL_Surface **); SDL_Surface *SDLGetNativeSurface(SDL_Surface *); void SDLCreateBitmapTextures(Bitmap *); diff --git a/src/screens.c b/src/screens.c index 15952e7e..d7a56c40 100644 --- a/src/screens.c +++ b/src/screens.c @@ -3764,6 +3764,14 @@ static void DrawInfoScreen_Version(void) DrawTextF(xstart3, ystart, font_head, "Used"); ystart += ystep_head; + driver_name = + getStringCopyNStatic(SDLGetRendererName(), driver_name_len); + + DrawTextF(xstart1, ystart, font_text, "Render Driver"); + DrawTextF(xstart2, ystart, font_text, "%s", ARG_DEFAULT); + DrawTextF(xstart3, ystart, font_text, "%s", driver_name); + ystart += ystep_line; + driver_name = getStringCopyNStatic(SDL_GetCurrentVideoDriver(), driver_name_len);