Hello,
i have a problem with sfml 2.0!
On my pc and my laptop the cpu usage is very high (Pc: 25% / Laptop: 50%).
When i run the same project with a few changes with sfml 1.6 the cpu usage is normal(Pc: 4% / Laptop: 9%).
Here is the example code for SFML 2.0:
#include <SFML\Graphics.hpp>
void main()
{
sf::Sprite SPlayer;
sf::Texture TPlayer;
sf::RenderWindow App(sf::VideoMode(1280, 720, 32), "Test");
sf::Event Event;
TPlayer.loadFromFile("test.png");
SPlayer.setTexture(TPlayer);
SPlayer.setPosition(500, 500);
while(App.isOpen())
{
while(App.pollEvent(Event))
{
if(Event.type == sf::Event::Closed)
App.close();
}
App.clear();
App.draw(SPlayer);
App.display();
}
}
In sfml 1.6 i use sf::image instead of sf::texture.
On both pc and laptop my os ist windows 7 (pc 64bit and laptop 32bit).
The pc has i5 2500k cpu and gtx 560ti graphics card. The laptop has a core 2 duo t6500 with 2.1 GHz and geforce 9600m gs graphics card.
On both i use visual studio express 2010 and there are no errors or warnings.
I hope someone could help me