mirror of https://github.com/OpenTTD/OpenTTD
Feature: Set application name for SDL2
This is used for e.g. screensaver inhibitor description.pull/12824/head
parent
a288644e20
commit
6fe55cf458
|
@ -523,6 +523,8 @@ static std::optional<std::string_view> InitializeSDL()
|
||||||
/* Check if the video-driver is already initialized. */
|
/* Check if the video-driver is already initialized. */
|
||||||
if (SDL_WasInit(SDL_INIT_VIDEO) != 0) return std::nullopt;
|
if (SDL_WasInit(SDL_INIT_VIDEO) != 0) return std::nullopt;
|
||||||
|
|
||||||
|
SDL_SetHint(SDL_HINT_APP_NAME, "OpenTTD");
|
||||||
|
|
||||||
if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) return SDL_GetError();
|
if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) return SDL_GetError();
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue