[PyOpenGL-Users] glutTimerFunc seems to accumulate garbage
Brought to you by:
mcfletch
From: Alexandre L. <ale...@gm...> - 2008-09-22 18:35:48
|
The following code starts by using almost no cpu time and progressively use the complete cpu after like 30 seconds... Should I clear some buffer somewhere ? putting a delay more than 1 will result in the same behavior but will take more time. A delay twice bigger will accumulate twice slower and will have twice more time between calls. Therefore it will take 4 time longer to see the same behavior... In my original program, I have 3 timers with period of 20 ms so it takes 1 or 2 minutes to see the behavior starting. Can someone confirm this ? Should I fill a bug report somewhere ? I've tried it with version 3.0.0b1 and 3.0.0b6. ############################## # code starts here ############################## from OpenGL.GLUT import * glutInit( sys.argv ) glutInitDisplayMode( GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH ) glutInitWindowSize( 100, 100 ) glutCreateWindow( "testtimer" ) delay = 1 count = 0 def timerCallback(value): global count count += 1 if count % 2000 == 0: print count glutTimerFunc( delay, timerCallback, value+1 ) glutTimerFunc( delay, timerCallback, 0 ) glutMainLoop() ############################## # code ends here ############################## some more info: $ uname -a Linux xps 2.6.24-19-generic #1 SMP Wed Aug 20 22:56:21 UTC 2008 i686 GNU/Linux $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 8.04.1 Release: 8.04 Codename: hardy ªŁ€× |