redrawing multiple glut windows

This is a discussion on redrawing multiple glut windows within the Game Programming forums, part of the General Programming Boards category; I'm working on an electroplankton clone for school and I want to have a 3d window where I can have ...

  1. #1
    GA ichijoji's Avatar
    Join Date
    Nov 2002
    Posts
    179

    redrawing multiple glut windows

    I'm working on an electroplankton clone for school and I want to have a 3d window where I can have everything rendering and a 2d for all the gui to sit in. I register the second window with a glutCreateWindow() call and the same set of callback functions so that I can process both windows without having to change my scene graph (this still needs to fit together with the parts my teammates are making).

    The problem is that the two windows render the way they're supposed to, but only when they're the active window or the mouse is over them. I tried fixing this by putting this code at the end of the two render functions, respectively:
    Code:
    //at end of edit window render function
    glutSetWindow(mainWindowID);
    glutPostRedisplay();
    glutSetWindow(editWindowID);
    Code:
    //at end of main window render function
    glutSetWindow(editWindowID);
    glutPostRedisplay();
    glutSetWindow(mainWindowID);
    This works by making one window rendering trigger the render call for the other one for a while, but after a minute or so it always crashes and stops drawing. Is there another way to work around this that anybody knows of?
    Illusion and reality become impartiality and confidence.

  2. #2
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    why not have the gui and 3d in one window?

  3. #3
    ---
    Join Date
    May 2004
    Posts
    1,379
    why not use separate viewports?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how to make a windows application
    By crvenkapa in forum C++ Programming
    Replies: 3
    Last Post: 03-26-2007, 09:59 AM
  2. Windows shell commands - multiple files
    By Magos in forum Tech Board
    Replies: 3
    Last Post: 02-28-2006, 12:56 AM
  3. dual boot Win XP, win 2000
    By Micko in forum Tech Board
    Replies: 6
    Last Post: 05-30-2005, 02:55 PM
  4. errors with opengl & glut in windows
    By korbitz in forum Game Programming
    Replies: 12
    Last Post: 03-14-2004, 01:54 PM
  5. multiple console windows
    By gordy in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 02-13-2002, 10:05 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21