Re: [Dev-C++] "win32 api + opengl" uses too much CPU resourses (performance problem)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Per W. <pw...@ia...> - 2007-11-08 15:44:27
|
Your program has a busy loop that tries to repaint the screen as often as it can. It will consume all processor capacity it can. If it "only" consumes 50%, that is because you have two processors, or a dual-core or a processor with hyper-threading. To reduce the processor load, you should only repaint the display after the scene has changed or after you get a WM_PAINT message. /pwm On Thu, 8 Nov 2007, Jessica Chen wrote: > When I run the .exe file whose function is to display OpenGL in win32 > api controls, I found the CPU resource is used by 50% (showed in > Windows Task Manager). My computer is Pentium CPU 3.40GHz. > > I attached a sample code here to see if anyone can help me to solve > the "performance" problem. I would like to say thanks in advance. > :-) > |