# SFML RectangleShape won't render

I have a sf::RectangleShape in my code which is defined like this :

sf::RectangleShape shape_1;


And it's values are set like this :

shape_1.setFillColor(sf::Color::White);
shape_1.setPosition(10, 10);


But when I render it like this :

    window.draw(shape_1);


It wont display in my window.

My rendering part of the code looks like this :

    window.clear();

window.draw(*box.getSfShape());
window.draw(*box_static.getSfShape());
window.draw(shape_1);

window.display();


Not sure what I'm doing wrong. Have been going on for days thinking it was a position problem with a body but since this won't render either it can't be. :P

• You'll have to show more code. Where do you set the shape's dimensions? Do you set them at all? The code you're showing looks fine as far as I can tell. – Mario Dec 20 '15 at 21:25

shape_1.setSize(sf::Vector2f(100.f, 100.f));