本文整理汇总了Python中OpenGL.GL.glDeleteTextures方法的典型用法代码示例。如果您正苦于以下问题:Python GL.glDeleteTextures方法的具体用法?Python GL.glDeleteTextures怎么用?Python GL.glDeleteTextures使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenGL.GL
的用法示例。
在下文中一共展示了GL.glDeleteTextures方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: refresh_font_texture
# 需要导入模块: from OpenGL import GL [as 别名]
# 或者: from OpenGL.GL import glDeleteTextures [as 别名]
def refresh_font_texture(self):
# save texture state
last_texture = gl.glGetIntegerv(gl.GL_TEXTURE_BINDING_2D)
width, height, pixels = self.io.fonts.get_tex_data_as_rgba32()
if self._font_texture is not None:
gl.glDeleteTextures([self._font_texture])
self._font_texture = gl.glGenTextures(1)
gl.glBindTexture(gl.GL_TEXTURE_2D, self._font_texture)
gl.glTexParameteri(gl.GL_TEXTURE_2D, gl.GL_TEXTURE_MIN_FILTER, gl.GL_LINEAR)
gl.glTexParameteri(gl.GL_TEXTURE_2D, gl.GL_TEXTURE_MAG_FILTER, gl.GL_LINEAR)
gl.glTexImage2D(gl.GL_TEXTURE_2D, 0, gl.GL_RGBA, width, height, 0, gl.GL_RGBA, gl.GL_UNSIGNED_BYTE, pixels)
self.io.fonts.texture_id = self._font_texture
gl.glBindTexture(gl.GL_TEXTURE_2D, last_texture)
self.io.fonts.clear_tex_data()
示例2: _invalidate_device_objects
# 需要导入模块: from OpenGL import GL [as 别名]
# 或者: from OpenGL.GL import glDeleteTextures [as 别名]
def _invalidate_device_objects(self):
if self._vao_handle > -1:
gl.glDeleteVertexArrays(1, [self._vao_handle])
if self._vbo_handle > -1:
gl.glDeleteBuffers(1, [self._vbo_handle])
if self._elements_handle > -1:
gl.glDeleteBuffers(1, [self._elements_handle])
self._vao_handle = self._vbo_handle = self._elements_handle = 0
gl.glDeleteProgram(self._shader_handle)
self._shader_handle = 0
if self._font_texture > -1:
gl.glDeleteTextures([self._font_texture])
self.io.fonts.texture_id = 0
self._font_texture = 0
示例3: free
# 需要导入模块: from OpenGL import GL [as 别名]
# 或者: from OpenGL.GL import glDeleteTextures [as 别名]
def free(self):
if self.textureId:
gl.glDeleteTextures(1, self.textureId)
self.textureId = 0
示例4: free
# 需要导入模块: from OpenGL import GL [as 别名]
# 或者: from OpenGL.GL import glDeleteTextures [as 别名]
def free(self):
if self.texture:
gl.glDeleteTextures(1, self.texture)
self.texture = 0
if self.depthBuffer:
gl.glDeleteRenderbuffers(1, self.depthBuffer)
self.depthBuffer = 0
if self.buffer:
gl.glDeleteFramebuffers(1, self.buffer)
self.buffer = 0
示例5: delete
# 需要导入模块: from OpenGL import GL [as 别名]
# 或者: from OpenGL.GL import glDeleteTextures [as 别名]
def delete(self):
if self._texID is not None:
GL.glDeleteTextures(self._texID)
示例6: delete
# 需要导入模块: from OpenGL import GL [as 别名]
# 或者: from OpenGL.GL import glDeleteTextures [as 别名]
def delete(self):
GL.glDeleteRenderbuffers(1, [self.depth_buffer_id])
self.depth_buffer_id = None
GL.glDeleteTextures(self.render_texture_id)
self.render_texture_id = None
GL.glDeleteFramebuffers(1, [self.render_framebuffer_id])
self.render_framebuffer_id = None
GL.glDeleteTextures(self.resolve_texture_id)
self.resolve_texture_id = None
GL.glDeleteFramebuffers(1, [self.resolve_framebuffer_id])
self.resolve_framebuffer_id = None