This is an efficiency question. I am going to have say 100 to 200 3D models, each an instance of a Model class. How should I store them, as a map of the actual instances or as a map of pointers to the models, where each one has been allocated it's own space on the heap?
So either:
ORCode:map<int, Model> models;
If the map contains the actual models, then when I create them it will need to copy each model into the data structure after creating, possibly with a temporary in between which might take a long time. Is it bad to have them scattered all over memory in different places?Code:map<int, Model*> models;



LinkBack URL
About LinkBacks


