it’s useful to keep identifiers to those windows, so
make globals like :
int win1, win2, win3, win4;
then for each window paste code like :
win1= glutCreateSubWindow(mainWindow,startX,startY,sizeX,sizeY);
//of course, you need main window set up already, for ex
//glutInitWindowSize(mainWidth, mainHeight);
//glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH | etc.);
//mainWindow=glutCreateWindow(“YourMainWindow”);
glutDisplayFunc(win1disp);
//as this subwindow is now “selected” by glut you shall register win1disp procedure , which renders its contents
// --> this is just void win1disp() {…}
// you can also register more callbacks or menu for this window if you like
btw: there’s a simple example code for subwindows within glut distribution
(progs\examples\subwin.c)
[This message has been edited by tachyon_eagle (edited 02-16-2004).]
Thankx alot tachyon_eagle . It works with me in proper way . There is still one thing . How can I “kill” the subwindow because it still there even if the program doing something else ?
and I wonder where I can get the example you mnetioned ? I mean progs\examples\subwin.c
Originally posted by glcrazy:
[b]
Thankx alot tachyon_eagle . It works with me in proper way . There is still one thing . How can I “kill” the subwindow because it still there even if the program doing something else ?
and I wonder where I can get the example you mnetioned ? I mean progs\examples\subwin.c
Thank you very much, I try to put this command, but I get unresolved error which stop the program.
As you see here ,
If ………
{ create glut subwindow1 ;
………… ;
}
if ……….
{ create glut subwindow2 ;
………… ;
}
if ……….
{ create glut subwindow3 ;
………… ;
}
I creat a sub window for each choice ( I mean each If statement ) and I was confuesed where to put “glutDestroyWindow( int window);” , Do I have to put it in each if statment or where exactly ?
I don’t know where to put ‘glutDestroyWindow( int window);’ exactly nexusone. It works now but not in proper way . I will keep trying till I can find the correct solution.
Thank you always nexusone for your cooperative and help.
I used each subwindow to render a part of the code … I’m demonstaring an image resolution as illustration tool for understanding the meaning of resolution . Each different ‘image’ (resolution) must be in seprate subwindow. Once the user chose what resolution he wants ( ‘if statments’ as shown in my past replies) a subwindow appears . When he choose another choice the subwindow must disappear and another subwindow comes out with his choice and so on .