SFML community forums
Help => Graphics => Topic started by: slotdev on June 20, 2011, 02:03:13 pm
-
Hi
When I clear my render window, I want to fill it with a colour to do some kind of effects. I leave a portion of my background image transparent, so when I set the colour of the render Clear, I should see the colour I set.
But, it's not working :(
Every frame, I do this:
myWindow.Clear(sf::Color::Green);
I see the green when I open the window first of all and clear it, but after this, it's just black! I have check my graphics and they are all OK. I am using 32 bit PNGs.
Any ideas??
-
Minimal code please ;)
-
Do you flip the buffer ? 'myWindow.Display();' ?
-
With pleasure :)
myWindow.Clear(sf::Color::Green);
myWindow.Draw(mySprite);
// Now actually show it
myWindow.Display();
As I said, I just get a black background no matter what :(
-
Laurent was looking for a minimal program that reproduces the problem.
IE: give us something that we can compile and run and see the problem for ourselves.
What you posted isn't enough, as that problem might be elsewhere in your program.
-
Sorry guys - it was my mistake all along (so what's new). I actually had 2 windows and I was clearing the wrong one! What a dunce.
Thanks anyway.