File: timerleak.py

package info (click to toggle)
pyopengl 3.1.5%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 14,668 kB
  • sloc: python: 108,024; makefile: 4
file content (22 lines) | stat: -rw-r--r-- 511 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
22
#! /usr/bin/env python
from __future__ import print_function
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()