UWP and DirectX

I have a task:

'The second component should be written in C ++ and should be the UWP assembly / component that will be used by the first part of the task. It must be a DirectX component that accesses SwapChain with a transparent background. The content should be a 2D animation that should be tied to the current position of the mouse. Content must be managed using a set of public methods.

The DirectX component must be placed on top of your C # GUI, so it will act as an overlay. Make it a transparent overlay, it should not capture any GUI events and otherwise interfere with the C # application. Use a C # host to send mouse events and change content to the DX layer. ''

But I do not know how to combine UWP and DirectX. I already have a part of the UWP C # application and what next?

I would be grateful for any answers and ideas.

+6
source share
2 answers

You need to include the SwapChainPanel or SwapChainBackgroundPanel control in your XAML file. This surface will be used to draw your DirectX content. You have a default uwp sample in a Visual C ++ Template named DirectX 11 and the XAML App. This may help you understand the plumbing, but this solution has only C ++ code.

+1
source

MonoGame!

This is an XNA4-based gaming environment that runs on UWP, among many other platforms. You can select samples to find out what you need.

http://www.monogame.net/

+1
source

All Articles