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

Author Topic: Gradient Class in SFML 2.0  (Read 1965 times)

0 Members and 1 Guest are viewing this topic.

Roose Bolton of the Dreadfort

  • Full Member
  • ***
  • Posts: 113
  • Full-time Procrastinator, Part-time programmer.
    • View Profile
    • Personal Portfolio/Website/Blog
Gradient Class in SFML 2.0
« 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 :(
Trying so very hard to finish at-least one project.

Watch out for the RAII police, they will get you.

www.bantersaurus-games.com

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Gradient Class in SFML 2.0
« Reply #1 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>
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development: