• Advertisement
Sign in to follow this  

GLUT_ACTION_ON_WINDOW_CLOSE

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement