main()
{
…
a=window 1;
…
b=window2;
set a;
draw()
…
set b
draw();
…
}
draw()
{
…
}
my code is something like that.
I uesd the same draw function in both the windows( both the window has different view points)
object is drawn in the 1st one but not the second. fuction call works perfectly(checked it with a “draw” line apart from the object. line was drawn but not the object.)
related
while doing a different task I tried to calll the draw function second time in one window(kinda redrawing the object). nothing drawn in the window.(rest of them-function call, control transfers work perfectly)
my questions are
how to get the object in the second window
can i use the same drawing function in different windows
if i use glutPostRedisplay() what are the things will be updated in main program and screen(ex. which functions will be called, what variables are updated etc.)
I wrote a little dual windows program in glut yet to post it on my website.
But I am guessing you have not set you window to be drawn to correctly.
Yes, you can have both windows share functions.
Here is how you have to setup each window, if you would like a copy of the full working source code drop me an e-mail, make sure “openGL forum” is in the subject line else it may get deleted as spam.