opentk / GLWpfControl

A fast native control for OpenTK 4.x + 3.x on WPF.
MIT License
194 stars 48 forks source link

WinUI 3/.Net5 Support #54

Open AkshayFT opened 3 years ago

AkshayFT commented 3 years ago

I'm developing a windows application using WinUI3 and .Net5.0. Unable to use this control. Are there any alternatives available or should link any WPF related dlls?

PhilPJL commented 2 years ago

WinUI 3 support gets my vote. I've currently taken on an aging WinForms app that uses GLControl 3.x. Would be nice to start investigating migration to WinUI but without this not much point.

NogginBops commented 2 years ago

What doesn't work? What are the symptoms? Are there any error messages?

PhilPJL commented 2 years ago

Are you saying that the GLWpfControl should work in WinUI3? If so then that's good and I'll give it a try. I was assuming perhaps incorrectly that WinUI3 needs specific controls.

NogginBops commented 2 years ago

I don't know much about WinUI3, but it did look like you could use WPF control in it. But maybe I'm mistaken.

PhilPJL commented 2 years ago

Unfortunately you can't https://github.com/microsoft/microsoft-ui-xaml/issues/5866 You can embed WPF in WinForms and vice-versa, and apparently Xaml islands are planned to allow embedding WinUI in WPF, but not the other way around. I assume a WinUI version of GLControl will therefore be useful.

JuandreG commented 1 year ago

Any news on this?

a GLControl for WinUI would be awesome.

NogginBops commented 1 year ago

WinUI doesn't allow you to create an OpenGL context, not sure if there are any workarounds for this. Maybe there is, but I don't know of one.

malstraem commented 1 year ago

Interoperability possible using WGL_NV_DX_interop2 that widely supported.

NogginBops commented 1 year ago

Interoperability possible using WGL_NV_DX_interop2 that widely supported.

My understanding was that even creating an OpenGL context isn't possible in WinUI 3? But I haven't really looked into it so idk any details.

malstraem commented 1 year ago

@NogginBops

creating an OpenGL context isn't possible in WinUI 3

Same as for WPF 🤓

In any case you need to implement the interaction between OpenGL and DirectX. With WinUI you need to get render target from SwapChainPanel and create OpenGL framebuffer using upper mentioned extension.