So instead of using an array to hold vertices information use a struct instead. Is this possible, does the Idirect3dvertexbuffer allow it?
|
Yes, you can. You can also use structs containing arrays, or arrays containing structs. All D3D expects is a pointer to a block of data, formatted according to the specifications you provide it when you create the associated vertex declaration, and containing information of the appropriate type. If your structures, or arrays, or whatnot provide that, then D3D will accept them regardless of the representation you chose for them in your code. |
|||
|
Technically, it's oblivious to whether you are using a struct or an array, it's just dealing with a pointer to a regular set of data. Structs and arrays are compiler constructs, and the DirectX logic is agnostic to the compiler that produced the data it's being fed - however I too am curious why you would use a struct - much larger chance you might get data organization messed up |
|||||
|