From 28000b95c2b4d029867ef83f5bf9238668bf4907 Mon Sep 17 00:00:00 2001 From: Michael Martin Date: Wed, 21 Aug 2019 01:07:12 -0700 Subject: [PATCH] Compute the window caption at the proper time for SDL2 --- sc2/src/libs/graphics/sdl/sdl2_pure.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sc2/src/libs/graphics/sdl/sdl2_pure.c b/sc2/src/libs/graphics/sdl/sdl2_pure.c index 1a4915798..189578a40 100644 --- a/sc2/src/libs/graphics/sdl/sdl2_pure.c +++ b/sc2/src/libs/graphics/sdl/sdl2_pure.c @@ -17,8 +17,9 @@ #include "pure.h" #include "libs/graphics/bbox.h" -#include "scalers.h" #include "libs/log.h" +#include "scalers.h" +#include "uqmversion.h" #if SDL_MAJOR_VERSION > 1 @@ -103,13 +104,17 @@ TFB_Pure_ConfigureVideo (int driver, int flags, int width, int height, int toggl if (window == NULL) { SDL_RendererInfo info; + char caption[200]; int flags2 = 0; + if (flags & SDL_WINDOW_FULLSCREEN) { flags2 = SDL_WINDOW_FULLSCREEN_DESKTOP; } - /* TODO: Create the right window name right away */ - window = SDL_CreateWindow ("", + sprintf (caption, "The Ur-Quan Masters v%d.%d.%d%s", + UQM_MAJOR_VERSION, UQM_MINOR_VERSION, + UQM_PATCH_VERSION, UQM_EXTRA_VERSION); + window = SDL_CreateWindow (caption, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, width, height, flags2); if (!window)