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

Author Topic: sf::Shader::CurrentTexture and texture rects  (Read 1416 times)

0 Members and 1 Guest are viewing this topic.

mashedtatoes

  • Newbie
  • *
  • Posts: 23
    • View Profile
sf::Shader::CurrentTexture and texture rects
« on: October 23, 2014, 11:42:36 pm »
For example take a sprite sheet. It is not exactly what I am doing but similar. Lets say you set the texture rect  to the first frame in the animation. When you use sf::Shader::CurrentTexture to set the parameter in the shader code, is this current texture the entire sprite sheet or is it just the part of the texture within the texture rect?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: sf::Shader::CurrentTexture and texture rects
« Reply #1 on: October 24, 2014, 07:51:22 am »
It's always the entire texture. It's the set of texture coordinates that change according to the texture rect.
Laurent Gomila - SFML developer

mashedtatoes

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: sf::Shader::CurrentTexture and texture rects
« Reply #2 on: October 25, 2014, 02:50:21 am »
Now i have to either figure out how to make my shader work on just part of the texture or scrap the big texture and generate new textures as my objects are created. Thanks for the info :).