PDA

View Full Version : 4 glut windows in 1



05-04-2002, 09:14 PM
Anyone know how to combine all 4 windows below into one that we can apply transformation to each windows individual or share(1 windows for xy plane, 1 windows for yz plane, 1 windows for xz plan, 1 windows for projection) but have on 1 windows, when you drag, it's move all 4.

main_window1 = glutCreateWindow( "GLUT Example 1" );
main_window2 = glutCreateWindow( "GLUT Example 2" );
main_window3 = glutCreateWindow( "GLUT Example 3" );
main_window4 = glutCreateWindow( "GLUT Example 4" );

no-one
05-04-2002, 09:44 PM
if im not mistaken this would be done using viewports not windows...

05-05-2002, 02:05 PM
so how do I do it with viewport?

Bob
05-05-2002, 10:56 PM
Create one large window, then use glViewport to tell OpenGL to draw only to a part of the window. Like this.



// Draw to lower left quarter
glViewport(0, 0, windowWidth / 2, windowHeight / 2);
DrawScene();

// Draw to lower right quarter
glViewport(windowWidth / 2, 0, windowWidth / 2, windowHeight / 2);
DrawScene();

And so on, for each quarter.