Révision 11 PyOpenGL-Demo/redbook/cube.py

cube.py (revision 11)
2 2

  
3 3
# This is statement is required by the build system to query build info
4 4
if __name__ == '__build__':
5
	raise Exception
5
	raise(Exception)
6 6

  
7 7
'''
8 8

  
......
60 60
  from OpenGL.GL import *
61 61
  from OpenGL.GLU import *
62 62
except:
63
  print '''
63
  print('''
64 64
ERROR: PyOpenGL not installed properly.  
65
        '''
65
        ''')
66 66

  
67 67
def init(): 
68 68
   glClearColor (0.0, 0.0, 0.0, 0.0)
......
86 86
   glMatrixMode (GL_MODELVIEW)
87 87

  
88 88
def keyboard(key, x, y):
89
   if key == chr(27):
89
   if key == str.encode(chr(27)):
90 90
      import sys
91 91
      sys.exit(0)
92 92

  
......
94 94
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB)
95 95
glutInitWindowSize (500, 500)
96 96
glutInitWindowPosition (100, 100)
97
glutCreateWindow ('cube')
97
glutCreateWindow (b'cube')
98 98
init ()
99 99
glutDisplayFunc(display)
100 100
glutReshapeFunc(reshape)

Formats disponibles : Unified diff