Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SharpDX 2.5 in DirectX11 in WPF

I'm trying to implement DirectX 11 using SharpDX 2.5 into WPF. Sadly http://directx4wpf.codeplex.com/ and http://sharpdxwpf.codeplex.com/ don't work properly with SharpDX 2.5. I was also not able to port the WPFHost DX10 sample to DX11 and the full code package of this example is down: http://www.indiedev.de/wiki/DirectX_in_WPF_integrieren

Can someone suggest another way of implementing?

like image 817
martinyyyy Avatar asked Sep 20 '13 08:09

martinyyyy


1 Answers

SharpDX supports WPF via SharpDXElement.

Take a look in the Samples repository at the Toolkit.sln - all projects that have WPF in their name use SharpDXElement as rendering surface:

  • MiniCube.WPF - demonstrates basic SharpDX-WPF integration;
  • MiniCube.SwitchContext.WPF - demonstrates basic scenario when lifetime of the Game instance is different from the lifetime of SharpDXElement (in other words - when there is need to switch game rendering on another surface).
  • MiniCube.SwitchContext.WPF.MVVM - same as above, but more 'MVVM-way'.

Update: SharpDX.Toolkit has been deprecated and it is not maintained anymore. It is moved to a separate repository. The Toolkit samples were deleted, however I changed the link to a changeset where they are still present.

like image 138
Artiom Ciumac Avatar answered Oct 06 '22 01:10

Artiom Ciumac