Quote:Original post by Zahlman
struct LODIndexPair { DWORD Std, Mod;};
Struct of arrays might actually be desirable in this case - it depends on actual algorithm.
While vector is one solution, it might actually be advantageous to not use them in this case (excluding the typical implementation bugs).
IMHO, if this is pre-calculation step and these structures will not change later (but geometry may be in use a lot), I would determine all array sizes in advance, then allocate a single array big enough to hold everything, then resolve the pointers into that array.
This however is a process which could be conveniently wrapped into a class to take care of not only the process, but also allocation issues.
It's also possible that a more optimal representation exists. For example, indicesLODStd and indicesLODMod contain identical values.
This is one of those problems where YMMV.