package assets
Constants
TextureSquare
"square.png"
TextureCube
"cube.png"
TextureBlankSquare
"blank_square.png"
MaterialDefinitionGrid
"grid.material"
MaterialDefinitionUnlit
"unlit.material"
MaterialDefinitionUnlitTransparent
"unlit_transparent.material"
MaterialDefinitionBasic
"basic.material"
MaterialDefinitionBasicTransparent
"basic_transparent.material"
MaterialDefinitionPBR
"pbr.material"
MaterialDefinitionTerrain
"terrain.material"
MaterialDefinitionBasicSkinned
"basic_skinned.material"
MaterialDefinitionText3D
"text3d.material"
MaterialDefinitionText3DTransparent
"text3d_transparent.material"
MaterialDefinitionText
"text.material"
MaterialDefinitionTextTransparent
"text_transparent.material"
MaterialDefinitionCombine
"combine.material"
MaterialDefinitionComposite
"composite.material"
MaterialDefinitionUI
"ui.material"
MaterialDefinitionUITransparent
"ui_transparent.material"
MaterialDefinitionSprite
"sprite.material"
MaterialDefinitionSpriteTransparent
"sprite_transparent.material"
MaterialDefinitionLightDepth
"light_depth.material"
MaterialDefinitionLightDepthCSM1
"light_depth_csm1.material"
MaterialDefinitionLightDepthCSM2
"light_depth_csm2.material"
MaterialDefinitionLightCubeDepth
"light_cube_depth.material"
MaterialDefinitionParticle
"particle.material"
MaterialDefinitionParticleTransparent
"particle_transparent.material"
MaterialDefinitionEdTransformWire
"ed_transform_wire.material"
MaterialDefinitionEdFrustumWire
"ed_frustum_wire.material"
MaterialDefinitionEdGizmo
"ed_gizmo.material"
ShaderTextVert
"text.vert.spv"
ShaderTextFrag
"text.frag.spv"
ShaderText3DVert
"text3d.vert.spv"
ShaderText3DFrag
ShaderTextFrag
ShaderCompositeVert
"composite.vert.spv"
ShaderCompositeFrag
"composite.frag.spv"
ShaderHdrVert
"hdr.vert.spv"
ShaderHdrFrag
"hdr.frag.spv"
ShaderUIVert
"ui.vert.spv"
ShaderUIFrag
"ui.frag.spv"
ShadersUINineFrag
"ui_nine.frag.spv"
Types
ArchiveDatabase
struct
ArchiveDatabase.Cache
ArchiveDatabase.CacheClear
ArchiveDatabase.CacheRemove
ArchiveDatabase.Close
ArchiveDatabase.Exists
ArchiveDatabase.PostWindowCreate
ArchiveDatabase.Read
ArchiveDatabase.ReadText
Database
interface
type Database interface {
// PostWindowCreate is a hook that is called after a window has been
// created. Implementations can use the provided handle to perform any
// platform‑specific initialisation. Most implementations are no‑ops.
PostWindowCreate(windowHandle PostWindowCreateHandle) error
// Cache stores the raw byte slice `data` under `key` for fast subsequent
// reads. Implementations may choose to ignore this (e.g. DebugContentDatabase)
// or provide a real cache (e.g. FileDatabase).
Cache(key string, data []byte)
// CacheRemove removes a cached entry identified by `key`. If the
// implementation does not maintain a cache this is a no‑op.
CacheRemove(key string)
// CacheClear clears all cached entries. Implementations without a cache
// should simply return.
CacheClear()
// Read returns the raw bytes for the asset identified by `key`. An error is
// returned if the asset cannot be found or read.
Read(key string) ([]byte, error)
// ReadText is a convenience wrapper around Read that returns the asset as a
// string. It returns any error from Read.
ReadText(key string) (string, error)
// Exists reports whether an asset with the given `key` is available in the
// underlying storage. Implementations should check both the cache and the
// backing store.
Exists(key string) bool
// Close releases any resources held by the implementation. Implementations
// that have no resources may implement this as a no‑op.
Close()
}
Database defines the contract for asset storage back‑ends used by the engine. Implementations may store assets on disk, in memory, inside an archive, or provide a debug view of the file system. The interface abstracts common operations required by the engine and editor.
NewArchiveDatabase
NewFileDatabase
DebugContentDatabase
struct
DebugContentDatabase.Cache
DebugContentDatabase.CacheClear
DebugContentDatabase.CacheRemove
DebugContentDatabase.Close
DebugContentDatabase.Exists
DebugContentDatabase.PostWindowCreate
DebugContentDatabase.Read
DebugContentDatabase.ReadText
FileDatabase
struct
FileDatabase.Cache
FileDatabase.CacheClear
FileDatabase.CacheRemove
FileDatabase.Close
FileDatabase.Exists
FileDatabase.PostWindowCreate
FileDatabase.Read
FileDatabase.ReadText
MockDatabase
struct
MockDatabase implements the assets.Database interface for testing.
NewMockDB
MockDatabase.AddFile
MockDatabase.Cache
MockDatabase.CacheClear
MockDatabase.CacheRemove
MockDatabase.Close
MockDatabase.Exists
MockDatabase.PostWindowCreate
MockDatabase.Read
MockDatabase.ReadText
MockDatabase.RemoveFile
PostWindowCreateHandle
interface