I am using Windows XP, SFML2, revision 1279
I have an sf::Image manager, and it loads well. But when I try to use a sf::Sprite, it is not well drawn, but well saved to file!
// Load is called once
void Scene::load()
{
marker_sprite.SetImage(*game.resource["data/image/marker.bmp"]);
marker_sprite.GetImage()->SaveToFile("marker.bmp"); // The file is saved ok
}
// Draw is called every frame
void Scene::draw()
{
game.window.Draw(marker_sprite); // Sprite just draws a white square
// If I try to save the image in this scope, the image is saved ok
marker_sprite.GetImage()->SaveToFile("marker2.bmp");
}
// To make sure that my stored image is not deleted, I save the image when I close the window
void Scene::closed()
{
marker_sprite.GetImage()->SaveToFIle("marker3.bmp");
}
All three saved bmp's are OK! I don't understand why it draws a white square.
If I use a sf::Image stored in my Scene class it works.
I think it's not my fault because I can save the images correctly :-S