WinQuakeCon

I’ve always wanted a program that would allow me have a command line that I could slide in and out of view as needed like the console from Quake. I never could find one and so I finally got decided to write a tool myself. A picture is below and the source code is on GitHub.

I’m not putting a download here as I don’t consider this finished just yet.

What is Snowball and what do I want to do with it?

I originally got the idea for Snowball after working with the Xna Framework. The Xna Framework is a good piece of software for what it is but there are some things about which I just do not agree with:

  • The content pipeline only works with content in the serialized .xnb format.
  • There are certain content types which can only be loaded via the content pipeline.
  • Certain features don’t exist on the PC because they don’t exist on the XBox or Windows Phone 7.

Xna was designed as an abstraction layer for all the 3 platforms mentioned in the last point, so that one is somewhat understandable. I don’t want to write games for my XBox right now though, so why should things like drawing lines not be available to me?

With these points in mind I started working on Snowball. It’s designed to be an Xna like framework for making 2D games. It uses SlimDX on the backend, but that is completely abstracted away from consumers of the framework. What I want to do is design the API so that the backend can be swapped out somewhat painlessly.

I still have a ways to go before I will consider it a version 1.0 release. As of this writing, I’m transitioning to more of a ContentLoader class style for loading your game’s content. Any resource type from within the framework can be loaded by hand if you want, the ContentLoader class will just make it easier. After that I have a few other features like GamePad and Music which I would like to implement before saying I have a Beta type release.

The future after that is up in the air. I would love to try and have different implementations of the API for Xna and/or OpenTK.

I recommend for anyone who is interested as to why an API designer choose to implement the API in the way they did to try it for themselves. I have learned many things from this project including why certain design decisions were made by the Xna Framework team.

Zune Playlist / SMIL Copier

I needed a tool that would copy the contents of a Zune playlist to a given directory. I did a bit of googling and I couldn’t find anything, so like any good nerd I wrote a tool that did.

SMILCopier

The format of Zune playlists is a simple XML format known as SMIL. I think Windows Media Player also stores playlists in this format but I haven’t confirmed that yet.

I wrote the tool very quickly and have only tested it on my machine with my test data, but I’ll provide the source if you’d like to modify for yourself. The source is C#.

Download Executable
Download Source

Xna: Load Texture2D from Embedded Resource

If you’re writing an app which uses Xna, you may need to load a texture from an embedded resource. Here’s how:

First embed the resource in your app. Do so by choosing Embedded Resource as the Build Action in the properties of the resource.

Properties Dialog for a File

After that you can load the Texture2D using a stream handle to the embedded file.

Stream stream = Assembly.GetCallingAssembly().GetManifestResourceStream("AppNamespace.Folder.font.bmp");
return Texture2D.FromFile(graphicsDevice, stream);

GetCallingAssembly() can be exchanged with GetExecutingAssembly() if needed. The name of the resource must be fully qualified with the app’s namespace and folders. I usually keep my resources in a folder Resources so I would have: AppNamespace.Resources.font.bmp.