Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/opengl/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在使用Perl退出OpenGL中的glutMainLoop()后,如何启动新的glutMainLoop()?_Perl_Opengl_Glut - Fatal编程技术网

在使用Perl退出OpenGL中的glutMainLoop()后,如何启动新的glutMainLoop()?

在使用Perl退出OpenGL中的glutMainLoop()后,如何启动新的glutMainLoop()?,perl,opengl,glut,Perl,Opengl,Glut,我已经使用编写了一个Perl脚本。它调用glutMainLoop()让用户查看一些内容,然后用户关闭窗口,但我想让他继续使用脚本,重新打开一个新窗口并查看其他内容。可能吗?我发现可以执行以下指令: glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE,GLUT_ACTION_GLUTMAINLOOP_RETURNS); 关闭窗口后返回代码。但是如果我再次调用glut*函数,它会告诉我如果不调用glutInit就不能调用它,如果我调用glutInit它会告诉我不能再

我已经使用编写了一个Perl脚本。它调用
glutMainLoop()
让用户查看一些内容,然后用户关闭窗口,但我想让他继续使用脚本,重新打开一个新窗口并查看其他内容。可能吗?我发现可以执行以下指令:

glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE,GLUT_ACTION_GLUTMAINLOOP_RETURNS);
关闭窗口后返回代码。但是如果我再次调用
glut*
函数,它会告诉我如果不调用
glutInit
就不能调用它,如果我调用
glutInit
它会告诉我不能再调用它!有什么窍门吗?

你没有:“在GLUT程序中,此例程最多应调用一次。”


听起来您需要在不使用GLUT的情况下使用OpenGL,或者至少不使用
glutMainLoop
。或者,您可以使用空闲回调或计时器回调,从主循环内部继续进行无窗口处理。

我明白了,可能最好不要使用过量。我试试SDL。