comparison pytouhou/ui/opengl/backend.pyx @ 590:e15672733c93

Switch to Python 3.x instead of 2.7.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Tue, 30 Sep 2014 17:14:24 +0200
parents 0768122da817
children 19d930f9e3f0
comparison
equal deleted inserted replaced
589:0768122da817 590:e15672733c93
64 try: 64 try:
65 glsl_version = {20: 110, 21: 120, 30: 130, 31: 140, 32: 150}[version] 65 glsl_version = {20: 110, 21: 120, 30: 130, 31: 140, 32: 150}[version]
66 except KeyError: 66 except KeyError:
67 assert version >= 33 67 assert version >= 33
68 glsl_version = version * 10 68 glsl_version = version * 10
69 shader_header = '#version %d\n\n' % glsl_version 69 shader_header = ('#version %d\n\n' % glsl_version).encode()
70 else: 70 else:
71 # The attribute keyword isn’t supported past GLSL ES 3.0. 71 # The attribute keyword isn’t supported past GLSL ES 3.0.
72 if version >= 30: 72 if version >= 30:
73 version = 20 73 version = 20
74 glsl_version = {20: '100', 30: '300 es'}[version] 74 glsl_version = {20: '100', 30: '300 es'}[version]
75 shader_header = '#version %s\n\nprecision highp float;\n\n' % glsl_version 75 shader_header = ('#version %s\n\nprecision highp float;\n\n' % glsl_version).encode()
76 76
77 77
78 def create_window(title, x, y, width, height, swap_interval): 78 def create_window(title, x, y, width, height, swap_interval):
79 '''Create a window (using SDL) and an OpenGL context.''' 79 '''Create a window (using SDL) and an OpenGL context.'''
80 80