Shortly, I don't really understeand how does it works.
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(600, 400), "Tilemap");
sf::RenderTexture render;
render.create(600, 400);
sf::RectangleShape rect(sf::Vector2f(200,50));
rect.setFillColor(sf::Color::Red);
render.draw(rect);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear(sf::Color::White);
render.display();
window.display();
}
return 0;
}
What I do wrong?