Mercurial > touhou
comparison pytouhou/ui/background.pyx @ 459:6e733ed817bd
Move every rendering function from gamerunner to gamerenderer.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Fri, 06 Sep 2013 22:35:54 +0200 |
parents | d56536ef28e8 |
children | bfea9e9a6845 |
comparison
equal
deleted
inserted
replaced
458:1b56d62250ab | 459:6e733ed817bd |
---|---|
40 | 40 |
41 if not use_fixed_pipeline: | 41 if not use_fixed_pipeline: |
42 glGenBuffers(1, &self.vbo) | 42 glGenBuffers(1, &self.vbo) |
43 | 43 |
44 | 44 |
45 cpdef render_background(self): | 45 cdef void render_background(self): |
46 if self.use_fixed_pipeline: | 46 if self.use_fixed_pipeline: |
47 glVertexPointer(3, GL_FLOAT, sizeof(Vertex), &self.vertex_buffer[0].x) | 47 glVertexPointer(3, GL_FLOAT, sizeof(Vertex), &self.vertex_buffer[0].x) |
48 glTexCoordPointer(2, GL_FLOAT, sizeof(Vertex), &self.vertex_buffer[0].u) | 48 glTexCoordPointer(2, GL_FLOAT, sizeof(Vertex), &self.vertex_buffer[0].u) |
49 glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(Vertex), &self.vertex_buffer[0].r) | 49 glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(Vertex), &self.vertex_buffer[0].r) |
50 else: | 50 else: |
66 | 66 |
67 if not self.use_fixed_pipeline: | 67 if not self.use_fixed_pipeline: |
68 glBindBuffer(GL_ARRAY_BUFFER, 0) | 68 glBindBuffer(GL_ARRAY_BUFFER, 0) |
69 | 69 |
70 | 70 |
71 cpdef prerender(self, background): | 71 cdef void load(self, background): |
72 cdef float ox, oy, oz, ox2, oy2, oz2 | 72 cdef float ox, oy, oz, ox2, oy2, oz2 |
73 cdef unsigned short nb_vertices = 0 | 73 cdef unsigned short nb_vertices = 0 |
74 cdef Vertex* vertex_buffer | 74 cdef Vertex* vertex_buffer |
75 | |
76 self.background = background | |
75 | 77 |
76 vertex_buffer = self.vertex_buffer | 78 vertex_buffer = self.vertex_buffer |
77 | 79 |
78 for ox, oy, oz, model_id, model in background.object_instances: | 80 for ox, oy, oz, model_id, model in background.object_instances: |
79 for ox2, oy2, oz2, width_override, height_override, sprite in model: | 81 for ox2, oy2, oz2, width_override, height_override, sprite in model: |