Skip to content
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

Bring win2d to WPF #97

Open
lindexi opened this issue Dec 6, 2018 · 10 comments
Open

Bring win2d to WPF #97

lindexi opened this issue Dec 6, 2018 · 10 comments
Labels
Design Discussion Ongoing discussion about design without consensus
Milestone

Comments

@lindexi
Copy link
Member

lindexi commented Dec 6, 2018

Win2D is an easy-to-use Windows Runtime API for immediate mode 2D graphics rendering with GPU acceleration.

Can we bring win2d to WPF?

@fabiant3-zz fabiant3-zz added the Design Discussion Ongoing discussion about design without consensus label Dec 6, 2018
@fabiant3-zz fabiant3-zz added this to the Future milestone Dec 6, 2018
@petroemil
Copy link

I think this could only be an option once the Extensible rendering pipeline ( #85 ) is implemented

@legistek
Copy link

legistek commented Dec 6, 2018

Maybe even DirectComposition (although it would kill Win7 support).

@dotMorten
Copy link
Contributor

although it would kill Win7 support
Could be an opt-in feature - ie if you want to use it, Win7 is explicitly dropped, And Win7 support only have about a year left. DirectComposition support / SwapChainPanel has been my biggest ask for WPF for years. D3DImage is absolutely horrendous for high DX rendering performance.

@legistek
Copy link

legistek commented Dec 6, 2018

See that's another great reason to go with #85 because then moving between D3D, D2D, DirectComposition, whatever, would be really easy.

Oh and hear hear on D3DImage being pretty awful. We have a custom video player that uses it and I can almost never get a reliable 30fps out of it. Close but never totally smooth.

@lhak
Copy link

lhak commented Dec 7, 2018

Win2d can be used today with XAML islands. Only the CanvasSwapChainPanel controls works at the moment, but the other controls (e.g. CanvasControl) will probably only need minor modifications (their draw event is currently not called)

@lindexi
Copy link
Member Author

lindexi commented Dec 9, 2018

@lhak XAML islands are windows hosts like that can not add in the WPF level. See WPF and Win32 Interoperation

@lindexi
Copy link
Member Author

lindexi commented Dec 9, 2018

The WPF should use D3DImage to use D3D but Direct3D9 content hosted in a D3DImage instance does not render as fast as in a pure Direct3D application. Copying the surface and flushing the command buffer can be costly operations.

See https://docs.microsoft.com/en-us/dotnet/framework/wpf/advanced/performance-considerations-for-direct3d9-and-wpf-interoperability

@legistek
Copy link

Wondering if this is still a possibility?

Also I see #85 was summarily closed, disappointingly.

I'm really struggling at the moment to settle on the next-gen UI for the Windows-portion of my platform, which is currently WPF. I don't mean to trash on anyone's hard work, but WinUI3 is just not up to the task and I doubt it ever will be. I really want nothing to do with anything that comes from the WinRT branch on the evolutionary tree; I just think it's tainted beyond repair.

I'm seirously exploring just doing something homegrown with DirectComposition, maybe cannibalizing parts of the WPF repo.

WPF was literally the perfect UI framework for its time if you wanted to be on Windows and use .NET. Nothing that's come out of Microsoft since has been a worthy successor. Modernizing WPF would truly be the only way to reestablish that perfection.

@lindexi
Copy link
Member Author

lindexi commented Jun 16, 2023

@legistek With WindowsAppSdk, we can use win2d to WPF. But as you said, this requires the use of WinRT technology.

@legistek
Copy link

legistek commented Jun 16, 2023

Oh sure, I guess I was interpreting this issue as having wpf use win2d (or just Direct2D/Composition) as the underlying rendering engine though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Design Discussion Ongoing discussion about design without consensus
Projects
None yet
Development

No branches or pull requests

6 participants