changeset 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 608468be7a93
children 2428296cccab
files pytouhou/ui/renderer.pyx
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/pytouhou/ui/renderer.pyx
+++ b/pytouhou/ui/renderer.pyx
@@ -86,6 +86,9 @@ cdef class Renderer:
 
                 nb_vertices += 4
 
+        if nb_vertices == 0:
+            return
+
         if self.use_fixed_pipeline:
             glVertexPointer(3, GL_INT, sizeof(Vertex), <long> &self.vertex_buffer[0].x)
             glTexCoordPointer(2, GL_FLOAT, sizeof(Vertex), <long> &self.vertex_buffer[0].u)