-
-
Notifications
You must be signed in to change notification settings - Fork 964
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
Added option to add a parent reference for SDL window #2111
Conversation
Thanks for the contribution. A couple of questions: What's causing the inputs to not work? Can this is be used already to adapt the GameForm used in the GameStudio? And in that way validate that it might work later with Avalonia. |
Im not 100% sure honestly. The Winforms inputs seem to be registered but the the results are not consistant. When you use the mouse to look around in the particle scene for example, it will slowly rotate and on release of the mouse it will flick the view in the direction it was moving. A couple thoughts I have had are:
but I havent found a solution or specific answer.
Your Avalonia branch was actually the main inspiration for me wanting this. Its why I wanted to test with Avalonia in the future when I have more time. |
Forget what I said here, this is apparently normal behaviour for this demo... |
@Kryptos-FR so I went back and tested all of the templates apart from the VR one and I had zero issues with using inputs. the problems I faced:
tested the following with Winforms:
|
Do you have public branch somewhere I could use to test those samples on my side or just the code snippet you used? |
https://github.com/Doprez/test-parent-sdl-branch/tree/main this should be all you need, essentially the .WinForms project can be attached to any Stride game the same way you would use the .Windows projects. |
https://github.com/Doprez/stride-in-avalonia Decided to mess with Avalonia since everyone at work is just waiting on the weekend lol. And a black screen is better than no screen I think? Edit: It is not better, default behvaiour when it cant use a handle is black so this isnt running at all. |
Is this one ready for merge or do you want to figure out the issue you're having with Avalonia first ? I'm guessing if there are changes required to make avalonia work it'll likely be on the client side rather than the engine one but just in case. |
@Eideren if there is any change needed for Avalonia it will be done at that time. I think it's ok to merge this PR as long as WPF is still working. |
Yep, these issues are mostly with understanding avalonia itself, the pr should be good. |
Thanks ! |
PR Details
I wanted an easy way to embed Stride into other UI frameworks so I decided to make a simple breakdown of #1474 without the built in demos.
Description
This PR allows for SDL to take in a parent handle and use that for rendering.
WinForms example:
In the future I would like to use this for experimenting with Avalonia as the parent host using the NativeControlHost.
Related Issue
#1474
Motivation and Context
Some people have asked for an easy way to embed Stride into UI frameworks in the Discord this will allow an easy constructor to pass in a parent handle.
Types of changes
Checklist