Skip to content

Instantly share code, notes, and snippets.

@MartinBspheroid
Created October 14, 2013 09:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MartinBspheroid/6972937 to your computer and use it in GitHub Desktop.
Save MartinBspheroid/6972937 to your computer and use it in GitHub Desktop.
Vector array for particle systems etc.
for(vector<bloomPop>::iterator it = bloomPool.begin(); it != bloomPool.end();){ // loop through vector with iterator
it->update(); // update all objects in vector
if(it->time < 0){ /// if condition matches...
it = bloomPool.erase(it); // ..go to hell..
}else{
++it; // ..or keep counting and continue!
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment