I wrote the following function to reshape two subwindows (2 and 3) when the parent window is reshaped. What I wanted was to maintain the proportion of the second subwindow (3) but some how it's not working! I checked and the viewport is O.K. at the end of this function, but when the screen is redisplayed it’s not what I’m expecting, for example if then main window has 200x600 pixels, the viewport of the subwindow should have 150X150, but it’s being displayed with 150x600. What’s wrong here?
Code :SUBROUTINE resh(larg,alt) USE opengl_gl USE opengl_glu USE opengl_glut IMPLICIT NONE INTEGER(kind=GLsizei)::larg,alt CALL glutSetWindow(2) CALL glutPositionWindow(3*larg/4,0) CALL glutReshapeWindow(larg/4,alt) CALL glViewport (0, 0,larg/4,alt) CALL glutSetWindow(3) CALL glutPositionWindow(0,0) CALL glutReshapeWindow(3*larg/4,alt) IF ((3*larg/4)>alt) THEN CALL glViewport (0, 0,alt,alt) ELSE CALL glViewport (0, 0,3*larg/4,3*larg/4) END IF CALL glutPostRedisplay() END SUBROUTINE



