Switching windows

Please help me with windows management.

I’m using GLUT and I have created 2 windows using glutCreateWindow(string);

But when I change windows the curently showed window doesn’t redisplay until I click on it or move the window.

But why? I switch windows by using this code:

glutSetWindow(win_id0);
glutHideWindow();
glutSetWindow(win_id1);
glutShowWindow();
glutPostRedisplay();

Callback functions are different and registered after each glutCreateWindows

Thanks for replays.

[This message has been edited by Fluke (edited 05-17-2000).]

Well, I only use glx or wgl, so I can’t say I’ve used these functions, but I’m guessing you’re using static renderings? Thing is, it won’t call your callbacks until you generate a resize or a paint event. Try calling glutPostRedisplay(); I seem to remember there being such a function, and from what I remember, that causes the main loop to call your display callback.

Hi, thanks for replay.
I’m calling glutPostRedisplay() after I switch the window, but nothing changed.
I tryed to put some character to console output to be sure the draw callback function is called, and it was working, but nothing was drawed.

Finally I tried to compile the program with Borland C++ on the PC (Currently I’m using the SUN machine with gcc) and it didn’t redisplay too, but completely. When I started the application again, it was drawing sometimes, depending on whether the system was in text mode, or in GUI.