SFML community forums

Help => Window => Topic started by: retrogamer4ever on May 06, 2009, 10:04:52 am

Title: CPU usage shoots up to 100 when generating a window
Post by: retrogamer4ever on May 06, 2009, 10:04:52 am
I am using vs05, have compiled and linked everything fine except for some reason when it generates the window my cpu usage shoots up to 100 and the window locks up and I have to force it closed from the task manager...  Not sure why this is happening considering the only code I am using is the code for generating a simple window from the tutorial for version 1.4.  
Code: [Select]


int main()
{
    // Create the main window
    sf::Window App(sf::VideoMode(800, 600, 32), "SFML Window");

    // Start main loop
    bool Running = true;
    while (Running)
    {

        App.Display();
    }

    return EXIT_SUCCESS;
}


I am running on windows xp using 1.5ram, any ideas why this could would be such a memory hog?  am I missing something in the settings?
Title: CPU usage shoots up to 100 when generating a window
Post by: Laurent on May 06, 2009, 10:13:40 am
This is because you're not processing events. This code is not meant to be a working application, this is just the first tutorial ;)
Title: Thanks!
Post by: retrogamer4ever on May 08, 2009, 08:53:24 pm
Yeah felt kind of dumb that I didn't catch that @.@  I just setup some events and I am good to go :-D  You are a very helpful fello Laurent, THANKS! Such speedy response.
Title: CPU usage shoots up to 100 when generating a window
Post by: WorldRacer on May 22, 2009, 07:34:20 pm
Also setting the FrameRateLimit is the nicer way to work with you cpu xD