Archived

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

opengl window

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