Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: CPU usage shoots up to 100 when generating a window  (Read 2620 times)

0 Members and 1 Guest are viewing this topic.

retrogamer4ever

  • Newbie
  • *
  • Posts: 6
    • View Profile
CPU usage shoots up to 100 when generating a window
« 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?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
CPU usage shoots up to 100 when generating a window
« Reply #1 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 ;)
Laurent Gomila - SFML developer

retrogamer4ever

  • Newbie
  • *
  • Posts: 6
    • View Profile
Thanks!
« Reply #2 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.

WorldRacer

  • Newbie
  • *
  • Posts: 16
    • View Profile
CPU usage shoots up to 100 when generating a window
« Reply #3 on: May 22, 2009, 07:34:20 pm »
Also setting the FrameRateLimit is the nicer way to work with you cpu xD