Fix program icon when starting in fullscreen in SDL2, from Ala-lala

This commit is contained in:
Michael Martin
2019-10-27 14:52:30 -07:00
parent c3ab0ed545
commit c7bbbd717c
+7 -6
View File
@@ -105,18 +105,19 @@ TFB_Pure_ConfigureVideo (int driver, int flags, int width, int height, int toggl
{ {
SDL_RendererInfo info; SDL_RendererInfo info;
char caption[200]; char caption[200];
int flags2 = 0;
if (flags & TFB_GFXFLAGS_FULLSCREEN)
{
flags2 = SDL_WINDOW_FULLSCREEN_DESKTOP;
}
sprintf (caption, "The Ur-Quan Masters v%d.%d.%d%s", sprintf (caption, "The Ur-Quan Masters v%d.%d.%d%s",
UQM_MAJOR_VERSION, UQM_MINOR_VERSION, UQM_MAJOR_VERSION, UQM_MINOR_VERSION,
UQM_PATCH_VERSION, UQM_EXTRA_VERSION); UQM_PATCH_VERSION, UQM_EXTRA_VERSION);
window = SDL_CreateWindow (caption, window = SDL_CreateWindow (caption,
SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
width, height, flags2); width, height, 0);
if (flags & TFB_GFXFLAGS_FULLSCREEN)
{
/* If we create the window fullscreen, it will have
* no icon if and when it becomes windowed. */
SDL_SetWindowFullscreen (window, SDL_WINDOW_FULLSCREEN_DESKTOP);
}
if (!window) if (!window)
{ {
return -1; return -1;