I’m coding a program which is something like a simulation and the results are rendered in real time. I’m using GLUT to create the display window. Since the main program should be running the whole time, the program is called once using glutDisplayFunc(). The program will use OpenGL functions to render, swap buffers etc and call exit() to terminate everything when it finishes.
The problem is that when the glut window loses focus (eg, i click on another window), the glut window stops updating, even though the simulation is running OK. The program is coded using MSVC and ran in windows XP. However, when I run the program in Windows 7, the window updates just fine.
Can anyone explain why the window stops updating, and is there any solution for that?
Yes, but I do not need any user interaction. I’m using Glut merely to create a window to render to.
Also, it would be difficult to code the simulation so that it stops halfway, and then when called again by drawFrame() continues from the previous operation. There’s also an uncertainty on the frequency runSimulation will be run.