Sunday, February 19, 2012

D3D11 Porting

The hardest part of any port is right at the beginning. You're ripping apart old code, shoving in new code, and hoping and praying that the two are going to coexist peacefully. You have just so much to do before you can even get some kind of image on the screen that confirms that things are at least working. Those first scary few hours when you get the fear - "am I completely insane to be even thinking about doing this?" - are the worst by far.

Once video startup is done, 2D drawing is always the next thing I pick on because it's simple. There are just two main routines you need to do - Draw_Pic and Draw_Character. You can get away with an ultra-simple texture loader that needn't handle mipmaps or other special cases. Transforms and states needed are simple. There's no dynamic texture updating to fret over. Easy as pie, and at this stage the less you have to worry about the better.

After that I like to move on to the world. It's slightly more complex and involved, but it gives a solid background to build everything else on. So that's where I am right now.



Yes, it's ugly, yes, there is a lot of stuff missing still, but it's an image on the screen that is in line with what I expected, and that's important.

No comments: