Skip to content

Commit 31f9350

Browse files
authored
Update to latest Babylon Native (#88)
This updates to the latest Babylon Native which pulls in a few bug fixes and adds NativeWindow::Reinitialize. We call this when the underlying windowPtr changes so that NativeWindow::GetWindowPtr() returns the correct/current windowPtr. This is how the windowPtr is passed down to the XR layer, so without this XR does not work on iOS after the window has been replaced with a new one (related to #57).
1 parent c97290c commit 31f9350

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

Modules/@babylonjs/react-native/android/src/main/cpp/BabylonNativeInterop.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ namespace Babylon
7979
auto width = static_cast<size_t>(ANativeWindow_getWidth(windowPtr));
8080
auto height = static_cast<size_t>(ANativeWindow_getHeight(windowPtr));
8181
m_graphics->ReinitializeFromWindow<void*>(windowPtr, width, height);
82+
Plugins::NativeWindow::Reinitialize(m_env, windowPtr, width, height);
8283
}
8384

8485
void SetPointerButtonState(uint32_t pointerId, uint32_t buttonId, bool isDown, uint32_t x, uint32_t y)

Modules/@babylonjs/react-native/ios/BabylonNative.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ namespace Babylon
7373
void Native::Refresh(void* windowPtr, size_t width, size_t height)
7474
{
7575
m_impl->m_graphics->ReinitializeFromWindow<void*>(windowPtr, width, height);
76+
Plugins::NativeWindow::Reinitialize(m_impl->env, windowPtr, width, height);
7677
}
7778

7879
void Native::Resize(size_t width, size_t height)

0 commit comments

Comments
 (0)