Документ взят из кэша поисковой машины. Адрес оригинального документа : http://kodomo.fbb.msu.ru/hg/allpy/file/e83572fff43f/sandbox/gl.py
Дата изменения: Unknown
Дата индексирования: Sun Feb 3 22:26:52 2013
Кодировка:
allpy: e83572fff43f sandbox/gl.py

allpy

view sandbox/gl.py @ 746:e83572fff43f

Roll-back a bug introduces by dirty hand-merge in [723]. (closes #74) (see #76) Boris! Please do not do dirty hand merges! If you did hg fetch here, this bug would not appear! Please, be extremely careful when you do hand merges and double-check your changes. Do a diff with each parent and see what you remove related to the parent! If someone else's code is involved in the merge (which is almost always the case), do that diff twice just to make sure you have not missed anything!
author Daniil Alexeyevsky <dendik@kodomo.fbb.msu.ru>
date Mon, 11 Jul 2011 14:29:54 +0400
parents
children 61e5d8e146c7
line source
1 #!/usr/bin/python
2 # http://disruption.ca/gutil/example3/example3a.html
3 # vim: set noet:
5 import gutil
6 import pygame
7 from pygame.locals import *
8 from OpenGL.GL import *
10 from Image import Image
13 def main():
14 pygame.init()
15 gutil.initializeDisplay(800, 600)
17 done = False
19 cow = Image('cow')
20 alien = Image('alien')
22 white = (255,255,255,255)
23 stringTex, w, h, tw, th = gutil.loadText("Cow!", color=white)
24 stringDL = gutil.createTexDL(stringTex, tw, th)
26 while not done:
27 glClear(GL_COLOR_BUFFER_BIT)
28 glLoadIdentity()
29 glColor4f(1.0,1.0,1.0,1.0)
30 glTranslatef(100, 400, 0)
31 glCallList(stringDL)
33 cow.draw(pos=(100,100),width=128,height=128)
34 alien.draw(pos=(400, 400),rotation=-15,color=(.9,.3,.2,1))
37 pygame.display.flip()
39 eventlist = pygame.event.get()
40 for event in eventlist:
41 if event.type == QUIT \
42 or event.type == KEYDOWN and event.key == K_ESCAPE:
43 done = True
45 if __name__ == '__main__':
46 main()