February 22, 2005

Managed DirectX Part 1

There were times when DirectDraw was ideal. You've got some sprites that you're trying to move across the screen, blitting out a font, stuff like that.

Now, I use Direct3D for those things. It's funny seeing exactly how much code is involved in just making a simple textured quad move across the screen, however.

The worst part of using Managed Direct3D is the exceptions. There's nothing quite as obnoxious as getting an "Error in the application" exception on one line, when the actual error occured dozens or hundreds of lines prior. The documentation is no help, because most of the docs say the exact same thing that pops up in the tooltip in Visual Studio.

So this one goes out to Tom Miller. Thank you very much for making Managed DirectX. However, we now need the documentation and error messages brought up to speed in order to make MDX a first-class .NET citizen instead of a second-class abstraction layer.

If there is an error in a parameter, tell us what parameter instead of throwing an InvalidCallException. Instead of throwing up a generic "Error in the application" exception, give us details.

At least to me, the miniscule performance hit that I'd encounter from doing extra parameter checks is worth the increase in productivity that I'd derive from having decent debugging information.

1 comment:

Anonymous said...

word