-
Notifications
You must be signed in to change notification settings - Fork 68
Update graphics contract, Update to latest version of BabylonNative #191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update graphics contract, Update to latest version of BabylonNative #191
Conversation
… update-graphics-contract
…e UpdateView contract
…e UpdateView contract
…eactNative into update-graphics-contract
| void Initialize(facebook::jsi::Runtime& jsiRuntime, Dispatcher jsDispatcher); | ||
| void Deinitialize(); | ||
| void UpdateView(void* windowPtr, size_t width, size_t height, void* windowTypePtr = nullptr); | ||
| void UpdateView(void* windowPtr, size_t width, size_t height); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, we should be removing void * from this header as well, in favor of WindowType.
Currently I cannot include the headers here without build failure, I'll keep tooling with CMake to so that this works, but it may require making this a library instead of a collection of source files included in another library. I'm no CMake expert, however.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
id suggest redefining the type here or using a void pointer for the time being. We can update include directories for the native modules to track down the headers required to access the window type definition. But right now the native modules aren't precompiled binaries when distributed through npm. So if BabylonNative.h references babylon native headers and our react-native native module references BabylonNative.h, i'm pretty sure wed have to package and distribute all headers required to resolve the windowtype, which is going to be a lot more work/seems beyond the scope of fixing breaking changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After chatting offline, I'll go forward with retaining void*.
| "${CMAKE_CURRENT_LIST_DIR}/DispatchFunction.h" | ||
| "${CMAKE_CURRENT_LIST_DIR}/BabylonNative.h" | ||
| "${CMAKE_CURRENT_LIST_DIR}/BabylonNative.cpp") | ||
| "${CMAKE_CURRENT_LIST_DIR}/BabylonNative.cpp") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove new line
| { | ||
| GraphicsConfiguration graphicsConfig = GraphicsConfiguration(); | ||
| graphicsConfig.WindowPtr = (WindowType)windowPtr; | ||
| graphicsConfig.Width = width; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit can we have this as a reinterpret_cast()?
| { | ||
| ANativeWindow* windowPtr{ ANativeWindow_fromSurface(env, surface) }; | ||
| ANativeWindow* windowPtr = ANativeWindow_fromSurface(env, surface); | ||
| auto width{ static_cast<size_t>(ANativeWindow_getWidth(windowPtr)) }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: was this change needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not at all, reverting
chrisfromwork
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
![]()
|
Looks like everything's green outside of the Android build failures |
| nvtt.lib; | ||
| OGLCompilerd.lib; | ||
| openxr_loader.lib; | ||
| openxr_loaderd.lib; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't these changes part of @chrisfromwork's PR? Not sure why they are showing up here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes were recommended by chris, I added them to this PR so that it would pass windows CI. We can check in #188 and I can rebase, else we pretty much have the same goal here, I'm just integrating my changes from the new latest commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah in moving to the newest master we'll see breaks in ci without this change
|
@ryantrem, are we good to check in? |
…Platform.h include
Co-authored-by: Ryan Tremblay <ryantrem@msn.com>
This PR integrates changes from BabylonJS/BabylonNative#582, updating the BabylonNative graphics initialization code to consume the configuration-based contract.