# GLUT_ACTION_ON_WINDOW_CLOSE

This topic is 4395 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi. I've tried calling glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_CONTINUE_EXECUTION); or glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_GLUTMAINLOOP_RETURNS); at the start of my program. Neither seems to change the default behaviour. I've also tried calling them immediately before and after calling glutCreateWindow, still no difference -- all windows close and glutMainLoop never returns. glutCloseFunc is called properly. I can keep the windows alive by calling glutMainLoop again in this callback but then I can't close any windows! If I add a glutDestroyWindow to the glutCloseFunc then I get an infinite loop. What I really want to do is continue execution of all remaining windows. A glutCloseFunc hack is acceptable. Surely someone's managed it.

##### Share on other sites
Screw it, I've been wrestling with this for days and discovered QGLWidget.

My advice to anyone using GLUT: use QGLWidget!

##### Share on other sites
I use GLFW. It works almost exactly like GLUT, 'cept function names are a bit more different. I also noticed that it has more specifications you can make... but most importantly, you control the main loop! Like:
bool running = true;while(running){   RenderScreen();   running = glfwGetWindowParam(GLFW_OPENED);}
Just stick that after the inits and when running returns false, you do all your stuff you want after the loop. But if you're doing fine with QGLWidgets, then by all means stick with it.

-Etyrn

1. 1
Rutin
21
2. 2
3. 3
JoeJ
18
4. 4
5. 5

• 13
• 38
• 23
• 13
• 13
• ### Forum Statistics

• Total Topics
631715
• Total Posts
3001868
×