-
Notifications
You must be signed in to change notification settings - Fork 288
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
Support using Win2D with WinUI #707
Comments
This will have to happen, because although UWP will continue, UWP.UI will be deprecated and we will be using WinUI. |
@Gavin-Williams I truly hope so, because UWP is giving me nightmares |
Any news on this? We are in the process of deciding the roadmap for our application and this is a crucial point: Will we be able to use Win2D in a WinUI 3 project? What would be the necessary changes to make in Win2D (I guess only replacing some namespaces would not be sufficient). |
@jasonwurzel I certainly can't speak on MS's name - I only speak for myself, I've been following WinUI3 talks, and asked a few questions. I'm not putting that much hope into it, because UWP and WPF are sooo different (for one WPF - on top of Directx9, UWP on top of Directx11). I'm not sure they'll redo WPF on Directx11 (even though that would be incredibly cool), so using win2d from WPF might end up being too much work. Assuming you have a WPF app, and you really really need win2d (such as in my case), you're likely choice is to port it to UWP. In that case, do expect a really bumpy ride. |
Oh, we're already on the bumpy ride :-/ I should have clarified the status quo in my first post: We have a UWP app, to be more precise, we have a WPF Core app that hosts one XamlIsland that hosts our UWP app. Did I mention "bumpy ride" yet? ;-) |
Oh wow - good luck! About using win2d from a WinUI 3 project - i'm really curious how they will reconcile the pathetic StorageFile/Folder API they must be using in UWP, with WPF. We'll have to wait and see :) |
Here is community talk on WinUI 3.0. https://onedrive.live.com/?authkey=%21ADasoGSDRbpnShA&cid=9C95F4380C440E2C&id=9C95F4380C440E2C%2132156&parId=9C95F4380C440E2C%2132155&o=OneUp At around 19:00 they discuss a question "Can you use Win2D with WinUI 3.0?" and the answer was "Sure, you just need to recompile Win2D against WinUI 3.0" I personally have the same problem: I need to decide which technology to use for our new Windows application and I also need a performance and features of DirectX. This would be the perfect choice: WinUI 3.0 + Win2D So My question to Win2D team: is there any plan to release a separate NuGet package compiled against WinUI 3.0 ? |
It seems initial version of toolkit for WinUI 3.0 exists now |
I have managed to compile win2d for winui (see https://github.com/lhak/Win2D/tree/winui3). Most of the changes are rather trivial but there are also some hacks:
So far the included SimpleSample app seems to work. I have also successfully tested CanvasControl and CanvasSwapChain in a c# desktop app by adding the projection files to project and copying the win2d dll to the output folder. |
@rucoder thanks for linking to the Toolkit. We have preview bits available that work on Preview 1 here. However, they don't support anything that uses Win2D yet as Win2D doesn't yet support WinUI. We've been talking to the Win2D team about this. @lhak that's a great investigation! 🎉🎉🎉 Thanks for driving the discussion by taking such a detailed look at the problems! |
I have updated the code to work with preview 2. The generated nuget package now also includes the projection for c# desktop projects. The other issues listed above still remain unchanged. |
@lhak Are you saying that win2d would work on c# desktop? Wholy macarony, that would be insaaaaaaaaaaaaaaaaneeeeeeeeeeeee |
@jtorjo win2d is definitely usable in XAML islands today and has been for quite some time. This is just an (incomplete) port to winui 3 (win32 and UWP). |
@lhak Using it from XAML islands is useless to me. I have insanely complicated code, and testing is very very complicated from within UWP as is, so using it from XAML islands is a complete NONO for me. So long story short, i need this to work natively. |
Not sure what to add other than +1 for updating Win2D to work with WinUI for Desktop (Win32) apps. This would be monumentally-useful for our application. |
@shawnhar What is the roadmap for this? I really really need this - and I'm sure I'm far from the only one. Also, I would assume when we'll be able to use win2d with WinUI, automatically we'll also be able to use it on Desktop. |
We're working on this, but don't have an ETA yet. |
@shawnhar Thanks! Even if you don't have an ETA, do you think it would be ready within a 6-9 months timeframe? |
Please don't take this as a solid commitment, but I would expect it to be ready in that timeframe. |
@shawnhar Thanks! Looking really really forward to it! |
@lhak "I have managed to compile win2d for winui" - that is really awesome! |
Just to throw my hat in: Building on @lhak's wonderful work, I have created an unofficial NuGet package containing a WinUI 3-compatible build of Win2D. It’s named |
I know that CanvasAnimatedControl is currently unsupported in the official Win2D for Project Reunion/WinUI 3, but is there any guidance as to whether it's planned to be supported in the future? I know that @lhak you mentioned the following in your earlier port:
Any chance you can clarify what the missing method was, and whether you think Project Reunion will resolve this in the future? |
@getrou As per latest WinUI community call, UWP support is pretty much dropped. I can't say I'm surprised. However, I, and I'm sure I'm not alone - would really love to know if there's an ETA for when we could use win2d in WinUI3 Desktop -- basically without support for win2d, I can't port my app. Can we hope for an ETA? 😎 |
I believe we’ve already passed it. Look here. |
@wjk Thanks. I have to check it out. Do you know what's supported and what not? Because the docs (which are probably outdated) state that a LOT of the important classes (such as, |
No clue, I’m afraid. I just know it exists. 😦 |
Hehe, I was aware of it for a while, but I just know it's incomplete. I'll have to test it out at some point. |
In light of WinUI roadmap, the Windows.UI.Composition will become independent of UWP.
Would this mean we could actually uncouple win2d from UWP? Assuming we could use c++/WinRT from a non-UWP app, could the library be made useable from UWP/WPF alike?
Quote from microsoft/microsoft-ui-xaml#888
We know that using WinUI in desktop apps is the most interesting scenario for lots of Windows app developers. The goal is to enable using Xaml markup + WinRT APIs (via .NET or C++) as the UI for a win32/desktop app (instead of a UWP app), without needing to use Xaml Islands.
The text was updated successfully, but these errors were encountered: