How can I start a new glutMainLoop() after exiting one?

Posted by angaran on Stack Overflow See other posts from Stack Overflow or by angaran
Published on 2010-04-20T16:49:55Z Indexed on 2010/04/20 16:53 UTC
Read the original article Hit count: 103

Filed under:
|
|

I've written a PERL script using OpenGL. It calls glutMainLoop() to let the user view some stuff, then the user closes the window but I want to let him continue using the script and reopening a new window and seeing some other stuff. Is that possible? I've found that it is possible to execute this instruction:

glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE,GLUT_ACTION_GLUTMAINLOOP_RETURNS);

to return to the code after the window is closed. But then if I call again a glut* function it tells me that I can't call it without calling glutInit and if I call glutInit it tells me that I can't just call it again! Is there some trick?

© Stack Overflow or respective owner

Related posts about opengl

Related posts about perl