Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use MonoGame in WPF

Can I mix MonoGame with XAML in WPF appliaction? For example: core of game written in MonoGame, but UI written in XAML and placed on top of MonoGame-Canvas. I know that I can use XAML on MonoGame in WinRT. Can I do same things in WPF?

like image 970
AndreyAkinshin Avatar asked Sep 18 '12 13:09

AndreyAkinshin


2 Answers

You should read Nick Gravelyn's blog post: http://blogs.msdn.com/b/nicgrave/archive/2010/07/25/rendering-with-xna-framework-4-0-inside-of-a-wpf-application.aspx

That should work for MonoGame as well, except for the last part that uses the content build pipeline as MonoGame does not yet have its own content build pipeline implementation.

You can find some samples here: https://github.com/CartBlanche/MonoGame-Samples

like image 135
AndreyAkinshin Avatar answered Oct 08 '22 12:10

AndreyAkinshin


MonoGame 3.2 supports WPF/DirectX interop now. http://www.monogame.net/2014/04/07/monogame-3-2/

like image 24
kbo4sho88 Avatar answered Oct 08 '22 11:10

kbo4sho88