Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UWP and DirectX

I have a task:

'Second component must be written in C++ and must be a UWP assembly/component that will be used by the First part of the task. It must be a DirectX component that draws to SwapChain with transparent background. The content must be a 2D animation that must be bound to current mouse position. The content must be controllable via set of public methods.

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

But I have no idea how to combine UWP and DirectX. I already have functioning UWP C# app part and what's next?

I'll be grateful for any responces and ideas.

like image 935
Katerina Avatar asked Apr 25 '16 12:04

Katerina


2 Answers

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

like image 130
Jean-Sébastien Dupuy Avatar answered Sep 19 '22 16:09

Jean-Sébastien Dupuy


MonoGame!

It's a game framework, based on XNA4 that works on UWP, among a myriad of other platforms. You can pick apart the samples to learn what you need.

http://www.monogame.net/

like image 28
Jarryd Avatar answered Sep 16 '22 16:09

Jarryd