示例#1
0
 def draw(self, fbo, texture):
     GL.glBindFramebuffer(GL.GL_FRAMEBUFFER, fbo[0])
     GL.glActiveTexture(GL.GL_TEXTURE0)
     texture.bind()
     GL.glBindVertexArray(self.vertex_array[0])
     GL.glDrawArrays(GL.GL_TRIANGLE_FAN, 0, 4)
     GL.glBindVertexArray(0)
     GL.glBindTexture(GL.GL_TEXTURE_2D, 0)
示例#2
0
 def __del__(self):
     try:
         GL.glDeleteBuffers(2, self.vertex_buffer)
         GL.glDeleteVertexArrays(1, self.vertex_array)
         GL.glBindTexture(GL.GL_TEXTURE_2D, 0)
     except:
         #TODO: Make sure GL objects are deleted in the correct context
         pass
示例#3
0
 def gl_delete(self):
     GL.glDeleteBuffers(2, self.vertex_buffer)
     GL.glDeleteVertexArrays(1, self.vertex_array)
     GL.glBindTexture(GL.GL_TEXTURE_2D, 0)