Skip to content

Commit 65759fc

Browse files
Use BabylonNative WindowT type
1 parent 0247349 commit 65759fc

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

Modules/@babylonjs/react-native/ios/BabylonNativeInterop.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ + (void)updateView:(MTKView*)mtkView {
5959
const int width = static_cast<int>(mtkView.bounds.size.width * scale);
6060
const int height = static_cast<int>(mtkView.bounds.size.height * scale);
6161
if (width != 0 && height != 0) {
62-
BabylonNative::UpdateView(mtkView, width, height);
62+
BabylonNative::UpdateView(mtkView.layer, width, height);
6363
}
6464
}
6565

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,9 @@ namespace BabylonNative
8181
Napi::Detach(m_env);
8282
}
8383

84-
void UpdateView(WindowType window, size_t width, size_t height)
84+
void UpdateView(Babylon::Graphics::WindowT window, size_t width, size_t height)
8585
{
86-
#if defined(__APPLE__)
87-
m_graphicsConfig.Window = (Babylon::Graphics::WindowT)window.layer;
88-
#else
8986
m_graphicsConfig.Window = window;
90-
#endif
9187
m_graphicsConfig.Width = width;
9288
m_graphicsConfig.Height = height;
9389
UpdateGraphicsConfiguration();

Modules/@babylonjs/react-native/shared/BabylonNative.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace BabylonNative
2727
void Initialize(facebook::jsi::Runtime& jsiRuntime, Dispatcher jsDispatcher);
2828
void Deinitialize();
2929

30-
void UpdateView(WindowType window, size_t width, size_t height);
30+
void UpdateView(Babylon::Graphics::WindowT window, size_t width, size_t height);
3131
void UpdateMSAA(uint8_t value);
3232
void UpdateAlphaPremultiplied(bool enabled);
3333

0 commit comments

Comments
 (0)