Geeks With Blogs
Blair's Burnt Offerings My weblog about .NET and other worldly things

This month I have been working hard at providing XNA support for the Micro Framework.  Sometimes I wonder how I get myself into these things.

I entered another contest, Dream, Build, Play, where you or a team write a game for some cool prizes.  When I was reading through the XNA documentation and I was thinking that the paradigm of writing games fits some embedded projects a lot better than WPF that the Micro Framework is using now.  Perhaps not for all applications, but for my project is felt like it did.  Which brings me to this video of the Platform Starter Kit running in the Microsoft Emulator included with the Micro Framework:

As you can see, it is a little slow, running in the neighbourhood of about 10fps, but it is running.  Also, a limitation in the Micro Framework did not allow me to support the flip sprite effect, so the characters do the moon walk if moving left to right.  This can be fixed in the game itself by providing more graphics (but as I explain below I was getting tired editing images).  I had to stop the gems from bouncing to help the frame rate as well.  This XNA port only includes 2D graphics (and that part of the content pipeline) and input.

The porting of the game was not too bad, as I tried to stay true to the XNA API and the Grommet library handled some missing functionality in MF.  The biggest changes involve the content pipeline since XNA and the Micro Framework handle resources very differently.   I could have matched the XNA API a little closer, but I was unable to reflect enum field names, and I am starting to believe that they are stripped out before deployment. 

Another area that caused some serious tedious work is that the Micro Framework does not support alpha channels.  To get around this, I had to use Paint.NET to load each PNG, paint in magenta for the transparent parts and save out again as a GIF image.

If this was more than just a test application I would have spend more time optimising and cleaning it up.  I really do need to get back to the Dare to Dream Different Challenge.

OK, back to why I did this in the first place:  to see if XNA was viable for a user interface on the Micro Framework.  I hope this video shows that it is.  My next step is to get the screen management sample working, and use that as a basis for my clock/radio/RSS feed reader that I have been blogging about. I truly believe that if Micro Framework team wanted to support XNA, they could get much better frame rates than I can in straight managed code.

The source for this is available as part of Grommet, and this project can be found on Codeplex:

http://grommet.codeplex.com

Blair.

Posted on Tuesday, April 28, 2009 11:00 PM | Back to top


Comments on this post: XNA on the Micro Framework? Well, a start…

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Blair Leduc | Powered by: GeeksWithBlogs.net