PDA

View Full Version : how to exit a program via a glut menu



Runz W Scissorz
10-21-2004, 11:17 AM
I am using the glut menus, and i dont know the function of item to use to make the program close. I am trying:

void choiceMain(int selection){
if (selection == 1) {
exit;
}
//other menu options that work fine
}

and of course the function(choiceMain) is registered in the main method, cuz the other 2 menu options work fine. I just dont know how to make a menu function to exit the program! :mad:
the statement "exit;" doesnt call any compile/link errors, but it doesn't do anything either. Help!

Hylke Donker
10-21-2004, 12:10 PM
if you created the window with:
window = CreateWindow(title);
then you can destroy your window using:
glDestroyWindow(window);
Greetz Hylke

Runz W Scissorz
10-21-2004, 12:14 PM
friend helped me, i feel dumb now:

instead of "exit;"

i needed "exit(0);"