You can do this:
class MyRectangle : public sf::Drawable, public sf::Transformable
{
public:
void SetPointPosition(unsigned int i, const sf::Vector2f& position)
{
myVertices[i].Position = position;
}
void SetPointColor(unsigned int i, const sf::Color& color)
{
myVertices[i].Color = color;
}
...
private:
virtual void Draw(sf::RenderTarget& target, sf::RenderStates states) const
{
states.Transform *= GetTransform();
target.Draw(myVertices, 4, sf::Quads, states);
}
sf::Vertex myVertices[4];
};
MyRectangle rect;
rect.SetPointPosition(...);
rect.SetPointColor(...);
...
window.Draw(rect);