iOS support test branch #777
Replies: 3 comments 4 replies
-
|
I think this branch is a better starting point for the cross-platform compilation on all Apple OSes. Also, it’s better to push this version to the develop branch and after apply my PR, so we will have also a native SwiftUI version without the need to create a hosting app for every platform. Maybe my pull request will not work after this branch. If this is the case, I can get your branch first and do the merge in my branch and do the pull request again. Just tell me if you can't merge. |
Beta Was this translation helpful? Give feedback.
-
|
I reviewed the branch, and maybe the only conflict we can have is that I made some changes in the SceneView to make it compatible with both macOS and iOS. The rest of the changes should be trivial to merge. |
Beta Was this translation helpful? Give feedback.
-
|
I tested the develop version and it works on iOS and macOS but not in the simulators. Do you want me to check the simulators? I think I prefer to keep working on all simulators first, make it compile and run, because it’s faster to try all the devices like watchOS, tvOS and VisionOS instead of testing in the device, especially VisionOS because I need to put the glasses on and off all the time. I'm guessing the problem of not running on the simulators could be because the metal lib is not compiled for that, but I need to dig deeper to check what the issue is. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Javier, this is the branch I referred to in your PR.
It is called:
feature/enable_ios_support_test
Again, if you feel that it will be helpful, please use it as a reference.
The only thing that it is missing is essentially the dimensions for the mtkview. I hardcoded those values during the test and the engine worked on my iOS device.
Here is a rundown of what I did.
TL;DR:
Package.swiftlinks frameworks conditionally and ships platform metallibs.What changed
Swift conditionals
#if os(macOS)where behavior is OS-specific (e.g.,NSApplication/window setup).InputSystem abstraction
NS*/UI*types leak into the core.Package.swift
unsafeFlags):UntoldEngineKernels.metallib(macOS)UntoldEngineKernels-ios.metallib(iOS device)UntoldEngineKernels-iphonesim.metallib(iOS Simulator)Metallib loading
Logger
os.Loggeron iOS later).Executables
DemoGame/StarterGamesources with#if os(macOS)so choosing an iOS destination in Xcode doesn’t attempt to link AppKit.UntoldEnginepackage and embeds the engine’sMTKView.Quick iOS smoke test
For a quick test, I hardcoded the dimension values. This is not present in the branch.
I tried to keep the commit history as clean as possible so you can follow my changes.
thanks. Again, feel free to use if you think it will be helpful.
Beta Was this translation helpful? Give feedback.
All reactions