Mercurial > touhou
comparison pytouhou/ui/gamerenderer.pyx @ 254:6bd565019f9a
Preload textures to avoid slowdowns during gameplay
author | Thibaut Girka <thib@sitedethib.com> |
---|---|
date | Sun, 22 Jan 2012 18:03:47 +0100 |
parents | 1d3c8c7473a2 |
children | 80e73b8245a4 |
comparison
equal
deleted
inserted
replaced
253:ea4832f843aa | 254:6bd565019f9a |
---|---|
30 def __init__(self, resource_loader, game=None, background=None): | 30 def __init__(self, resource_loader, game=None, background=None): |
31 Renderer.__init__(self, resource_loader) | 31 Renderer.__init__(self, resource_loader) |
32 | 32 |
33 self.game = game | 33 self.game = game |
34 self.background = background | 34 self.background = background |
35 | |
36 if game: | |
37 # Preload textures | |
38 self.texture_manager.preload(game.resource_loader.instanced_anms.values()) | |
35 | 39 |
36 | 40 |
37 def render(self): | 41 def render(self): |
38 glClear(GL_DEPTH_BUFFER_BIT) | 42 glClear(GL_DEPTH_BUFFER_BIT) |
39 | 43 |