assets

package
v0.19.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Textures     = make(map[uint32]Texture)
	TexturePaths = make(map[string]uint32)
)

Functions

func AddTextureToCache added in v0.12.10

func AddTextureToCache(t Texture)

Types

type ColorFormat

type ColorFormat int
const (
	ColorFormat_RGBA8 ColorFormat = iota
)

type Cubemap added in v0.14.0

type Cubemap struct {
	// These only exists for textures loaded from disk
	RightPath string
	LeftPath  string
	TopPath   string
	BotPath   string
	FrontPath string
	BackPath  string
	TexID     uint32
}

func LoadCubemapTextures added in v0.14.0

func LoadCubemapTextures(rightTex, leftTex, topTex, botTex, frontTex, backTex string) (Cubemap, error)

type Texture

type Texture struct {
	//Path only exists for textures loaded from disk
	Path   string
	TexID  uint32
	Width  int32
	Height int32
	Pixels []byte
}

func GetTextureFromCacheID added in v0.12.10

func GetTextureFromCacheID(texID uint32) (Texture, bool)

func GetTextureFromCachePath added in v0.12.10

func GetTextureFromCachePath(path string) (Texture, bool)

func LoadTextureInMemPngImg added in v0.14.0

func LoadTextureInMemPngImg(img image.Image, loadOptions *TextureLoadOptions) (Texture, error)

func LoadTextureJpeg added in v0.14.0

func LoadTextureJpeg(file string, loadOptions *TextureLoadOptions) (Texture, error)

func LoadTexturePNG added in v0.12.12

func LoadTexturePNG(file string, loadOptions *TextureLoadOptions) (Texture, error)

type TextureLoadOptions added in v0.12.10

type TextureLoadOptions struct {
	TryLoadFromCache bool
	WriteToCache     bool
	GenMipMaps       bool
	KeepPixelsInMem  bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL