Mercurial > touhou
comparison pytouhou/ui/gamerenderer.pyx @ 464:36bc577b2392
Make the window resizable, and scale its content correctly.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Wed, 11 Sep 2013 15:55:19 +0200 |
parents | a71b912b45b7 |
children | feecdb4a8928 |
comparison
equal
deleted
inserted
replaced
463:11708a1d0a1a | 464:36bc577b2392 |
---|---|
58 game_view = setup_camera(0, 0, 1) | 58 game_view = setup_camera(0, 0, 1) |
59 self.game_mvp = game_view * self.proj | 59 self.game_mvp = game_view * self.proj |
60 self.interface_mvp = ortho_2d(0., float(game.interface.width), float(game.interface.height), 0.) | 60 self.interface_mvp = ortho_2d(0., float(game.interface.width), float(game.interface.height), 0.) |
61 | 61 |
62 | 62 |
63 cdef void render(self, game): | 63 cdef void render(self, game, window): |
64 if not self.use_fixed_pipeline: | 64 if not self.use_fixed_pipeline: |
65 self.framebuffer.bind() | 65 self.framebuffer.bind() |
66 | 66 |
67 self.render_game(game) | 67 self.render_game(game) |
68 self.render_text(game.texts + game.native_texts) | 68 self.render_text(game.texts + game.native_texts) |
69 self.render_interface(game.interface, game.boss) | 69 self.render_interface(game.interface, game.boss) |
70 | 70 |
71 if not self.use_fixed_pipeline: | 71 if not self.use_fixed_pipeline: |
72 self.passthrough_shader.bind() | 72 self.passthrough_shader.bind() |
73 self.passthrough_shader.uniform_matrix('mvp', self.interface_mvp) | 73 self.passthrough_shader.uniform_matrix('mvp', self.interface_mvp) |
74 self.render_framebuffer(self.framebuffer) | 74 self.render_framebuffer(self.framebuffer, window) |
75 | 75 |
76 | 76 |
77 cdef void render_game(self, game): | 77 cdef void render_game(self, game): |
78 cdef long game_x, game_y | 78 cdef long game_x, game_y |
79 cdef float x, y, z, dx, dy, dz, fog_data[4], fog_start, fog_end | 79 cdef float x, y, z, dx, dy, dz, fog_data[4], fog_start, fog_end |