PDA

View Full Version : Why so demanding??



endo
06-01-2002, 01:50 AM
I am writing a simple OpenGL program and noticed recently that it uses 100% cpu power. Why is this?

Robbo
06-01-2002, 02:01 AM
you will find this to be the case because, presumably, you are running a render loop and it will take up all available cpu cycles.

If you want it to use less, you need to `sleep' in your main loop. Even if you set your thread to low priority, the drivers run in kernel mode so you will probably still be using up 100% cpu.

I had this problem in my program (which was multi-threaded) - starving the GUI, so I sleep for some variable time (depending on how long the frame took to render).

Hope this helps.