OpenGL / GLUT - Command to quit console window?

Started by
2 comments, last by Sophisto 15 years, 5 months ago
I'm currently creating a program using OpenGL and GLUT. All works fine, and I've just created a pop-up menu that allows the user to perform some actions. However, I'd like to include the option to quit the program from the menu, but I'm not sure on the command used. Can anyone help? All other aspects of the program / menu work fine, just not sure on what command to use to quit/exit the window. Cheers, S
Advertisement
i am very new to this, but i think you just return 1;
i.e
if(!b)
{
MessageBox(NULL,L"failed to load bitmap",L"Hello",MB_OK);
return 1;
}
Quote:Original post by Sophisto
However, I'd like to include the option to quit the program from the menu, but I'm not sure on the command used. Can anyone help? All other aspects of the program / menu work fine, just not sure on what command to use to quit/exit the window.
Use exit(0).

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

Quote:Original post by swiftcoder
Quote:Original post by Sophisto
However, I'd like to include the option to quit the program from the menu, but I'm not sure on the command used. Can anyone help? All other aspects of the program / menu work fine, just not sure on what command to use to quit/exit the window.
Use exit(0).



Worked a treat! Thanks, man!

This topic is closed to new replies.

Advertisement