display the same thing in different windows

lets say i have placed a bunch of things in a window, like 2 teapots… and in a different window i want to display the same thing, is there a way to do that without having to set the up again? for example, i do this…

    glTranslatef(100, 100, 0.0);
    glutWireSphere(50, 10, 10);
    glutWireSphere(50, 100, 10);

and i want to display that same thing in after i
glutSetWindow to a different one. do i have to replace the spheres, or is there a way to just re-output everything?

are you using glut?
if yes you can create a new window and choose the same display function.

if not you could ocpy the content of the first window into a texture and use this tex in the second window

Huh ? If you have only 2 views, to best is to redo all calls…

Texture copy will be slower/harder (unless some very specific cases).
One way would be display lists, but for only 2 calls I don’t think it is worth it. Compile time can be slow.

Do you want to optimize for speed or for ease of code ?

ease of code… i figured out an easy way to do it… thanks