Documentation
¶
Overview ¶
Package assets loads and caches game content: images, sound effects and music.
Index ¶
Constants ¶
View Source
const SampleRate = 48000
SampleRate is the audio pipeline rate every stream is decoded to.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache loads and memoizes content by file path. Each Game owns one, so the same file is decoded and uploaded to the GPU only once.
func (*Cache) Image ¶
Image returns the cached image for a path, loading it on first use. It panics with a clear message on a missing or broken file: a game with a missing sprite is a programming bug, not a runtime condition.
Click to show internal directories.
Click to hide internal directories.