comparison pytouhou/ui/opengl/renderer.pyx @ 617:a6af3ff86612

Change all “void except *” function into “bint except True”, to prevent PyErr_Occurred() from being called at each call.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sun, 29 Mar 2015 00:08:20 +0100
parents a6a191e371c7
children ec972eb44391
comparison
equal deleted inserted replaced
616:4ce3ef053a25 617:a6af3ff86612
128 glEnableVertexAttribArray(2) 128 glEnableVertexAttribArray(2)
129 129
130 glBindBuffer(GL_ARRAY_BUFFER, 0) 130 glBindBuffer(GL_ARRAY_BUFFER, 0)
131 131
132 132
133 cdef void render_elements(self, elements) except *: 133 cdef bint render_elements(self, elements) except True:
134 cdef Element element 134 cdef Element element
135 135
136 nb_elements = find_objects(self, elements) 136 nb_elements = find_objects(self, elements)
137 if not nb_elements: 137 if not nb_elements:
138 return 138 return False
139 139
140 nb_vertices = 0 140 nb_vertices = 0
141 memset(self.last_indices, 0, sizeof(self.last_indices)) 141 memset(self.last_indices, 0, sizeof(self.last_indices))
142 142
143 for element_idx in range(nb_elements): 143 for element_idx in range(nb_elements):
230 230
231 if use_debug_group: 231 if use_debug_group:
232 glPopDebugGroup() 232 glPopDebugGroup()
233 233
234 234
235 cdef void render_quads(self, rects, colors, GLuint texture) except *: 235 cdef bint render_quads(self, rects, colors, GLuint texture) except True:
236 # There is nothing that batch more than two quads on the same texture, currently. 236 # There is nothing that batch more than two quads on the same texture, currently.
237 cdef Vertex buf[8] 237 cdef Vertex buf[8]
238 cdef unsigned short indices[12] 238 cdef unsigned short indices[12]
239 239
240 if not is_legacy: 240 if not is_legacy: