IDirect3DSurface/CanvasBitmap support? #227
-
I'm using Vortice with SwapChainPanels in WinUI 3 - it's working great, thank you so much! I have a texture that lives as a ID3D11Texture2D and gets manipulated on a per-frame basis by Win2D (as a ID2D1Bitmap). I want that texture to also appear in my XAML UI. So I would like to use CanvasBitmap.CreateFromDirect3D11Surface, which takes a IDirect3DSurface. Then I can use that bitmap to draw into a CanvasControl as part of my XAML tree. To get the IDirect3DSurface, I believe I need to first get an IDXGISurface from the ID3D11Texture2D. That part works within Vortice and it's fine. But I get confused as to how to get a IDirect3DSurface from the IDXGISurface. The docs says I need to call CreateDirect3DSurface (or possibly CreateDirect3D11SurfaceFromDXGISurface) as defined in windows.graphics.directx.direct3d11.interop.h. These functions don't seem to be available from managed code. Should I be looking at calling those functions directly via DllImport? Or is that something that Vortice could make available? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 12 replies
-
Hi, Tell me if it works so I can bump new nuget beta release. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Share compilable project with me please? |
Beta Was this translation helpful? Give feedback.
-
Got it, makes sense; it does point to something being incompatible with WinUI. I will try to find out if this scenario is supported yet, and even if it's not yet supported I now have the APIs from Vortice to make it work when it does. Thank you for all your help! |
Beta Was this translation helpful? Give feedback.
Share compilable project with me please?