PDA

View Full Version : How to glutPostRedisplay on a window that is not the current window?



question2
06-16-2015, 11:28 PM
I have two windows. the upper window is taking user input and as a result of that input the lower window which is not the current window needs to get updated. However according to the manual page for glutPostRedisplay, that call only affects the top or current window. What is the equivalent call to force glut to update the lower window?
I would like to avoid bringing the lower one to the front momentarily and updating it and then sending it to the back again.
Thanks.

Dark Photon
06-17-2015, 04:59 PM
You might check out this old thread (first hit on a web search of "glut multi-window"):

* https://www.opengl.org/discussion_boards/showthread.php/140695-Multiple-windows-with-GLUT-tutor

Specifically:


glutSetWindow( window_1 );
glutPostRedisplay(); // Update screen with new rotation data

glutSetWindow( window_2 );
glutPostRedisplay(); // Update screen with new rotation data

Sure enough, the API is still there:

* http://freeglut.sourceforge.net/docs/api.php

question2
06-18-2015, 10:03 PM
Great, thank you.