示例#1
0
文件: opengl.go 项目: tanema/amore
// Deinit will do the clean up for the context.
func DeInit() {
	unloadAllVolatile()
	gl.DeleteTexture(gl_state.defaultTexture)
	gl_state.defaultTexture = gl.Texture{}
	gl_state.initialized = false
	gl.ContextWatcher.OnDetach()
}
示例#2
0
文件: opengl.go 项目: tanema/amore
// deleteTexture will clean up the texture if it was bound before and also clean
// up the open gl data.
func deleteTexture(texture gl.Texture) {
	// glDeleteTextures binds texture 0 to all texture units the deleted texture
	// was bound to before deletion.
	for i, texid := range gl_state.boundTextures {
		if texid == texture {
			gl_state.boundTextures[i] = gl.Texture{Value: 0}
		}
	}

	gl.DeleteTexture(texture)
}