comparison pytouhou/ui/opengl/gamerenderer.pyx @ 553:8f51e34d911c

Refactor graphics backend selection, to make them fallbackable and optional.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Thu, 29 May 2014 12:31:55 +0200
parents 53fa73932e9a
children c759b97f4f81
comparison
equal deleted inserted replaced
552:aad758aef26d 553:8f51e34d911c
25 from pytouhou.utils.matrix cimport mul, new_identity 25 from pytouhou.utils.matrix cimport mul, new_identity
26 from pytouhou.utils.maths cimport perspective, setup_camera, ortho_2d 26 from pytouhou.utils.maths cimport perspective, setup_camera, ortho_2d
27 from pytouhou.game.text cimport NativeText, GlyphCollection 27 from pytouhou.game.text cimport NativeText, GlyphCollection
28 from .shaders.eosd import GameShader, BackgroundShader, PassthroughShader 28 from .shaders.eosd import GameShader, BackgroundShader, PassthroughShader
29 from .renderer cimport Texture 29 from .renderer cimport Texture
30 from .backend cimport is_legacy
30 31
31 from collections import namedtuple 32 from collections import namedtuple
32 Rect = namedtuple('Rect', 'x y w h') 33 Rect = namedtuple('Rect', 'x y w h')
33 Color = namedtuple('Color', 'r g b a') 34 Color = namedtuple('Color', 'r g b a')
34 35
35 36
36 cdef class GameRenderer(Renderer): 37 cdef class GameRenderer(Renderer):
37 def __init__(self, resource_loader, window): 38 def __init__(self, resource_loader, _):
38 self.use_fixed_pipeline = window.use_fixed_pipeline #XXX 39 self.use_fixed_pipeline = is_legacy #XXX
39 40
40 Renderer.__init__(self, resource_loader) 41 Renderer.__init__(self, resource_loader)
41 42
42 if not self.use_fixed_pipeline: 43 if not self.use_fixed_pipeline:
43 self.game_shader = GameShader() 44 self.game_shader = GameShader()