File: timerleak.py

package info (click to toggle)
pyopengl 3.1.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 11,216 kB
  • sloc: python: 80,468; makefile: 4
file content (21 lines) | stat: -rw-r--r-- 472 bytes parent folder | download | duplicates (2)
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()