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?