MCPcopy
hub / github.com/EngoEngine/engo / NewTextureSingle

Function NewTextureSingle

common/render_filetype.go:128–131  ·  view source on GitHub ↗

NewTextureSingle sends the image to the GPU and returns a `Texture` with a viewport for single-sprite images

(img Image)

Source from the content-addressed store, hash-verified

126
127// NewTextureSingle sends the image to the GPU and returns a `Texture` with a viewport for single-sprite images
128func NewTextureSingle(img Image) Texture {
129 id := UploadTexture(img)
130 return Texture{id, float32(img.Width()), float32(img.Height()), engo.AABB{Max: engo.Point{X: 1.0, Y: 1.0}}}
131}
132
133// ImageToNRGBA takes a given `image.Image` and converts it into an `image.NRGBA`. Especially useful when transforming
134// image.Uniform to something usable by `engo`.

Callers 3

NewBackgroundFunction · 0.92
RenderMethod · 0.85
generateFontAtlasMethod · 0.85

Calls 3

UploadTextureFunction · 0.85
WidthMethod · 0.65
HeightMethod · 0.65

Tested by

no test coverage detected