textures

package module
v0.0.0-...-23b6792 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2020 License: BSD-2-Clause Imports: 10 Imported by: 1

README

Forgery/core/textures

Texture loading and management subsystem. This is the improved stuff taken from (forgery-go)[https://github.com/emily33901/forgery-go] but was originally made by Galaco.

Documentation

Index

Constants

View Source
const (

	// TextureLoaded tells other systems that a texture is loaded
	TextureLoaded = "Textures.Loaded"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Texture

type Texture struct {
	Translucent bool
	Bump        math32.Vector3
	BumpScale   float32
	// contains filtered or unexported fields
}

func Load

func Load(path string, fs *filesystem.Filesystem) (*Texture, error)

func (*Texture) EvictFromMainMemory

func (tex *Texture) EvictFromMainMemory()

func (*Texture) FilePath

func (tex *Texture) FilePath() string

FilePath Get the filepath this data was loaded from

func (*Texture) Format

func (tex *Texture) Format() uint32

Format returns this materials colour format

func (*Texture) G3nTexture

func (tex *Texture) G3nTexture() *texture.Texture2D

func (*Texture) Height

func (tex *Texture) Height() int

Height returns materials height

func (*Texture) PixelDataForFrame

func (tex *Texture) PixelDataForFrame(frame int) []byte

PixelDataForFrame get raw colour data for this frame

func (*Texture) Reload

func (tex *Texture) Reload() error

func (*Texture) Thumbnail

func (tex *Texture) Thumbnail() []byte

Thumbnail returns a small thumbnail image of a material

func (*Texture) Width

func (tex *Texture) Width() int

Width returns materials width

type TextureLoadedEvent

type TextureLoadedEvent struct {
	Path string
	Tex  *Texture
	Err  error
}

Jump to

Keyboard shortcuts

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