forked from MeloNX/MeloNX
WIP: Fix SDL init
This commit is contained in:
parent
f18307af51
commit
1ada8c5e34
@ -32,6 +32,7 @@
|
||||
<!-- Allow access to the vibrator -->
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
|
||||
|
||||
<!-- if you want to capture audio, uncomment this. -->
|
||||
<!-- <uses-permission android:name="android.permission.RECORD_AUDIO" /> -->
|
||||
|
@ -276,7 +276,7 @@ public class SDLActivity extends AppCompatActivity implements View.OnSystemUiVis
|
||||
// "SDL2_mixer",
|
||||
// "SDL2_net",
|
||||
// "SDL2_ttf",
|
||||
// "main"
|
||||
"main"
|
||||
};
|
||||
}
|
||||
|
||||
@ -398,7 +398,7 @@ public class SDLActivity extends AppCompatActivity implements View.OnSystemUiVis
|
||||
mSurface = createSDLSurface(this);
|
||||
|
||||
mLayout = new RelativeLayout(this);
|
||||
mLayout.addView(mSurface);
|
||||
// mLayout.addView(mSurface);
|
||||
|
||||
// Get our current screen orientation and pass it down.
|
||||
mCurrentOrientation = SDLActivity.getCurrentOrientation();
|
||||
|
Binary file not shown.
@ -10,14 +10,19 @@ import android.app.Application
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.activity.compose.setContent
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.isSystemInDarkTheme
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.SideEffect
|
||||
import androidx.compose.runtime.saveable.rememberSaveableStateHolder
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.viewinterop.AndroidView
|
||||
import androidx.core.app.ActivityCompat
|
||||
import org.libsdl.app.SDLActivity
|
||||
|
||||
@ -50,10 +55,14 @@ open class MainActivity: SDLActivity {
|
||||
enableEdgeToEdge()
|
||||
|
||||
setContent {
|
||||
val saveableStateHolder = rememberSaveableStateHolder()
|
||||
saveableStateHolder.SaveableStateProvider(true) {
|
||||
PresentationRootView(ComposeContext())
|
||||
SideEffect { saveableStateHolder.removeState(true) }
|
||||
Box {
|
||||
SDLComposeSurface()
|
||||
|
||||
val saveableStateHolder = rememberSaveableStateHolder()
|
||||
saveableStateHolder.SaveableStateProvider(true) {
|
||||
PresentationRootView(ComposeContext())
|
||||
SideEffect { saveableStateHolder.removeState(true) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -119,6 +128,15 @@ open class MainActivity: SDLActivity {
|
||||
|
||||
companion object {
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun SDLComposeSurface() {
|
||||
AndroidView(
|
||||
factory = { context ->
|
||||
mSurface
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
@ -139,8 +139,8 @@ private extension Ryujinx {
|
||||
args.append(config.gamepath)
|
||||
|
||||
// Starts with vulkan
|
||||
// args.append("--graphics-backend")
|
||||
// args.append("Vulkan")
|
||||
args.append("--graphics-backend")
|
||||
args.append("Vulkan")
|
||||
|
||||
args.append(contentsOf: ["--memory-manager-mode", config.memoryManagerMode])
|
||||
|
||||
|
@ -22,6 +22,7 @@ public struct melonxRootView : View {
|
||||
logger.info("Welcome to Skip on \(androidSDK != nil ? "Android" : "Darwin")!")
|
||||
logger.info("Skip app logs are viewable in the Xcode console for iOS; Android logs can be viewed in Studio or using adb logcat")
|
||||
}
|
||||
.opacity(0.3)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user