Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Closing GLUT windows

This topic is 5297 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

i just made a small app that use glut to start the window. my app also takes control of the mouse so i cant close it easily. now i just need to know how to destroy the window with the keyboard.

Share this post

Link to post
Share on other sites
Use the glut function glutKeyboardFunc() with the name of the function calling on withing the brackets.

void Keyboard(unsigned char key, int x, int y)
// use a case statement when you use multiple keys
if(key == 'q') exit(0);

int main( int argc, char* argv[] )
// all of your draw commands
// glutDisplayFunc here
return 0;

Hope that helps
I would highly suggest you get a copy of the RedBook (OpenGL Programming Guide) which uses GLUT throughout the entire book.
Also download the GLUT specifications from opengl.org. That will help also.

[edited by - auLucifer on January 15, 2004 6:52:34 PM]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!