This is an amazing effect, when I compiled it on my system(minigw on windows) I could not get it to run...
after applying the following "fix"
void Starfield::drawStarfield(sf::Texture& p_Texture)
{
for(vector<Star>::iterator it = smallStars.begin(); it != smallStars.end(); ++it){
if(it->getYPos() < 600)
p_Texture.update(smallStarImage, it->getXPos(), it->getYPos());
}
for(vector<Star>::iterator it = mediumStars.begin(); it != mediumStars.end(); ++it){
if(it->getYPos() < 599)
p_Texture.update(mediumStarImage, it->getXPos(), it->getYPos());
}
for(vector<Star>::iterator it = largeStars.begin(); it != largeStars.end(); ++it){
if(it->getYPos() < 597)
p_Texture.update(largeStarImage, it->getXPos(), it->getYPos());
}
}
if I compiled several times it might run 1/5 times without an immediate crash but then would crash 2 seconds later but the program ran successfully in these 2 seconds.. also applying the other fix mentioned had no effect.