Hey,
since a few days my SFML application stopped working. So I tried a basic setup and it also doesn't work.
#include <SFML/System/Sleep.hpp>
#include <SFML/Graphics.hpp>
int main()
{
// Create the main window
sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
sf::Texture texture;
if(!texture.loadFromFile("Data/Image/Background.png"))
return EXIT_FAILURE;
sf::Sprite bg(texture);
while(window.isOpen())
{
sf::Event event;
while(window.pollEvent(event))
{
if(event.type == sf::Event::Closed)
{
return 0;
}
}
window.draw(bg);
// sf::sleep(sf::milliseconds(5));
}
}
SFML: The latest SFML-2.0-rc from the download page. I also tried to source distribution which I compiled myself.
OS: Linux, Fedora 17
Problem: The sprite is not displayed (The window contains that what previously was at the position on the screen),
CPU usage goes up to maximum and there is a huge latency when trying to close the windows. (Up to a few minutes, therefor the sleep).
Any advice? Thanks.
Regards,
Ethon