1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-10 04:33:20 +08:00

Expose high performance session state

This commit is contained in:
Dean Herbert 2024-04-16 09:51:43 +08:00
parent 7e4782d4b1
commit d89edd2b4f
No known key found for this signature in database
2 changed files with 8 additions and 0 deletions

View File

@ -3,6 +3,7 @@
using System; using System;
using System.Runtime; using System.Runtime;
using System.Threading;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Logging; using osu.Framework.Logging;
using osu.Game.Performance; using osu.Game.Performance;
@ -11,6 +12,8 @@ namespace osu.Desktop.Performance
{ {
public class HighPerformanceSessionManager : IHighPerformanceSessionManager public class HighPerformanceSessionManager : IHighPerformanceSessionManager
{ {
public bool IsSessionActive => activeSessions > 0;
private int activeSessions; private int activeSessions;
private GCLatencyMode originalGCMode; private GCLatencyMode originalGCMode;

View File

@ -14,6 +14,11 @@ namespace osu.Game.Performance
/// </summary> /// </summary>
public interface IHighPerformanceSessionManager public interface IHighPerformanceSessionManager
{ {
/// <summary>
/// Whether a high performance session is currently active.
/// </summary>
bool IsSessionActive { get; }
/// <summary> /// <summary>
/// Start a new high performance session. /// Start a new high performance session.
/// </summary> /// </summary>