本文整理汇总了Python中OpenGL.GL.glDeleteProgram方法的典型用法代码示例。如果您正苦于以下问题:Python GL.glDeleteProgram方法的具体用法?Python GL.glDeleteProgram怎么用?Python GL.glDeleteProgram使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenGL.GL
的用法示例。
在下文中一共展示了GL.glDeleteProgram方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _invalidate_device_objects
# 需要导入模块: from OpenGL import GL [as 别名]
# 或者: from OpenGL.GL import glDeleteProgram [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
示例2: link
# 需要导入模块: from OpenGL import GL [as 别名]
# 或者: from OpenGL.GL import glDeleteProgram [as 别名]
def link(self):
"""Create a shader program with from compiled shaders."""
self.program = gl.glCreateProgram()
for i in range(0, len(self.shaders)):
gl.glAttachShader(self.program, self.shaders[i])
gl.glLinkProgram(self.program)
# check linking error
result = gl.glGetProgramiv(self.program, gl.GL_LINK_STATUS)
if not(result):
raise RuntimeError(gl.glGetProgramInfoLog(self.program))
gl.glDeleteProgram(self.program)
for i in range(0, len(self.shaders)):
gl.glDeleteShader(self.shaders[i])
# Clean up
for i in range(0, len(self.shaders)):
gl.glDetachShader(self.program, self.shaders[i])
gl.glDeleteShader(self.shaders[i])
示例3: free
# 需要导入模块: from OpenGL import GL [as 别名]
# 或者: from OpenGL.GL import glDeleteProgram [as 别名]
def free(self):
if self.handle:
gl.glDeleteProgram(self.handle)
self.handle = 0
self.linked = False
示例4: __del__
# 需要导入模块: from OpenGL import GL [as 别名]
# 或者: from OpenGL.GL import glDeleteProgram [as 别名]
def __del__(self):
gl.glDeleteProgram(self.id_)
示例5: dispose_gl
# 需要导入模块: from OpenGL import GL [as 别名]
# 或者: from OpenGL.GL import glDeleteProgram [as 别名]
def dispose_gl(self):
GL.glDeleteProgram(self.shader)
self.shader = 0
for key in list(self.meshes):
mesh = self.meshes[key]
mesh.dispose_gl()
del self.meshes[key]