Hi everyone.
I just switched to SFML 2.0 (SVN from today) and found some strange behaviour, as the following code shows:
#include <SFML/Graphics.hpp>
int main() {
if (!sf::RenderImage::IsAvailable())
return -1;
sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
sf::RenderImage image;
if (!image.Create(500, 500))
return -1;
sf::Sprite sprite(image.GetImage());
//window.Draw(sprite);//Uncomment to make it work as expected
image.Clear(sf::Color::Red);
while (window.IsOpened()) {
window.Clear();
window.Draw(sprite);
window.Display();
}
}
Using this code, the image will be shown black though it's been filled red before. If it's drawn onto the screen once before filling, it's red as expected.
If this is a bug, this is the report, if it's a feature, I'd like to know more about it.
Jo