Statistics
| Revision:

root / PyOpenGL-Demo / tom / text.py @ 1

History | View | Annotate | Download (1.1 kB)

1 1 equemene
#!/usr/bin/python
2 1 equemene
3 1 equemene
# This is statement is required by the build system to query build info
4 1 equemene
if __name__ == '__build__':
5 1 equemene
        raise Exception
6 1 equemene
7 1 equemene
8 1 equemene
import string
9 1 equemene
__version__ = string.split('$Revision: 1.1.1.1 $')[1]
10 1 equemene
__date__ = string.join(string.split('$Date: 2007/02/15 19:25:40 $')[1:3], ' ')
11 1 equemene
__author__ = 'Tarn Weisner Burton <twburton@users.sourceforge.net>'
12 1 equemene
13 1 equemene
from OpenGL.GL import *
14 1 equemene
from OpenGL.Tk import *
15 1 equemene
16 1 equemene
from logo import define_logo
17 1 equemene
18 1 equemene
def redraw(o):
19 1 equemene
        if o.grob == -1:
20 1 equemene
                o.grob = glGenLists(1);
21 1 equemene
                glNewList(o.grob, GL_COMPILE_AND_EXECUTE);
22 1 equemene
                glMaterialfv(GL_FRONT, GL_DIFFUSE, [1., 1., 0., 0.])
23 1 equemene
                define_logo()
24 1 equemene
                glEndList()
25 1 equemene
26 1 equemene
                o.autospin = 1
27 1 equemene
28 1 equemene
                o.xspin = 1
29 1 equemene
                o.yspin = 2
30 1 equemene
31 1 equemene
                o.update()
32 1 equemene
33 1 equemene
                o.after(10, o.do_AutoSpin)
34 1 equemene
35 1 equemene
        else:
36 1 equemene
37 1 equemene
                glCallList(o.grob)
38 1 equemene
39 1 equemene
#
40 1 equemene
# Demo starts here really.
41 1 equemene
if __name__ == "__main__":
42 1 equemene
        import Tkinter, sys
43 1 equemene
44 1 equemene
        o = Opengl(None, width = 400, height = 200, double = 1, depth = 1)
45 1 equemene
        o.pack(expand = 1, fill = 'both')
46 1 equemene
47 1 equemene
        o.redraw = redraw
48 1 equemene
        o.set_centerpoint(30., 2., 0.)
49 1 equemene
        o.set_eyepoint(80.)
50 1 equemene
51 1 equemene
        o.grob = -1
52 1 equemene
53 1 equemene
        o.autospin_allowed = 1
54 1 equemene
55 1 equemene
        # Enter the tk mainloop.
56 1 equemene
57 1 equemene
        Tkinter.mainloop()