Jump to content
  • Advertisement

Archived

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

ioda

opengl window

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

How do I close the openGL window without closing my main window ? if i create the opengl window like this : int main ( int argc, char** argv ) { glutInit ( &argc, argv ); glutInitDisplayMode ( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); glutInitWindowSize ( 640, 480 ); glutCreateWindow ( argv[0] ); init ( ); glutReshapeFunc ( reshape ); glutMouseFunc ( mouse ); glutMotionFunc ( motion ); glutKeyboardFunc ( keyboard ); glutSpecialFunc (vSpecial ); glutDisplayFunc ( display ); glutIdleFunc ( idle_func ); glutMainLoop ( ); return 0; }

Share this post


Link to post
Share on other sites
Advertisement
GLUT needs at least one window to works. If you are talking about the Win32 console window, you could do something like this:

int main ( int argc, char** argv )
{
glutInit ( &argc, argv );
glutInitDisplayMode ( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutInitWindowSize ( 640, 480 );

glutCreateWindow ( argv[0] );

init ( );
glutReshapeFunc ( reshape );
glutMouseFunc ( mouse );
glutMotionFunc ( motion );
glutKeyboardFunc ( keyboard );

glutSpecialFunc (vSpecial );

glutDisplayFunc ( display );
glutIdleFunc ( idle_func );
glutMainLoop ( );

//----------------------------------------------------------
// Do something else here before return to the system.
//----------------------------------------------------------
//...

return 0;
}


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!