views:

81

answers:

1

I've always wondered the reasoning behind why we must always define D3DVERTEX. Is it because Microsoft wants to allow the opportunity to put this in a class and overload operators, or is there another reason?

Thanks

+7  A: 

It's so you can use whatever is convenient for your application. If you need a normal as part of your vertex, you can have that. If you don't need a normal then you save 12 bytes per vertex. If you need colour information, texture coordinates, specular parameters and so on then you choose to define them or not depending on your specific needs.

If Microsoft were to provide a "D3DVERTEX" structure you'd either have 500 different versions, with different combinations of fields, or you'd have one enormous one that included every possible value, killing your bandwidth.

Dean Harding
Yes, see DX6! :)
gatorfax