31
Feature requests / Not clearing the contents of a RenderWindow after Display
« on: May 17, 2008, 10:47:24 pm »
Why is redrawing the sprites an issue? Thats part of redrawing the window and falls under what I've already mentioned.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
BOOST_FOREACH(Sprite s, vSprites)
{
s.Draw();
}
Quotesf::Image image(), mask();
You should remove the parenthesis, otherwise the compiler will think you're declaring functions.
sf::Image CreateAlphaImageWithMask(std::string aImage, std::string aMask)
{
sf::Image image(), mask();
if (image.LoadFromFile(aImage) && mask.LoadFromFile(aMask))
{
for (int i = 0; i < image.GetWidth(); ++i)
{
for(int j = 0; j < image.GetHeight(); ++j)
{
Color c(image.GetPixel(i,j));
Color m(mask.GetPixel(i,j));
c.a = m.r*0.3 + m.g*0.4 + m.b*0.3;
image.SetPixel(i,j,c);
}
}
}
return image;
}
Quote from: "workmad3"If you really want to, create an invisible view and draw your images to it right after loading them to force them into OGL
Calling Bind() would be enough