Hello everyone!
I am creating my first game in SFML and I am curious about one sentence in the sprite tutorial:
changing the current texture is an expensive operation for the graphics card
Now, I have a drawing engine class, which contains a vector of textures (I use different textures for images with different subimage size to make picking subimage easier for me) and it has a Draw() function which other objects can call and it will create a new sprite, assign it one of the textures, cut out the rectangle of the subimage and draw it on the window surface.
Now I wonder if the setTexture() function causes the operation of which the tutorial speaks (changing the current texture)... and if I should rather predefine sprites and assign a texture to them in advance. Or is my approach ok and not too resource-wasting?
Thank you for your time~