SFML community forums

Help => General => Topic started by: Roose Bolton of the Dreadfort on November 30, 2012, 06:04:24 pm

Title: Gradient Class in SFML 2.0
Post by: Roose Bolton of the Dreadfort on November 30, 2012, 06:04:24 pm
Been following this tutorial http://www.sfml-dev.org/wiki/en/sources/gradientcolor

but its for a different version, i've been trying to convert it but to no avail.. does anyone have a 2.0 version of it that can kindly share :(
Title: Re: Gradient Class in SFML 2.0
Post by: Nexus on November 30, 2012, 06:54:22 pm
Where did you get stuck when converting? Note that sf::Image has been split into sf::Image and sf::Texture.

Apart from that, the code of your tutorial is quite questionable, maybe you should rewrite your own or take parts of it ;)
#define ABS(a) ((a>0)?(a):0)

ColorScale::const_iterator start = std::map<double,sf::Color>::begin();
ColorScale::const_iterator last  = std::map<double,sf::Color>::end();

class ColorScale : protected std::map<double,sf::Color>