Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 10 of 10

Thread: resizing the windows

  1. #1
    Intern Contributor
    Join Date
    Oct 2002
    Location
    bangalore
    Posts
    56

    resizing the windows

    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
    thanks & regards
    Prashant G.P

  2. #2
    Intern Contributor
    Join Date
    Oct 2002
    Location
    bangalore
    Posts
    56

    Re: resizing the windows

    Hi VC6-OGL,nexusone,shintanu,
    i need ur help guys
    thanks & regards
    Prashant G.P

  3. #3
    Intern Contributor
    Join Date
    Oct 2002
    Location
    bangalore
    Posts
    56

    Re: resizing the windows

    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
    thanks & regards
    Prashant G.P

  4. #4
    Advanced Member Frequent Contributor
    Join Date
    Oct 2001
    Posts
    596

    Re: resizing the windows

    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?

  5. #5
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,070

    Re: resizing the windows

    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.



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

  6. #6
    Member Regular Contributor
    Join Date
    Nov 2002
    Location
    USA
    Posts
    254

    Re: resizing the windows

    Hello prashantgp,

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

    - VC6-OGL

  7. #7
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,070

    Re: resizing the windows

    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.

  8. #8
    Intern Contributor
    Join Date
    Oct 2002
    Location
    bangalore
    Posts
    56

    Re: resizing the windows

    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.

    thanks & regards
    Prashant G.P

  9. #9
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,070

    Re: resizing the windows

    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/L...article29.html

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


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

  10. #10
    Intern Contributor
    Join Date
    Oct 2002
    Location
    bangalore
    Posts
    56

    Re: resizing the windows

    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
    thanks & regards
    Prashant G.P

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •