That's right, you confuse D3DMATRIX and D3DXMATRIX (note the extra X in the second type). The first is a simple matrix of 16 float values ββ(exactly 64 bytes). The latter is a class, and it obviously has 4 bytes of extra data somewhere in the structure. Perhaps vtable or some such.
If you compile the code as C, not C ++, the size will be the same as the header file containing the last of the structures, and then typedef D3DMATRIX D3DXMATRIX; .
See: D3DXMATRIX and D3DMATRIX
Edit: This is a bit like an old joke about war words: "If the map and reality do not match, the map is correct." In this case, if you do not agree with the compiler, you are mistaken. When calculating sizes, the compiler is ALWAYS ALWAYS. Understanding WHY the compiler got this number, well, thatβs another matter ... Usually they are solved by comparing the expected displacements in the structure with what is actually happening, and understanding that if something caused βgapsβ.
source share