本文整理匯總了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