sf::VertexArray point(sf::Points, 1);
point[0] = sf::Vertex(sf::Vector2f(static_cast<float>(x), static_cast<float>(y)), mSfmlColor);
mTarget->draw(point);
sf::VertexArray is a std::vector<sf::Vertex>. It's a little overkill for one vertex
Implement it like this:
sf::Vertex point(sf::Vector2f(static_cast<float>(x), static_cast<float>(y)), mSfmlColor);
mTarget->draw(&point, 1, sf::Points);
Same for lines and rectangles.
An efficient implementation for rectangles would look like this:
// outline
sf::Vertex rect[5] =
{
sf::Vertex(sf::Vector2f(x, y), mSfmlColor),
sf::Vertex(sf::Vector2f(x + w, y), mSfmlColor),
sf::Vertex(sf::Vector2f(x + w, y + h), mSfmlColor),
sf::Vertex(sf::Vector2f(x, y + h), mSfmlColor),
sf::Vertex(sf::Vector2f(x, y), mSfmlColor)
};
mTarget->draw(rect, 5, sf::Lines);
// filled
sf::Vertex rect[4] =
{
sf::Vertex(sf::Vector2f(x, y), mSfmlColor),
sf::Vertex(sf::Vector2f(x + w, y), mSfmlColor),
sf::Vertex(sf::Vector2f(x + w, y + h), mSfmlColor),
sf::Vertex(sf::Vector2f(x, y + h), mSfmlColor)
};
mTarget->draw(rect, 4, sf::Quads);
For clipping, you're not supposed to set OpenGL states directly and expect SFML to use them. It might be broken in the future. Until clipping masks are implemented in SFML, you can use a workaround: apply a view (sf::View) whose size and viewports are both set to the clipping rectangle (remember that viewports are defined in normalized coordinates).
As a bonus, if you use a view for clipping, you can avoid applying an offset to everything which is drawn.