Mercurial > touhou
comparison pytouhou/ui/renderer.pyx @ 410:9d790ca73c13
Don’t render null-sized arrays of elements.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Wed, 12 Jun 2013 16:03:30 +0200 |
parents | 1c773544eaeb |
children | 2428296cccab |
comparison
equal
deleted
inserted
replaced
409:608468be7a93 | 410:9d790ca73c13 |
---|---|
84 index = nb_vertices | 84 index = nb_vertices |
85 rec.extend((index, index + 1, index + 2, index + 2, index + 3, index)) | 85 rec.extend((index, index + 1, index + 2, index + 2, index + 3, index)) |
86 | 86 |
87 nb_vertices += 4 | 87 nb_vertices += 4 |
88 | 88 |
89 if nb_vertices == 0: | |
90 return | |
91 | |
89 if self.use_fixed_pipeline: | 92 if self.use_fixed_pipeline: |
90 glVertexPointer(3, GL_INT, sizeof(Vertex), <long> &self.vertex_buffer[0].x) | 93 glVertexPointer(3, GL_INT, sizeof(Vertex), <long> &self.vertex_buffer[0].x) |
91 glTexCoordPointer(2, GL_FLOAT, sizeof(Vertex), <long> &self.vertex_buffer[0].u) | 94 glTexCoordPointer(2, GL_FLOAT, sizeof(Vertex), <long> &self.vertex_buffer[0].u) |
92 glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(Vertex), <long> &self.vertex_buffer[0].r) | 95 glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(Vertex), <long> &self.vertex_buffer[0].r) |
93 else: | 96 else: |