File: timerleak.py

package info (click to toggle)
pyopengl 3.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 6,140 kB
  • sloc: python: 26,428; makefile: 2
file content (21 lines) | stat: -rwxr-xr-x 471 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#! /usr/bin/env python
from OpenGL.GLUT import *

delay = 1
count = 0

def timerCallback(value):
    global count
    count += 1
    if count % 2000 == 0: print count
    glutTimerFunc( delay, timerCallback, value+1 )

if __name__ == "__main__":
    glutInit( sys.argv )
    glutInitDisplayMode( GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH )
    glutInitWindowSize( 100, 100 )
    glutCreateWindow( "testtimer" )

    glutTimerFunc( delay, timerCallback, 0 )

    glutMainLoop()