Archived

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

ioda

opengl window

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