Mercurial > touhou
comparison pytouhou/ui/opengl/backend.pyx @ 555:98380e4a0ee5
Switch to libepoxy instead of libGLEW, which will help with OpenGL portability.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sat, 19 Apr 2014 19:05:06 +0200 |
parents | 653a9f087673 |
children | c34b23e29d16 |
comparison
equal
deleted
inserted
replaced
554:653a9f087673 | 555:98380e4a0ee5 |
---|---|
3 | 3 |
4 from pytouhou.lib.opengl cimport \ | 4 from pytouhou.lib.opengl cimport \ |
5 (glEnable, glHint, glEnableClientState, GL_TEXTURE_2D, GL_BLEND, | 5 (glEnable, glHint, glEnableClientState, GL_TEXTURE_2D, GL_BLEND, |
6 GL_PERSPECTIVE_CORRECTION_HINT, GL_FOG_HINT, GL_NICEST, | 6 GL_PERSPECTIVE_CORRECTION_HINT, GL_FOG_HINT, GL_NICEST, |
7 GL_COLOR_ARRAY, GL_VERTEX_ARRAY, GL_TEXTURE_COORD_ARRAY) | 7 GL_COLOR_ARRAY, GL_VERTEX_ARRAY, GL_TEXTURE_COORD_ARRAY) |
8 | |
9 IF USE_GLEW: | |
10 from pytouhou.lib.opengl cimport glewInit | |
11 | 8 |
12 | 9 |
13 GameRenderer = None | 10 GameRenderer = None |
14 | 11 |
15 | 12 |
47 flags |= sdl.WINDOW_RESIZABLE | 44 flags |= sdl.WINDOW_RESIZABLE |
48 | 45 |
49 window = Window(title, x, y, width, height, flags) | 46 window = Window(title, x, y, width, height, flags) |
50 window.gl_create_context() | 47 window.gl_create_context() |
51 | 48 |
52 if USE_GLEW: | |
53 if glewInit() != 0: | |
54 raise Exception('GLEW init fail!') | |
55 | |
56 # Initialize OpenGL | 49 # Initialize OpenGL |
57 glEnable(GL_BLEND) | 50 glEnable(GL_BLEND) |
58 if is_legacy: | 51 if is_legacy: |
59 glEnable(GL_TEXTURE_2D) | 52 glEnable(GL_TEXTURE_2D) |
60 glHint(GL_FOG_HINT, GL_NICEST) | 53 glHint(GL_FOG_HINT, GL_NICEST) |