MCPcopy
hub / github.com/g3n/engine / SetFromRGBA

Method SetFromRGBA

texture/texture2D.go:172–182  ·  view source on GitHub ↗

SetFromRGBA sets the texture data from the specified image.RGBA object

(rgba *image.RGBA)

Source from the content-addressed store, hash-verified

170
171// SetFromRGBA sets the texture data from the specified image.RGBA object
172func (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
185func (t *Texture2D) SetData(width, height int, format int, formatType, iformat int, data interface{}) {

Callers 5

SetImageMethod · 0.95
NewTexture2DFromImageFunction · 0.80
NewTexture2DFromRGBAFunction · 0.80
SetTextMethod · 0.80
setTextCaretMethod · 0.80

Calls 2

SetDataMethod · 0.95
SizeMethod · 0.45

Tested by

no test coverage detected