comparison pytouhou/ui/opengl/gamerenderer.pyx @ 596:ab131d04987d

Fix a regression introduced in the previous commit when the interface has a different resolution than 640×480 and framebuffer_blit is enabled.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 25 Oct 2014 18:49:41 +0200
parents 19d930f9e3f0
children 3c2f96f1d715
comparison
equal deleted inserted replaced
595:b7b4a234bf70 596:ab131d04987d
25 glGetTexImage, GL_TEXTURE_2D, GL_RGB, GL_UNSIGNED_BYTE) 25 glGetTexImage, GL_TEXTURE_2D, GL_RGB, GL_UNSIGNED_BYTE)
26 26
27 from pytouhou.utils.matrix cimport mul, new_identity 27 from pytouhou.utils.matrix cimport mul, new_identity
28 from pytouhou.utils.maths cimport perspective, setup_camera, ortho_2d 28 from pytouhou.utils.maths cimport perspective, setup_camera, ortho_2d
29 from pytouhou.game.text cimport NativeText, GlyphCollection 29 from pytouhou.game.text cimport NativeText, GlyphCollection
30 from pytouhou.ui.window cimport Window
30 from .shaders.eosd import GameShader, BackgroundShader, PassthroughShader 31 from .shaders.eosd import GameShader, BackgroundShader, PassthroughShader
31 from .renderer cimport Texture 32 from .renderer cimport Texture
32 from .backend cimport is_legacy, use_debug_group, use_pack_invert 33 from .backend cimport is_legacy, use_debug_group, use_pack_invert
33 34
34 from collections import namedtuple 35 from collections import namedtuple
35 Rect = namedtuple('Rect', 'x y w h') 36 Rect = namedtuple('Rect', 'x y w h')
36 Color = namedtuple('Color', 'r g b a') 37 Color = namedtuple('Color', 'r g b a')
37 38
38 39
39 cdef class GameRenderer(Renderer): 40 cdef class GameRenderer(Renderer):
40 def __init__(self, resource_loader, _): 41 def __init__(self, resource_loader, Window window):
41 Renderer.__init__(self, resource_loader) 42 Renderer.__init__(self, resource_loader)
42 43
43 if not is_legacy: 44 if not is_legacy:
44 self.game_shader = GameShader() 45 self.game_shader = GameShader()
45 self.background_shader = BackgroundShader() 46 self.background_shader = BackgroundShader()
46 self.interface_shader = self.game_shader 47 self.interface_shader = self.game_shader
47 self.passthrough_shader = PassthroughShader() 48 self.passthrough_shader = PassthroughShader()
48 49
49 self.framebuffer = Framebuffer(0, 0, 640, 480) 50 self.framebuffer = Framebuffer(0, 0, window.width, window.height)
50 51
51 52
52 def __dealloc__(self): 53 def __dealloc__(self):
53 if self.game_mvp != NULL: 54 if self.game_mvp != NULL:
54 free(self.game_mvp) 55 free(self.game_mvp)