PDA

View Full Version : 2 Window Generation



devpan
08-04-2002, 10:00 PM
how do i display 2 windows at the same time, generated from within one program?I have created a rectangle in one and a triangle in another window.?Thank u

Gavin
08-05-2002, 12:25 AM
How do you create the windows or choose them for redrawing or?......

cwc36
08-06-2002, 12:35 AM
try to use 2 viewports at the render function..

glClear....;
glClearColor...;
glViewport(0,0,1024,768);
glPushMatrix();
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective();
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
SetupCamera ();
DrawObject();
glPopMatrix();

glViewport(400,690,230,70);
glPushMatrix();
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective();
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
SetupCamera2();
DrawObject2();
glPopMatrix();

glFlush();
glutSwapBuffers();

I think that should be work..