The following code does not works :
Your minimal example is not complete:
#include <SFML/Graphics.hpp>
int main()
{
sf::Image imageFadePlay;
sf::Sprite spritePlay;
sf::Vector2f position(20.f, 20.f);
float m_scale = 1.f;
if(!imageFadePlay.LoadFromFile("images/nouvellePartie_fade.png"))
{
// This error message is actually not needed since SFML will print it's error message
std::cerr << "Image loading failed : nouvellePartie_fade.png" << std::endl;
}
else
{
spritePlay.SetImage(imageFadePlay);
spritePlay.SetPosition(position);
spritePlay.Scale(m_scale);
}
return 0;
}
Also this corrected version will not work on all systems. Under linux there's a known bug that doesn't let you do graphic stuff if you haven't initialized a
sf::Window/
sf::RenderWindow.
Although I'm not sure if this is also true for SFML 1.6.
I really advice to update to SFML 2rc. It will soon be the standard and 1.6 has many unresolved bugs and will not run with ATI graphic cards if it's linked dynamicly.