email sol follow sol rss feed of the blog wishlist Sol::Tutorials

Sol's dirty DX7 tutorial

Update 2010:

This tutorial is pretty much outdated nowadays. It was, like the windows programming tutorial was, aimed at folks moving from DOS to windows. Still, I'll keep it around in case someone finds it useful.

Welcome

This tutorial is aimed to those people who have toyed with (non-accelerated) 3d before, and want a quick and dirty way to get some of that 3d acceleration magic going. It's preferred that you already have an engine to plug stuff in, but this is not mandatory.

Although the title says 'dx7' tutorial it's more d3dx tutorial.. the title also says 'dirty'. This is not the correct way to use DX, as you will not benefit from (most of) dx driver's optimizations or hardware transformation and lighting and other cool new things that seem to be appearing every 6 months.

Although this is "wrong" way of doing things it works, and you just might learn some insights of how things are done in the dx world. I've never tried glide and I only scratched the opengl surface (resulting in a box that was rendered in a window, but when I moved the window, the image stayed in place..). People say DX is the hardest of the three to learn, but I believe that the hard stuff to consume is in fact windows and COM architecture, not DX itself.

No, I do not get any money for saying this (if I did, I would already be rich enough to let someone write this for me), but if you're serious about DX you should go and buy "Inside DirectX". It's a good book. It doesn't talk about d3d though, but explains the logic behind directx (yes, believe it or not, there is logic there somewhere). There's also "Inside Direct3D" but I haven't read it and I've heard some bad things about it's author's earlier works. So check book reviews before hopping in.

I thought about writing a simple tutorial back when I was learning DX5 the hard way (sdk only), but now that DX7 is out, and especially since D3D7X is out (don't you just love these abbrevations?) it's almost trivial to do this little tutorial..

We'll go through initialization, putting in some polys, wrapping vertices in a vertexbuffer, and adding textures. I'd love to tell you about blending modes (transparencies) but I haven't grasped them totally myself. Just about every aspect in DX varies between 3d accelerators (partially since microsoft did such a loose spec and partially since 3d accelerator drivers suck), and blending modes are the bit that varies the most. Someone calculated that there's about 4 million combinations of the blend variables, so I'm not amazed.

The code within is not meant to be an example of perfect windows programming, or any programming. But you know that.

Enough of warnings and disclaimers. Let's move onwards..

Site design & Copyright © 2017 Jari Komppa
Possibly modified around: April 26 2010