Say I have an object and whenever it moves I want a continuous trail to appear behind it. The trail should never disappear but rather be persistent.
How would I draw such a trail? I thought about using sf::VertexArray and use lines and always append points or lines based on the distance moved...
Then I read the documentation and it says points and lines can only be 1 pixel thick, but I need the trail thickness to be bigger than 1 pixel (customizable).
What sf::PrimitiveType should I use, and is a vertex array even the right choice to solve this problem?
I also thought about using a vector and add rectangles but that doesn't seem as good, plus the trail generation should be smooth.
Edit:
sf::VertexArray vertices;
vertices.setPrimitiveType(sf::PrimitiveType::LinesStrip);
// dynamically append...
vertices.append(sf::Vertex(sf::Vector2f(10.0f, 10.0f)));
vertices.append(sf::Vertex(sf::Vector2f(20.0f, 20.0f)));
vertices.append(sf::Vertex(sf::Vector2f(30.0f, 20.0f)));
vertices.append(sf::Vertex(sf::Vector2f(40.0f, 30.0f)));
// ...
window->draw(vertices);
seems to be pretty good, except the line's thickness is only 1 pixel