SetFromRGBA sets the texture data from the specified image.RGBA object
(rgba *image.RGBA)
| 170 | |
| 171 | // SetFromRGBA sets the texture data from the specified image.RGBA object |
| 172 | func (t *Texture2D) SetFromRGBA(rgba *image.RGBA) { |
| 173 | |
| 174 | t.SetData( |
| 175 | rgba.Rect.Size().X, |
| 176 | rgba.Rect.Size().Y, |
| 177 | gls.RGBA, |
| 178 | gls.UNSIGNED_BYTE, |
| 179 | gls.RGBA8, |
| 180 | rgba.Pix, |
| 181 | ) |
| 182 | } |
| 183 | |
| 184 | // SetData sets the texture data |
| 185 | func (t *Texture2D) SetData(width, height int, format int, formatType, iformat int, data interface{}) { |
no test coverage detected