forked from MeloNX/MeloNX
Fix
This commit is contained in:
parent
d667178aa5
commit
f632f16449
@ -370,7 +370,7 @@
|
|||||||
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
|
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
|
||||||
INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
|
INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
|
||||||
INFOPLIST_KEY_UISupportsDocumentBrowser = YES;
|
INFOPLIST_KEY_UISupportsDocumentBrowser = YES;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
@ -421,7 +421,7 @@
|
|||||||
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
|
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
|
||||||
INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
|
INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
|
||||||
INFOPLIST_KEY_UISupportsDocumentBrowser = YES;
|
INFOPLIST_KEY_UISupportsDocumentBrowser = YES;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
|
Binary file not shown.
@ -16,10 +16,25 @@ struct ContentView: View {
|
|||||||
@State var gameUrl: URL?
|
@State var gameUrl: URL?
|
||||||
@State var showFileImporter: Bool = false
|
@State var showFileImporter: Bool = false
|
||||||
@State var emulationStarted: Bool = false
|
@State var emulationStarted: Bool = false
|
||||||
@State var mainThread: Bool = false
|
@State var mainThread: Bool = true
|
||||||
|
|
||||||
@State var debugmode: Int = 0
|
@State var debugmode: Int = 0
|
||||||
|
|
||||||
|
init() {
|
||||||
|
SDL_SetMainReady()
|
||||||
|
SDL_iPhoneSetEventPump(SDL_TRUE)
|
||||||
|
|
||||||
|
|
||||||
|
if SDL_Init(SDL_INIT_VIDEO) < 0 {
|
||||||
|
fatalError("Unable to initialize SDL: \(String(cString: SDL_GetError()))")
|
||||||
|
}
|
||||||
|
|
||||||
|
if SDL_Vulkan_LoadLibrary(nil) != 0 {
|
||||||
|
fatalError("Failed to load Vulkan library: \(String(cString: SDL_GetError()))")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
ZStack {
|
ZStack {
|
||||||
if let gameUrl, emulationStarted {
|
if let gameUrl, emulationStarted {
|
||||||
@ -30,11 +45,13 @@ struct ContentView: View {
|
|||||||
inputPath: gameUrl.path,
|
inputPath: gameUrl.path,
|
||||||
mainThread: mainThread,
|
mainThread: mainThread,
|
||||||
graphicsBackend: "Vulkan",
|
graphicsBackend: "Vulkan",
|
||||||
additionalArgs: ["--display-id", String(displayid)]
|
additionalArgs: [
|
||||||
|
"--display-id", String(displayid),
|
||||||
|
"--fullscreen", "true"
|
||||||
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
showVirtualController(url: gameUrl, ryuconfig: config)
|
showVirtualController(url: gameUrl, ryuconfig: config)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -92,14 +109,6 @@ func startEmulation(game: URL, config: RyujinxEmulator.Configuration) {
|
|||||||
let config = config
|
let config = config
|
||||||
|
|
||||||
// patchMakeKeyAndVisible()
|
// patchMakeKeyAndVisible()
|
||||||
|
|
||||||
let window = SDL_CreateWindow("Ryujinx", Int32(SDL_WINDOWPOS_CENTERED_MASK), Int32(SDL_WINDOWPOS_CENTERED_MASK), 640, 480, SDL_WINDOW_SHOWN.rawValue | SDL_WINDOW_ALLOW_HIGHDPI.rawValue)
|
|
||||||
if window == nil {
|
|
||||||
print("Error creating SDL window: \(String(cString: SDL_GetError()))")
|
|
||||||
} else {
|
|
||||||
print("SDL Window created successfully!")
|
|
||||||
}
|
|
||||||
|
|
||||||
// SDL_Init(SDL_INIT_VIDEO)
|
// SDL_Init(SDL_INIT_VIDEO)
|
||||||
|
|
||||||
let emulator = RyujinxEmulator()
|
let emulator = RyujinxEmulator()
|
||||||
|
@ -42,25 +42,21 @@ class VulkanSDLView: UIView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private func initializeSDL() {
|
private func initializeSDL() {
|
||||||
|
|
||||||
SDL_SetMainReady()
|
|
||||||
SDL_iPhoneSetEventPump(SDL_TRUE)
|
|
||||||
// print(SDL_Init(SDL_INIT_VIDEO))
|
|
||||||
// Initialize SDL with video support
|
// Initialize SDL with video support
|
||||||
if SDL_Init(SDL_INIT_VIDEO) < 0 {
|
|
||||||
print("Unable to initialize SDL: \(String(cString: SDL_GetError()))")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create an SDL window with Metal support
|
// Create an SDL window with Metal support
|
||||||
sdlWindow = SDL_CreateWindow(
|
DispatchQueue.main.async { [self] in
|
||||||
"Ryujinx",
|
sdlWindow = SDL_CreateWindow(
|
||||||
Int32(SDL_WINDOWPOS_CENTERED_MASK),
|
"Ryujinx",
|
||||||
Int32(SDL_WINDOWPOS_CENTERED_MASK),
|
Int32(SDL_WINDOWPOS_CENTERED_MASK),
|
||||||
Int32(frame.width),
|
Int32(SDL_WINDOWPOS_CENTERED_MASK),
|
||||||
Int32(frame.height),
|
Int32(frame.width),
|
||||||
SDL_WINDOW_SHOWN.rawValue | SDL_WINDOW_ALLOW_HIGHDPI.rawValue | SDL_WINDOW_METAL.rawValue
|
Int32(frame.height),
|
||||||
)
|
SDL_WINDOW_SHOWN.rawValue | SDL_WINDOW_ALLOW_HIGHDPI.rawValue | SDL_WINDOW_VULKAN.rawValue
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
guard sdlWindow != nil else {
|
guard sdlWindow != nil else {
|
||||||
print("Error creating SDL window: \(String(cString: SDL_GetError()))")
|
print("Error creating SDL window: \(String(cString: SDL_GetError()))")
|
||||||
|
@ -184,8 +184,10 @@ namespace Ryujinx.Headless.SDL2
|
|||||||
DefaultFlags = SDL_WindowFlags.SDL_WINDOW_ALLOW_HIGHDPI;
|
DefaultFlags = SDL_WindowFlags.SDL_WINDOW_ALLOW_HIGHDPI;
|
||||||
FullscreenFlag = SDL_WindowFlags.SDL_WINDOW_FULLSCREEN_DESKTOP;
|
FullscreenFlag = SDL_WindowFlags.SDL_WINDOW_FULLSCREEN_DESKTOP;
|
||||||
}
|
}
|
||||||
|
|
||||||
WindowHandle = SDL_GetWindowFromID(1);
|
WindowHandle = SDL_GetWindowFromID(1);
|
||||||
|
Logger.Info?.Print(LogClass.Gpu, $"DisplayID: \"{WindowHandle}\"");
|
||||||
|
|
||||||
//SDL_CreateWindow($"Ryujinx {Program.Version}{titleNameSection}{titleVersionSection}{titleIdSection}{titleArchSection}", SDL_WINDOWPOS_CENTERED_DISPLAY(DisplayId), SDL_WINDOWPOS_CENTERED_DISPLAY(DisplayId), Width, Height, DefaultFlags | FullscreenFlag | GetWindowFlags());
|
//SDL_CreateWindow($"Ryujinx {Program.Version}{titleNameSection}{titleVersionSection}{titleIdSection}{titleArchSection}", SDL_WINDOWPOS_CENTERED_DISPLAY(DisplayId), SDL_WINDOWPOS_CENTERED_DISPLAY(DisplayId), Width, Height, DefaultFlags | FullscreenFlag | GetWindowFlags());
|
||||||
|
|
||||||
if (WindowHandle == IntPtr.Zero)
|
if (WindowHandle == IntPtr.Zero)
|
||||||
@ -215,10 +217,10 @@ namespace Ryujinx.Headless.SDL2
|
|||||||
// As we don't need this to fire in either case we can test for fullscreen.
|
// As we don't need this to fire in either case we can test for fullscreen.
|
||||||
if (!IsFullscreen && !IsExclusiveFullscreen)
|
if (!IsFullscreen && !IsExclusiveFullscreen)
|
||||||
{
|
{
|
||||||
Width = evnt.window.data1;
|
// Width = evnt.window.data1;
|
||||||
Height = evnt.window.data2;
|
// Height = evnt.window.data2;
|
||||||
Renderer?.Window.SetSize(Width, Height);
|
// Renderer?.Window.SetSize(Width, Height);
|
||||||
MouseDriver.SetClientSize(Width, Height);
|
// MouseDriver.SetClientSize(Width, Height);
|
||||||
// if (Renderer != null && Renderer.Window != null)
|
// if (Renderer != null && Renderer.Window != null)
|
||||||
// {
|
// {
|
||||||
// Renderer.Window.SetSize(Width, Height);
|
// Renderer.Window.SetSize(Width, Height);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user