I wanted to know why so much CPU is required to run this
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
int main()
{
sf::RenderWindow App(sf::VideoMode(800,600,32), "Test app");
sf::Image Back;
if ( !Back.LoadFromFile("background.png") )
App.Close();
sf::Sprite BackSPR;
BackSPR.SetImage(Back);
while ( App.IsOpened() )
{
App.Clear();
sf::Event Event;
while ( App.GetEvent(Event) )
{
if ( Event.Type == sf::Event::Closed )
App.Close();
}
App.Draw(BackSPR);
App.Display();
}
return 0;
}
The compiled program uses about 50% of my CPU.
Some computer info:
RAM 8gb
HDD 1tb
processor 2.6ghz
I am using MinGW to compile.