Adapted to newwest SFML