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

Function NewTextureResource

common/render_filetype.go:122–125  ·  view source on GitHub ↗

NewTextureResource sends the image to the GPU and returns a `TextureResource` for easy access

(img Image)

Source from the content-addressed store, hash-verified

120
121// NewTextureResource sends the image to the GPU and returns a `TextureResource` for easy access
122func NewTextureResource(img Image) TextureResource {
123 id := UploadTexture(img)
124 return TextureResource{Texture: id, Width: float32(img.Width()), Height: float32(img.Height())}
125}
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 {

Callers 1

LoadMethod · 0.85

Calls 3

UploadTextureFunction · 0.85
WidthMethod · 0.65
HeightMethod · 0.65

Tested by

no test coverage detected