Skip to content

Initial iOS integration#30

Merged
ryantrem merged 34 commits into
BabylonJS:masterfrom
ryantrem:ios
Jun 17, 2020
Merged

Initial iOS integration#30
ryantrem merged 34 commits into
BabylonJS:masterfrom
ryantrem:ios

Conversation

@ryantrem

@ryantrem ryantrem commented Jun 17, 2020

Copy link
Copy Markdown
Member

This is the initial work to get iOS integration working. There are a bunch of known things still left, which I've listed off in issue #15, but this change brings basic functionality. The big parts of this change are:

  • Minimal changes to get the existing iOS code building (there were issues before I even started adding new code).
  • Add a Babylon::Native class that mirrors what we did on the Android side (ties together the set of underlying Babylon Native constructs we want to use in the React Native integration).
  • Add a CMakeLists.txt that compiles Babylon::Native (and all its dependencies on Babylon Native).
  • Add instructions to manually run CMake on this new CMakeLists.txt to generate an XCode project.
  • Add the generated XCode project to the Playground's XCode workspace.
  • Add a ton of static libs to be linked by the Playground XCode project.
  • Add an interop layer that mirrors the interop layer on Android.
  • Add a custom React Native module that mirrors the Android side.
  • Added a native EngineViewManager that mostly mirrors what we do on the Android side. One difference here is that there doesn't seem to be a way to get onto the JS thread directly from the native code, so now early in the initialization the JS code makes a synchronous call into the native code so we can capture the CFRunLoop for the JS thread and later schedule work on this thread.
  • Updated JavaScript EngineView to call this new synchronous initialization function.
  • Updated to the latest BabylonNative submodule, which in turn includes the latest arcana.cpp, which includes the new run_loop_scheduler (based on CFRunLoop).
  • Added the JSCRuntime.h that @syntheticmagus created that gives us access to the underlying JSC JSGlobalContextRef. In a different change I will update the Android side to deal with the JS context similarly to how I did it here for iOS, which will make for a smoother transition away from the custom JSCRuntime.h to just using JSI directly.

ryantrem added 30 commits June 3, 2020 16:22
Set version to 0.0.1 as 0.0.0 is not valid for pods
Update README.md files with iOS specific info, as well as manual file updates required for camera permissions
Add initialize and whenInitialize stubs
…he JS thread) and getting a pointer to the JSIRuntime (e.g. JSCRuntime when using JSC)
…ylonNative lib (including interop layer)

Include BabylonNative (generated) project in Playground workspace

Fix things up to pass a jsi::Runtime* to the interop layer
…ied as a dependency in the Babylon React Native podspec

@CedricGuillemet CedricGuillemet left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ryantrem ryantrem merged commit c7208a5 into BabylonJS:master Jun 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants