Re: XForms: Mineo Morohashi: OpenGL and xforms

Lothar Esser (
Thu, 09 Oct 1997 21:01:13 -0500 (CDT)

To subscribers of the xforms list from Lothar Esser <> :

On Fri, 10 Oct 1997, Mineo Morohashi wrote:

> To subscribers of the xforms list from Mineo Morohashi <> :

> In addition to use OpenGL library, I use
> glut.
> However, each library need to comprise main event loop, such as
> fl_do_forms(void), and glutMainLoop(). If I want to use both, how can
> I handle both of them in same program?

Dear Mineo Morohashi,

I also use glut and xforms and had the problem with two event loops.
A good solution is to use the glutMainLoop() in the main() program
and add a callback to the idle function of glut :


where Xforms_cb is :

void Xforms_cb(void) {

So when ever OpenGL (or glut) has nothing to do it checks the forms.
This however uses up some cpu time ( about ~1% or less) on my SGI
I cannot claim that I had this idea so let me thank Anneke
Sicherer-Roetman who has made excellent contributions to "Xform based
applications" which you can find on the xforms web page.

Hope this helps.

Lothar Esser

Dr. Lothar Esser
Howard Hughes Medical Institute
5323 Harry Hines Blvd.
Dallas Texas 75235-9050

E-mail :

To unsubscribe, send the message "unsubscribe" to or see
Xforms Home Page:
List Archive: