assets

package
v0.0.0-...-8e5a076 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: GPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const AssetFolderEnv = "ASSET_PATH"

Variables

View Source
var BuiltinFilesystem fs.Filesystem = &builtinFilesystem{}

FS is the global asset filesystem todo: remove this global variable to avoid the temptation of using it everywhere

Functions

func FindFileInParents

func FindFileInParents(name, path string) (string, error)

func Hash

func Hash(v any) string

Types

type Asset

type Asset interface {
	Key() string
	Version() int
}

type Mesh

type Mesh interface {
	Asset

	// LoadMesh is called by mesh caches and loaders, and should return the mesh data.
	LoadMesh(assets fs.Filesystem) vertex.Mesh
}

type Shader

type Shader interface {
	Asset

	LoadShader(fs.Filesystem, *device.Device) *shader.Shader
}

type Texture

type Texture interface {
	Asset

	// LoadTexture is called by texture caches and loaders, and should return the texture data.
	// Its unfortunate that this method cant return the texture itself directly, since it
	// requires access to a graphics queue. The texture upload logic must be centralized somewhere.
	// Techincally not different for meshes? hmm
	// Should there be a concept on a cpu-side texture? Similar to vertex.Mesh?
	LoadTexture(assets fs.Filesystem) *texture.Data
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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