The other day I decided to look through some source code of other games, and I downloaded a breakout clone written using the XNA Framework. It provided the source code, and I figured that C# can’t be that different from Java or C++, so it shouldn’t be a problem. At one point I thought that maybe C# allowed you to use two different names for the same function, such as calling Run() vs defining it as BeginRun(), but then I realized that the code I was trying to find was apparently in the XNA Framework.
I almost gave up looking for the XNA Framework API since it seems to be too difficult to find, which means that the game’s source is almost impossible to follow since I can’t find a way to start running the game. Since I do all of my development on GNU/Linux, and Microsoft isn’t porting their software over anytime soon, I am left with the source code that depends on a missing API to understand. I finally found the API in MSDN, but I had to use Google to do so. Why I couldn’t just search for it with MSDN itself I have no idea. I also wish that the documentation was a bit more useful. For instance, here’s the Game method Run():
public void Run ()
That’s it. I don’t even get to see what it is calling or doing. The comment says “Starts the game”, and I have to find a completely different part of the documentation that tells me that it “starts a loop that will call Update and Draw multiple times a second until Exit is called”. So now I know what it calls and what it does, but why couldn’t the function’s page tell me?
Is it secret code or something? I guess I am just used to seeing the code of implementations, such as C++ standard libraries. I mean, I understand that I shouldn’t have to know what the implementation is doing in order to use it, but since it seems so hard to get good documentation on what the API is and how to use it, what else could I do but go to the source?
Maybe it is because I don’t have Game Studio Express or any of the Microsoft XNA-related pieces of software. I believe there are tutorials provided, and I found a few videos that seem to explain how the content-pipeline works, so it is obviously documented somewhere. Maybe search terms like “xna framework api” aren’t the ones to use?
Well, anyway, after a few hours of research, I finally found the info that I needed. Now I can look at the breakout clone’s source code and figure out how it works. At least until I hit another mysterious XNA Framework API call, that is.
By the way, I kept hearing about how great the XNA Content Pipeline is, and I concluded that it simply integrates graphics asset collection into the same program you use to edit code. It’s nice, but I was expecting more from all the noise getting generated about it. Is there something more to it that I didn’t find in my admittedly quick research?