|
game_launcher 1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
|
Classes | |
| class | GameModeAPI |
Functions | |
| void | addApplicationSpecificFixes (std::ostringstream &cmd, const Game &game) |
| Add application-specific environment variables for known problematic apps. | |
| void | addGPUOptimizations (std::ostringstream &cmd, bool isProton=false) |
| Add GPU-specific optimization environment variables. | |
| void | addSyncEnvironment (std::ostringstream &cmd, const GameRunnerConfig &config, bool isProton=false) |
| Add synchronization environment variables. | |
| std::string | buildGamescopeWrapper (const GameRunnerConfig &config, std::string &modeInfo) |
| Build the Gamescope wrapper prefix. | |
| std::string | buildWrapperChain (const GameRunnerConfig &config, const std::string &gameId) |
| Build the wrapper chain for a game launch. | |
| std::string | detectGPUVendor () |
| Detect GPU vendor for GPU-specific optimizations. | |
| time_t | getProcessStartTimeFromProc (int pid) |
| bool | isWrapperAvailable (const std::string &name) |
| Check if a wrapper/tool is available in PATH. | |
| bool | kernelSupportsFsync () |
| Check if kernel supports Fsync (futex2). | |
| bool | kernelSupportsNTSync () |
| Check if kernel supports NTSync (kernel 6.14+ or CachyOS backport). | |
| const std::vector< std::string > & | kWineSystemExes () |
| void anonymous_namespace{game_process.cpp}::addApplicationSpecificFixes | ( | std::ostringstream & | cmd, |
| const Game & | game ) |
Add application-specific environment variables for known problematic apps.
| cmd | The command stream to append to |
| game | The game being launched |
Some applications require specific environment variables to work correctly under Wine/Proton. This function detects known problematic applications and adds the necessary fixes automatically.
Known fixes:
Definition at line 2007 of file game_process.cpp.
References GameRunnerConfig::executablePath, Logger::info(), Game::name, Game::runnerConfig, and Logger::warn().
| void anonymous_namespace{game_process.cpp}::addGPUOptimizations | ( | std::ostringstream & | cmd, |
| bool | isProton = false ) |
Add GPU-specific optimization environment variables.
| cmd | The command stream to append to |
| isProton | Whether this is a Proton launch (vs plain Wine) |
Note: RADV_PERFTEST is no longer set. In modern Mesa (24.x+), all commonly useful flags (rt, nggc, sam, gpl) have graduated to being on by default.
Definition at line 1970 of file game_process.cpp.
References detectGPUVendor(), and Logger::info().
| void anonymous_namespace{game_process.cpp}::addSyncEnvironment | ( | std::ostringstream & | cmd, |
| const GameRunnerConfig & | config, | ||
| bool | isProton = false ) |
Add synchronization environment variables.
| cmd | The command stream to append to |
| config | The runner configuration |
| isProton | Whether this is a Proton launch (vs plain Wine) |
Sync method priority (best to fallback):
Note: WINEFSYNC/WINEESYNC should both be set as Esync serves as fallback for code paths that don't support Fsync. Proton also supports PROTON_NO_ESYNC/PROTON_NO_FSYNC to explicitly disable.
Definition at line 1926 of file game_process.cpp.
References GameRunnerConfig::autoDetectSync, GameRunnerConfig::enableFsync, Logger::info(), kernelSupportsFsync(), and kernelSupportsNTSync().
| std::string anonymous_namespace{game_process.cpp}::buildGamescopeWrapper | ( | const GameRunnerConfig & | config, |
| std::string & | modeInfo ) |
Build the Gamescope wrapper prefix.
| config | The runner configuration |
| modeInfo | Output parameter for launch info display |
Gamescope is a Wayland compositor for gaming that provides:
Command structure: gamescope -W {width} -H {height} [-w {internal_w} -h {internal_h}] [options] -- {command}
Definition at line 1714 of file game_process.cpp.
References GameRunnerConfig::enableGamescope, GameRunnerConfig::enableMangoHud, GameRunnerConfig::gamescopeBorderless, GameRunnerConfig::gamescopeEnableFSR, GameRunnerConfig::gamescopeEnableHDR, GameRunnerConfig::gamescopeEnableITM, GameRunnerConfig::gamescopeEnableVRR, GameRunnerConfig::gamescopeForceGrabCursor, GameRunnerConfig::gamescopeFSRSharpness, GameRunnerConfig::gamescopeFullscreen, GameRunnerConfig::gamescopeHeight, GameRunnerConfig::gamescopeIntegerScaling, GameRunnerConfig::gamescopeInternalHeight, GameRunnerConfig::gamescopeInternalWidth, GameRunnerConfig::gamescopeITMSDRNits, GameRunnerConfig::gamescopeRefreshRate, GameRunnerConfig::gamescopeWidth, Logger::info(), and isWrapperAvailable().
| std::string anonymous_namespace{game_process.cpp}::buildWrapperChain | ( | const GameRunnerConfig & | config, |
| const std::string & | gameId ) |
Build the wrapper chain for a game launch.
| config | The runner configuration. |
| gameId | Game ID, used to resolve any per-game wrapper config (e.g. MangoHud per-launch config file in ${XDG_STATE_HOME}/gamelauncher/<id>/mangohud.conf). |
CachyOS best practices: game-performance should be the OUTERMOST wrapper so it can apply scheduling optimizations to the entire process tree. Order: game-performance -> gamemoderun -> command MangoHud and VkBasalt are activated via env vars (MANGOHUD=1, ENABLE_VKBASALT=1)
Note: Gamescope is handled separately via buildGamescopeWrapper() as it wraps the entire command differently (gamescope [opts] -- {command}).
Definition at line 1846 of file game_process.cpp.
References FrameMetricsService::buildMangoHudLaunchConfigFile(), GameRunnerConfig::enableGameMode, GameRunnerConfig::enableGamePerformance, GameRunnerConfig::enableGamescope, GameRunnerConfig::enableMangoHud, GameRunnerConfig::enableVkBasalt, ShellUtils::escapeArg(), Logger::info(), FrameMetricsService::instance(), SystemInfoService::instance(), isWrapperAvailable(), and GameRunnerConfig::mangoHudConfigFile.
| std::string anonymous_namespace{game_process.cpp}::detectGPUVendor | ( | ) |
Detect GPU vendor for GPU-specific optimizations.
Definition at line 1561 of file game_process.cpp.
Referenced by addGPUOptimizations().
| time_t anonymous_namespace{game_process.cpp}::getProcessStartTimeFromProc | ( | int | pid | ) |
Definition at line 869 of file game_process.cpp.
| bool anonymous_namespace{game_process.cpp}::isWrapperAvailable | ( | const std::string & | name | ) |
Check if a wrapper/tool is available in PATH.
| name | Name of the wrapper (e.g., "mangohud", "gamemoderun") |
Definition at line 1676 of file game_process.cpp.
Referenced by buildGamescopeWrapper(), and buildWrapperChain().
| bool anonymous_namespace{game_process.cpp}::kernelSupportsFsync | ( | ) |
Check if kernel supports Fsync (futex2).
Definition at line 1620 of file game_process.cpp.
Referenced by addSyncEnvironment().
| bool anonymous_namespace{game_process.cpp}::kernelSupportsNTSync | ( | ) |
Check if kernel supports NTSync (kernel 6.14+ or CachyOS backport).
NTSync is a new synchronization primitive that provides better Wine/Proton performance than Fsync. It was merged in kernel 6.14 but CachyOS and some other distributions backport it to earlier kernels.
Detection checks:
Definition at line 1665 of file game_process.cpp.
References SystemInfoService::instance(), and SystemInfoService::supportsNTSync().
Referenced by addSyncEnvironment().
| const std::vector< std::string > & anonymous_namespace{game_process.cpp}::kWineSystemExes | ( | ) |
Definition at line 1546 of file game_process.cpp.