LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Eistoeter on December 30, 2008, 10:12:11

Title: CPU 50%
Post by: Eistoeter on December 30, 2008, 10:12:11
Hi

I have a little question about LWJGL: I'm running my game in windowed mode. If the window is active my CPU load is at 50%. The problem (or is this normal behaviour?) is also if I reduce my main loop to the essentials which is:


while (!(Display.isCloseRequested())) {
Display.update();
Display.sync(120);
}
Display.destroy();
Title: Re: CPU 50%
Post by: Matzon on December 30, 2008, 10:36:26
You are saying - render/update as fast as possible, but limit to 120 frames per second (pretty high). Lower the number to something normal like 60 or even 30. And yes, this is normal behavior.
Title: Re: CPU 50%
Post by: Eistoeter on December 30, 2008, 10:43:26
Thanks for the quick answer. The sync should just be a last safety hold if vsync fails but I reduced it to 60 :-)

I just wondered why it is so cpu intensive. If I start for example winamp that has also visualization showing audio pitches and does much other stuff like playing music I only get cpu load 3%.