Opengl app freezes when I change window

I have an opengl application that displays voice characteristics dynamically. I run the program from a command window (Windows XP) and it opens another window to display voice features as I talk. Works great.

But if I click on any other window, my opengl window freezes – motion stops (the rest of the program doesn’t stop, just graphics). Maybe I’m missing some opengl call, but it seems to have all the function calls as some examples I’ve looked at that don’t freeze. I’m thinking it might be something I am supposed to set when compiling–? I use Microsoft Visual C++ and produce a Win32 Console Application. Any help un-freezing would be appreciated.

Are you getting that behavior with just your program or others as well? If you are getting with others, it is some system issue.
If it is just yours, then maybe you need to invalidate the client area with InvalideRect(NULL, FALSE).
That’s a Win32 function. If you are using some other wrapper, then I don’t know.

I have found my problem was not with windows compilation or missing some windows function. This is simply a new opengl programmer misunderstanding use of the glut functions. Instead of using glutIdleFunc(animate), I had a while() loop within the display function. It worked fine if the focus was on my opengl application window. However when I changed focus away from the opengl application window, it could never re-loop into display() again, so the picture was frozen. The glutIdleFunc(animate) allows the animate() function to operate at idle, then glutPostDisplay() at the end of animate() brings the process back to display() for update.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.