當前位置: 首頁>>代碼示例>>Python>>正文


Python GL.glDeleteTextures方法代碼示例

本文整理匯總了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() 
開發者ID:swistakm,項目名稱:pyimgui,代碼行數:21,代碼來源:opengl.py

示例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 
開發者ID:swistakm,項目名稱:pyimgui,代碼行數:18,代碼來源:opengl.py

示例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 
開發者ID:bitsawer,項目名稱:renpy-shader,代碼行數:6,代碼來源:texture.py

示例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 
開發者ID:bitsawer,項目名稱:renpy-shader,代碼行數:12,代碼來源:framebuffer.py

示例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) 
開發者ID:mcgreentn,項目名稱:GDMC,代碼行數:5,代碼來源:glutils.py

示例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 
開發者ID:cmbruns,項目名稱:pyopenvr,代碼行數:13,代碼來源:hellovr_glfw.py


注:本文中的OpenGL.GL.glDeleteTextures方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。