From: Tim R. <ti...@us...> - 2004-07-13 21:13:34
|
Update of /cvsroot/csdopenglnet/tutorials/lesson01 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13589/lesson01 Modified Files: lesson01glut.cs Log Message: corrected all examples to use double buffer Index: lesson01glut.cs =================================================================== RCS file: /cvsroot/csdopenglnet/tutorials/lesson01/lesson01glut.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** lesson01glut.cs 13 Jul 2004 19:45:12 -0000 1.2 --- lesson01glut.cs 13 Jul 2004 21:12:56 -0000 1.3 *************** *** 5,10 **** public Lesson01GLUT() { ! glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH ); ! glutInitWindowSize( 500,500 ); glutCreateWindow("Lesson 01 - GLUT"); initGL(); --- 5,10 ---- public Lesson01GLUT() { ! glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); ! glutInitWindowSize( 640, 480 ); glutCreateWindow("Lesson 01 - GLUT"); initGL(); *************** *** 12,17 **** --- 12,30 ---- glutKeyboardFunc( new cb0_glutKeyboardFunc(keyboard) ); glutReshapeFunc( new cb0_glutReshapeFunc( reshape ) ); + glutVisibilityFunc( new cb0_glutVisibilityFunc( visibility ) ); glutMainLoop(); } + + protected void visible( int state ) { + if ( state==GLUT_VISIBLE ) { + glutIdleFunc( new cb0_glutIdleFunc( redraw ) ); + } else { + glutIdleFunc( null ); + } + } + + protected void redraw() { + glutPostRedisplay(); + } protected void initGL() { |