I’ve got a C/C++ program running on Windows XP that initializes/displays 4 windows using glut. We added some Windows code that displays some other debug windows. So my question is, do windows created with Windows coexist well with windows created with glut? The reason I’m asking is that after creating all of the windows, and simply idling, nothing being rendered, the task manager sez my program is using a whopping 75% of the processors time!
A version of my program using glut, but without the Windows code uses between 0 and 1% when idling. What gives?
I’m using openGlut and glutMainLoopEvent() by the way. glutMainLoopEvent() exits instead of staying permanently in a loop.
Thanks in advance.
Does your added Windows code include using WM_IDLE? If so then your code is being called whenever the computer is idling which would be most of the time. Otherwise there shouldn’t be any issues with having win32(or other APIs) and glut working together.
Ok thanks. How do I specify WM_IDLE?
Since I am only really using glut to create the windows and am using Windows and OpenGL for everything else, I was actually considering abandoning glut altogether and simply doing everythings in Windows/OpenGL. Is this a bad idea?
Oops. Just realized something. The Windows code does NOT use WM_IDLE. And when I minimize the 4 windows created with openGlut, the Cpu usage falls from 75% to 0%, but the Windows windows are still merrily updating!
Somehow, I have to tell glut to stop messing with those 4 glut windows when nothing is being rendered.
But when I run the same 4 glut windows as a simple application with ‘main’ instead of ‘WinMain’, and NO Windows windows, Cpu usage is 0%! Something I’m doing is making Windows + glut a deadly combination.