A little bit of work.
[krufty_fps.git] / test.py
blob6ed72fddf7e0d276dc9bf2b30ffd2f56672a4051
1 #!/usr/bin/python
3 # This is my exploration in pyopengl land
5 import sys, os
7 from OpenGL.GL import *
8 from OpenGL.GLUT import *
9 from OpenGL import Tk
11 WINDOW_SIZE = (800, 600)
12 WINDOW_TITLE = "Whee!"
14 def init():
16 glutInit(sys.argv)
17 glutInitDisplayMode(GLUT_RGB|GLUT_DEPTH|GLUT_DOUBLE)
18 glutInitWindowSize(WINDOW_SIZE[0], WINDOW_SIZE[1])
19 glutCreateWindow(WINDOW_TITLE)
21 glClearColor(0.0, 0.0, 0.0, 0.0)
23 return
25 def display():
27 glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT)
28 glColor3f(0.0, 1.0, 0.0);
29 glRectf(-0.75,0.75, 0.75, -0.75);
30 glutSwapBuffers()
32 return
34 def run():
35 glutDisplayFunc(display)
36 glutMainLoop()
38 def main():
40 init()
42 run()
44 return
46 if __name__ == '__main__':
47 main()