PDA

View Full Version : resizing the windows



prashantgp
02-19-2003, 12:36 AM
Hi all ,
i am creating 2 windows.
one is the subwindow of the other.
when i maximise the parent window ,
the child window is not getting maximised.

how to do it??

my reshape code looks like this.


void
reshape (int w, int h)
{
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
gluOrtho2D (-1.0, 1.0, -1.0, 1.0);
glMatrixMode (GL_MODELVIEW);
glLoadIdentity ();
}


and main function looks like this.


int
main (int argc, char **argv)
{
glutInit (&argc, argv);
glutInitWindowSize (800, 725);
glutInitWindowPosition (200, 80);
pw = glutCreateWindow ("Multi Function Display");
glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
init ();

glutDisplayFunc (display);
glutKeyboardFunc (keyboard);
glutReshapeFunc (reshape);
glutMouseFunc (mouse);

// Default page - Attitude direction indicator

cw = glutCreateSubWindow (pw, 120, 110, 550, 510);
cinit ();
glutDisplayFunc (cdisplay);
glutReshapeFunc (reshape);
glutKeyboardFunc (keyboard);
glutMouseFunc (mouse);
glutIdleFunc (idle);
glutMainLoop ();
return 0;

}


pls do reply soon,

bye bye

prashantgp
02-19-2003, 06:40 PM
Hi VC6-OGL,nexusone,shintanu,
i need ur help guys

prashantgp
02-21-2003, 01:55 AM
Hi All,

why man no one is replying to my post.
is this post so silly and stupid????

never mind if it is silly , after all help is help.

bye bye
Prashant G.P

Mazy
02-21-2003, 02:12 AM
Maybe becourse this doenst seams to be a opengl question, but rather an GLUT question, and maybe you get more answer if you ask in the appropriate forum?

nexusone
02-21-2003, 04:48 AM
I am alway's happy to help, but I do not sit by my computer 24 hours a day waiting on someone to post a message.

I have not done much with having two windows open at once under glut, but will be happy to look into it. Note it could be a few hours before I get back.

http://www.opengl.org/discussion_boards/ubb/smile.gif


Originally posted by prashantgp:
Hi VC6-OGL,nexusone,shintanu,
i need ur help guys

Stack Overflow
02-21-2003, 04:05 PM
Hello prashantgp,

I will have to look into sub window maximization, so please give me some time. Thank you.

- VC6-OGL

nexusone
02-21-2003, 06:46 PM
Just a thought,
In your reshape function it will only effect the current active window, you may need to make the subwindow active to resize is also.

so you maybe after resize of main, make sub active and resize it...

I have not tried this out so it is just a thought not a fact.

prashantgp
02-23-2003, 09:30 PM
First of all thanks to all of u for replying to my post.

Hi Nexus,
even i thought of the same idea and tried calling the reshape of the subwindow in main windows reshape function.( even i created the subwindow there itself and called the reshape for the same).
But instead of giving correct results it's getting hanged.
i dont know why??
so ur further help is appreciated much.

and also ,
Mazy, thanks for ur suggestion , why dont u tell me any proper forum for glut. i cant find one(infact i didn't tried to search).

hi VC6-OGL , i am looking forward to hear from u.

bye bye

regards,
Prashant G.P



Originally posted by nexusone:
Just a thought,
In your reshape function it will only effect the current active window, you may need to make the subwindow active to resize is also.

so you maybe after resize of main, make sub active and resize it...

I have not tried this out so it is just a thought not a fact.

nexusone
02-24-2003, 06:22 AM
I found this glut subwindow demo, is if this helps. I have compiled it without any problems and looks like what you are looking for.

http://mercury.chem.pitt.edu/~tiho/LinuxFocus/English/March1998/article29.html

Also here is some tips in windows and sub windows with GLUT found here on this site:
http://www.opengl.org/developers/documentation/glut/spec3/node90.html


[This message has been edited by nexusone (edited 02-24-2003).]

prashantgp
02-25-2003, 01:16 AM
Hi all ,
thanks for the help.
Nexus, i got the solution for the problem in the links u had given.
thanks again
bye bye
Prashant G.P