Beispiel #1
0
// 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()
}
Beispiel #2
0
// 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)
}