Glut window code a memory hog?

Started by
2 comments, last by _nomad_ 19 years, 4 months ago
I found something rather interesting running my program on several different computers. It slowed down a lot on some of them (2 Ghz or less). I checked the task manager and it took 98% (!) of the CPU! It also took up 98% fullscreen mode on a 2.26 Ghz machine, 5-15% windowed. To contrast this I looked at NeHe's tutorial 19's CPU useage... about 3-5% on the same 2.26 Ghz machine. Granted, there are probably settings I don't know about that could account for the difference in my program on computers with only slightly different hardware, but that doesn't account for the significantly poorer performance versus the NeHe code. The only significant program difference I could think of to cause this is that I'm using the glut window code while the NeHe program builds up its own Windows 32-bit window. Does the window code really matter that much? And what exactly accounts for this difference between the code, the glutmainloop or what?
Advertisement
A windows program will take up as much of the CPU as possible if you let it. The Win32 function sleep() will tell windows to let other processes run while your program takes a break for a given period of time.
Disclaimer: "I am in no way qualified to present advice on any topic concerning anything and can not be held responsible for any damages that my advice may incurr (due to neither my negligence nor yours)"
yeah, sleep() will solve your problem...i use it also in my SDL+OpenGL apps so my app won't be a CPU hog...:)
yeah, sleep() will solve your problem...i use it also in my SDL+OpenGL apps so my app won't be a CPU hog...:)

This topic is closed to new replies.

Advertisement