Skip to content

Various iOS integration fixes#31

Merged
ryantrem merged 11 commits into
BabylonJS:masterfrom
ryantrem:ios-fixes
Jun 22, 2020
Merged

Various iOS integration fixes#31
ryantrem merged 11 commits into
BabylonJS:masterfrom
ryantrem:ios-fixes

Conversation

@ryantrem

Copy link
Copy Markdown
Member

This fixes about half the remaining issues listed in #15. The big changes here are:

  • Get release build working - libbx and libbgfx have different names for debug and release (d is appended in debug). To fix this, these libs are directly configured as linker options that differ between debug and release, which seems to be the only way to configure this in XCode.
  • Handle engine reinstantiation - this happens when the React Native app reloads the JS context. This only required adding a call to DeinitializeGraphics when the native instance is destroyed.
  • Don't crash when remote debugging is enabled - don't try to make a synchronous JS call (it's not possible when remote debugging is enabled), change the interop layer to key off of the RCTBridge rather than the jsi::Runtime, and handle the case where the jsi::Runtime hanging off the RCTBridge is null (this happens when remote debugging is enabled).
  • Forward touch input - this was just plumbing through touch input through the interop layer and into the Babylon native layer.

Other changes worth mentioning:

  • I changed the structure of the code to handle view reinstantiation and view resizing, but both of these things cause crashes, so some new code is commented out until this is resolved.
  • I added some code to call InitializeGraphics on the UI thread (there is a runtime warning about this currently, and the regular Babylon Native Playground runs this on the UI thread, so I think this is what we need to do), but this also causes a crash so it is commented out until this is resolved.
  • I moved some of the setView logic out of EngineView and into the interop layer to be more consistent with what we do on Android and to simplify the code in EngineView a bit.
  • I hid the BabylonNative.h file from the POD since it is already visible in the generated ReactNativeBabylon project.

@ryantrem ryantrem merged commit a4637b6 into BabylonJS:master Jun 22, 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