Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - mSamyel

Pages: [1]
1
Graphics / Re: Expensiveness of changing texture
« on: January 26, 2014, 08:33:55 am »
Understood :) Thank you very much!

2
Graphics / Expensiveness of changing the texture [solved]
« on: January 25, 2014, 10:05:15 pm »
Hello everyone!

I am creating my first game in SFML and I am curious about one sentence in the sprite tutorial:
Quote
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~

Pages: [1]
anything