SetImage sets a new image for this texture
(imgfile string)
| 158 | |
| 159 | // SetImage sets a new image for this texture |
| 160 | func (t *Texture2D) SetImage(imgfile string) error { |
| 161 | |
| 162 | // Decodes image file into RGBA8 |
| 163 | rgba, err := DecodeImage(imgfile) |
| 164 | if err != nil { |
| 165 | return err |
| 166 | } |
| 167 | t.SetFromRGBA(rgba) |
| 168 | return nil |
| 169 | } |
| 170 | |
| 171 | // SetFromRGBA sets the texture data from the specified image.RGBA object |
| 172 | func (t *Texture2D) SetFromRGBA(rgba *image.RGBA) { |
nothing calls this directly
no test coverage detected