sdl window: Added game title (serial, title and app_ver)

This commit is contained in:
raziel1000 2024-07-24 00:12:53 -06:00 committed by georgemoralis
parent f29293c9fb
commit f35518d527
3 changed files with 17 additions and 9 deletions

View file

@ -18,14 +18,15 @@
namespace Frontend {
WindowSDL::WindowSDL(s32 width_, s32 height_, Input::GameController* controller_)
: width{width_}, height{height_}, controller{controller_} {
WindowSDL::WindowSDL(s32 width_, s32 height_, Input::GameController* controller_,
std::string game_title_)
: width{width_}, height{height_}, controller{controller_}, game_title{game_title_} {
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
UNREACHABLE_MSG("Failed to initialize SDL video subsystem: {}", SDL_GetError());
}
SDL_InitSubSystem(SDL_INIT_AUDIO);
const std::string title = "shadPS4 v" + std::string(Common::VERSION);
const std::string title = "shadPS4 v" + std::string(Common::VERSION) + " | " + game_title;
SDL_PropertiesID props = SDL_CreateProperties();
SDL_SetStringProperty(props, SDL_PROP_WINDOW_CREATE_TITLE_STRING, title.c_str());
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_X_NUMBER, SDL_WINDOWPOS_CENTERED);