Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


AxoDosS

Member Since 18 Apr 2002
Offline Last Active Jul 29 2012 10:26 AM

#3485374 Terminating a GLUT loop inside a program

Posted by AxoDosS on 18 February 2006 - 09:09 PM

Here is one way of doing it:

void myIdleFunc()
{
...
if (should_we_exit)
{
throw "MY_EXIT_MESSAGE";
}
}

int main()
{
try
{
...
glutMainLoop();
}
catch (const char* msg)
{
...
}

cleanup();
printf("program terminated\n");

return EXIT_SUCCESS;
}





PARTNERS