I'm looking at a new approach for rendering stuff where basically I have this std::vector of renderables. At some point renderables are added to the vector and when it comes time to draw they're sorted and drawn. But I have a few fuzzy parts:
1. I know there is std::sort function where you can give a compare function, but its signature wants a bool. So what happens if the 2 objects I'm comparing are considered equal? I know in other languages they return 1 for greater then, 0 for equal, and -1 for less then
2. What's best/quickest way to remove a specific item from my std::vector<Renderables*>? Would it be better to have a map since I want to remove specific items? How would this effect sorting and traversing the map if this is the case?
↧