use setSustainedPerformanceMode (#965)

* use setSustainedPerformanceMode

* more
This commit is contained in:
Logan McNaughton
2026-05-27 20:45:43 +02:00
committed by GitHub
parent 14b973ec5f
commit 9dfc42c723
2 changed files with 16 additions and 3 deletions
@@ -19,6 +19,7 @@
<application
android:icon="@mipmap/ic_launcher"
android:label="Gopher64"
android:appCategory="game"
android:hardwareAccelerated="true">
<activity android:configChanges="orientation|screenSize|screenLayout|keyboardHidden"
android:name=".SlintActivity" android:exported="true">
@@ -1,12 +1,24 @@
package io.github.gopher64.gopher64
import android.content.Intent
import android.os.PowerManager
import android.content.Context
import android.os.Bundle
import android.util.Log
import org.libsdl.app.SDLActivity
class N64Activity : SDLActivity() {
companion object {
const val CONFIGURE_INPUT_PROFILE = 2
const val RUN_ROM = 3
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val powerManager = getContext().getSystemService(Context.POWER_SERVICE) as PowerManager
if (powerManager.isSustainedPerformanceModeSupported) {
Log.v("SDL", "Enabling sustained performance mode")
window.setSustainedPerformanceMode(true)
} else {
Log.v("SDL", "Sustained performance mode not supported")
}
}
override fun getLibraries(): Array<String> = arrayOf(