view sandbox/gl.py @ 191:73f9779491ef
Renamed lib to allpy
Previously, every import looked like "from allpy.lib import ...", which
was ridiculous.
Consequences:
1. Uses of the package look like "from allpy import"
2. When testing the package locally, you have to add `pwd` to PYTHONPATH,
not `pwd`/.. (this is a good thing (tm))
3. It is now possible to make a proper Debian package
The change renames directory & fixes all imports referencing allpy.lib
The results are untested since there were no working tests before the
change.
author |
Daniil Alexeyevsky <me.dendik@gmail.com> |
date |
Thu, 18 Nov 2010 19:38:05 +0300 |
parents |
|
children |
61e5d8e146c7 |
line source
2 # http://disruption.ca/gutil/example3/example3a.html
7 from pygame.locals import *
8 from OpenGL.GL import *
10 from Image import Image
15 gutil.initializeDisplay(800, 600)
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)
27 glClear(GL_COLOR_BUFFER_BIT)
29 glColor4f(1.0,1.0,1.0,1.0)
30 glTranslatef(100, 400, 0)
33 cow.draw(pos=(100,100),width=128,height=128)
34 alien.draw(pos=(400, 400),rotation=-15,color=(.9,.3,.2,1))
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:
45 if __name__ == '__main__':