RemoveTexture removes the specified Texture2d from the material
(tex *texture.Texture2D)
| 348 | |
| 349 | // RemoveTexture removes the specified Texture2d from the material |
| 350 | func (mat *Material) RemoveTexture(tex *texture.Texture2D) { |
| 351 | |
| 352 | for pos, curr := range mat.textures { |
| 353 | if curr == tex { |
| 354 | copy(mat.textures[pos:], mat.textures[pos+1:]) |
| 355 | mat.textures[len(mat.textures)-1] = nil |
| 356 | mat.textures = mat.textures[:len(mat.textures)-1] |
| 357 | break |
| 358 | } |
| 359 | } |
| 360 | } |
| 361 | |
| 362 | // HasTexture checks if the material contains the specified texture |
| 363 | func (mat *Material) HasTexture(tex *texture.Texture2D) bool { |
no outgoing calls
no test coverage detected