XForms: Trouble with programming with GLUT (fwd)

Gang Chen (gang@cochise.biosci.arizona.edu)
Wed, 3 Jun 1998 10:40:37 -0700 (MST)

# To subscribers of the xforms list from Gang Chen <gang@cochise.biosci.arizona.edu> :

Hi,

Again, could somebody help me?

I am learning how to program with GLUT. Here is something I have trouble
with. I want to have a graphic window showing some patterns dictated by
some comuputation, and couple of other windows showing parameters used in
the computation which can be changed by the user through buttons and
sliders. As I understand it, the structure would be like this:

void main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(...);
glutInitWindowSize(..., ...);
glutInitWindowPosition(..., ...);
glutCreateWindow(...);
init();

MyBigLoop(...)

glutMainLoop();
return 0;
}

where MyBigLoop(...) is somthing like this:

for (i=0; i<N; i++)
{
DoComputation(...);
glutDisplayFunc(...);
glutMouseFunc(...);
glutKeyboardFunc(...);
}

I want the main graphic window to be refreshed each time MyBigLoop(...)
is passed through. It seems that the main graphic window (and other
parametric windows) won't show up until glutMainLoop() is reached, but
this is not what I want. How can I get out of this maze?

Many thanks,
Gang Chen

_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/