Hello! I want to draw an image on user's screen, but I don't want to create objects sf::Texture and sf::Sprite for it because with these method I need a lot of textures and sprites. I want to do it like:
window.draw(sf::Image(x, y, way));
Hello! I want to draw an image on user's screen, but I don't want to create objects sf::Texture and sf::Sprite for it because with these method I need a lot of textures and sprites. I want to do it like:
window.draw(sf::Image(x, y, way));
It sounds to me like maybe you mean progressively drawing onto the screen, like a painting program (hence the lots of sprites). If that's the case, have a look at render textures.
A render texture is created in code and can act like a window, you draw sprites into it. But whatever you draw into it will be preserved as part of the texture. You can then draw the render texture into a window just like a normal texture. Good for things like leaving trails, user controlled drawing, etc.
https://www.sfml-dev.org/tutorials/2.5/graphics-draw.php#off-screen-drawing