Activate Game Mode for my App in Sonoma?

Hello everyone.

I wonder what conditions should be met to let Sonoma activate Game Mode for my App? The app is a 3D application with high demands on GPU, so gaining additional performance from OS would be great. But simply going full screen does not activate Game Mode like e.g. games from Steam do.

Are there any settings that one could influence to let the app trigger Game Mode?

Best regards, Alex

Answered by Frameworks Engineer in 768172022

Game Mode on macOS Sonoma prioritizes the performance of games for smoother, more consistent frame rates and improved in-game responsiveness. The OS uses the LSApplicationCategoryType to determine whether an app is a game. Game mode activates when a game is full screen, and is the front most app.

Game Mode is intended for games, which need sustained priority access to CPU, GPU, and input peripherals in order to meet soft real-time constraints. Game Mode is not appropriate for other categories of applications, such as 3D productivity software or offline 3D rendering software, which does not have a real time constraint. The LSApplicationCategoryType should be set to the category that best reflects the intended use of your application.

Accepted Answer

Game Mode on macOS Sonoma prioritizes the performance of games for smoother, more consistent frame rates and improved in-game responsiveness. The OS uses the LSApplicationCategoryType to determine whether an app is a game. Game mode activates when a game is full screen, and is the front most app.

Game Mode is intended for games, which need sustained priority access to CPU, GPU, and input peripherals in order to meet soft real-time constraints. Game Mode is not appropriate for other categories of applications, such as 3D productivity software or offline 3D rendering software, which does not have a real time constraint. The LSApplicationCategoryType should be set to the category that best reflects the intended use of your application.

Thank you! That helped.

Hello @adevaykin, @Justin, et al!

I need some help getting the 'Game Mode' enabled and working in a SwiftUI project for macOS (Deployment Target: 14.0; Target minimum deployment: macOS 14.0).

For the Target's identity, the App Category is set to 'Games'. When the app is build and run, the following key appears in the Info.plist: <key>LSApplicationCategoryType</key> <string>public.app-category.games</string>".

The app launches in full-screen with the following SwiftUI structure:

struct AppName: App {
  var body: some Scene {
    WindowGroup {
      ContentView()
      .onAppear {
        DispatchQueue.main.async {
          if let window = NSApplication.shared.windows.last {
            window.toggleFullScreen(nil)
          }
        }
      }
    }
  }
}

When app is launched, the app loads full-screen however the "game controller" icon does not appear in the menu bar.

Any suggestions?

Adding:

  1. The app also delivers real-time, interactive graphics which puts heavy demands on the CPU and GPU.
  2. Within the ContentView(), there's a view providing a UI via SwiftUI, and a view delivering an MTKView via a NSViewRepresentable.
  3. Inconsistent frame-rates on macOS have been very noticeable to users, so enabling "game mode" should help the user experience considerably.
  4. Developed and tested on a Apple M2 Max running macOS 14.2.1 (23C71)
  5. When the app is modified to run without automatically taking the window into fullscreen mode, and the user follows the instructions found on the "Use Game Mode on Mac" support page (namely: "1. Move your pointer over the green button in the upper-left corner of the game window. 2. Choose Enter Full Screen from the menu that appears.") the 'Game Mode" menu icon does not appear in the menu bar.

Many thanks in advance for your help!

Activate Game Mode for my App in Sonoma?
 
 
Q