File: test_glgetfloat_leak.py

package info (click to toggle)
pyopengl 3.0.0~b6-3
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 5,696 kB
  • ctags: 26,182
  • sloc: python: 34,233; ansic: 70; sh: 26; makefile: 15
file content (31 lines) | stat: -rw-r--r-- 663 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/python

import pygame
from pygame.locals import *
from OpenGL.GL import *
from OpenGL.GLU import *

def main():
	pygame.init()
	pygame.display.set_mode((800,600), pygame.OPENGL|
		pygame.DOUBLEBUF)
	glClearColor(1.0, 0.0, 0.0, 1.0)
	glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT)

	done = False

	while not done:
		for i in range(0,50000):
			modelview_matrix = glGetFloatv(GL_MODELVIEW_MATRIX)
			if not i % 500:
				print '.',
		print
		pygame.display.flip()

		eventlist = pygame.event.get()
		for event in eventlist:
			if event.type == QUIT or event.type == KEYDOWN and event.key == K_ESCAPE:
				done = True

if __name__ == '__main__':
	main()