root / PyOpenGL-Demo / tom / first.py @ 2
Historique | Voir | Annoter | Télécharger (604 octet)
| 1 |
#!/usr/bin/python
|
|---|---|
| 2 |
|
| 3 |
# This is statement is required by the build system to query build info
|
| 4 |
if __name__ == '__build__': |
| 5 |
raise Exception |
| 6 |
|
| 7 |
|
| 8 |
import string |
| 9 |
__version__ = string.split('$Revision: 1.1.1.1 $')[1] |
| 10 |
__date__ = string.join(string.split('$Date: 2007/02/15 19:25:38 $')[1:3], ' ') |
| 11 |
__author__ = 'Tarn Weisner Burton <twburton@users.sourceforge.net>'
|
| 12 |
|
| 13 |
from OpenGL.GL import * |
| 14 |
from OpenGL.Tk import * |
| 15 |
|
| 16 |
def redraw(o): |
| 17 |
glClearColor(0, 0, 1, 0) |
| 18 |
glClear(GL_COLOR_BUFFER_BIT) |
| 19 |
|
| 20 |
o = Opengl(width = 200, height = 200, double = 1) |
| 21 |
o.redraw = redraw |
| 22 |
o.pack(side = 'top', expand = 1, fill = 'both') |
| 23 |
o.mainloop() |