I don't know why people want to keep their code structure, namespaces etc. in minimal codes
Here is what I ended up with after 30 sec:
#include <iostream>
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(800, 600), "test");
sf::Shape canvas = sf::Shape::Rectangle(100, 100, 400, 400, sf::Color::White, 5, sf::Color::White);
canvas.EnableFill(false);
canvas.EnableOutline(true);
canvas.SetPosition(100, 100);
sf::String text;
text.SetPosition(100, 100);
text.SetText("Text String");
while (window.IsOpened())
{
window.Clear();
window.Draw(canvas);
window.Draw(text);
window.Display();
}
return 0;
}
But I'm just quibbling, your code was good enough, thank you
Now the error: you put your rectangle's geometry at 100,100, and then you move this geometry to 100,100: the geometry ends up at 200,200. The position of the shape's points is not the global position that you set with SetPosition. They are combined.