Hmm... I was under the impression that that would have also taken a const reference... This might have been left this way for historical reasons, no idea.
This syntax makes it easier to do what you almost always do with the render-states.
void MyDrawable::draw(sf::RenderTarget& target, sf::RenderStates states) const
{
states.transform *= getTransform();
target.draw(child, states);
}
// vs...
void MyDrawable::draw(sf::RenderTarget& target, const sf::RenderStates& states) const
{
sf::RenderStates newStates(states); // you have to find another name, where 'states' is so intuitive
newStates.transform *= getTransform();
target.draw(child, newStates); // beware, don't use 'states' :)
}
Taking this into consideration, if you really have to call setParameter() inside your draw() function, you will have to make the shader object (which I assume is stored inside gui::Button) mutable.
The draw function is const on purpose. Updating parameters should really be done in an update function.