Since I found out about blending in sfml. I decided to put it to the test with a little program that represents a flashlight.
while(1)
{
while(window.GetEvent(event))
{
if(event.Type == sf::Event::Closed)
{
window.Close();
}
}
window.Clear();
sf::Shape hidden = sf::Shape::Rectangle(0,0,100,100,sf::Color(255,0,0,0));
hidden.SetBlendMode(sf::Blend::Add);
sf::Shape circ = sf::Shape::Circle(window.GetInput().GetMouseX(),window.GetInput().GetMouseY(), 40,sf::Color(255,255,255,100));
window.Draw(circ);
window.Draw(hidden);
window.Display();
}
I thought the Blend Mode, Add, would add the alpha of the hidden box, (0), to the alpha of the circle, (100). Wouldn't it?