SFML community forums
General => Feature requests => Topic started by: Chiller on December 12, 2012, 10:10:31 am
-
I found the VertexArray to be a pretty useful class. However, it lacks a way to delete individual vertices in the middle of the array, short of performing a full copy. Since I built my own SFML libs, I've edited an erase() method in, but I see no reason it shouldn't have been there in the first place. (It could be solved via inheritance, except it's not possible to inherit from most SFML classes in any useful way because member data is predominantly private).
-
sf::VertexArray is only a light wrapper for std::vector<sf::Vertex> and there's no reason to implement everything std::vector provides, thus if you want some special function you better just use a vector directly, but keep in mind that erase() isn't the lightest operation on a vector. ;)
-
Yeah you're right, it's pretty simple (just looked at the full code, I thought it would be a bit more complex). Still, it does more things than a naked vector. I guess it doesn't really matter.
-
Only thing it does that vector doesn't is draw.
http://en.sfml-dev.org/forums/index.php?topic=9169.msg62009#msg62009