Conversation
|
Are we sure this should be applied to all framework usage from the point of application startup? osu!framework may be used for non-games. Or even for games, it may be backgrounded in which case game mode might need to be switched off. |
it could be a toggle internally to be turned on before the initialization if it's a game and can be disabled if not a game. |
|
Thank you for the feedback! You're right that enabling gamemode unconditionally may not be appropriate for all framework users. Here's what I'd propose:
This should address both concerns: non-game uses of the framework are completely unaffected, and backgrounding is handled correctly. |
|
need documentation on best practices, the things you're suggesting are coming from somewhere, but i'm not sure that somewhere is reliable. |
|
This might not be exactly same if you mean to use this outside of osu!, but a similar discussion took place before: ppy/osu#11996 |
|
I'm not sure what "best practices" refers to here, but this is my own design judgement rather than something based on documented best practices. If you're looking My reasoning is as follows: Depending on the application, I don't think there's much need to boost performance when the window is in the background or not focused, so enabling gamemode in For these reasons, I think it makes sense to have gamemode disabled by default and allow games or performance-critical apps to opt in. Additionally, since gamemode requests use D-Bus communication internally, I felt it would be better to avoid calling them in rapid succession, which is why I added |
Calls
gamemode_request_start()on startup andgamemode_request_end()on shutdown via P/Invoke tolibgamemode.so.0.If libgamemode is not installed, the calls are silently ignored.
This allows osu-framework-based games (including osu!) to benefit from gamemode's CPU/GPU optimisations without requiring
gamemoderunas a wrapper.