mirror of
https://github.com/gopher64/gopher64.git
synced 2026-07-11 01:25:20 +02:00
use setSustainedPerformanceMode (#965)
* use setSustainedPerformanceMode * more
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user