Documentation ¶
Index ¶
- Variables
- type CubeTexture
- type CubeTextureSide
- type Decodable
- type Dependency
- type DirRegistry
- func (r *DirRegistry) DeleteContent(guid string) error
- func (r *DirRegistry) DeletePreview(guid string) error
- func (r *DirRegistry) ReadContent(guid string, target Decodable) error
- func (r *DirRegistry) ReadDependencies() ([]Dependency, error)
- func (r *DirRegistry) ReadPreview(guid string) (image.Image, error)
- func (r *DirRegistry) ReadResources() ([]Resource, error)
- func (r *DirRegistry) WriteContent(guid string, target Encodable) error
- func (r *DirRegistry) WriteDependencies(dependencies []Dependency) error
- func (r *DirRegistry) WritePreview(guid string, img image.Image) error
- func (r *DirRegistry) WriteResources(resources []Resource) error
- type Encodable
- type FilterMode
- type Registry
- type Resource
- type TexelFormat
- type TwoDTexture
- type WebRegistry
- func (r *WebRegistry) DeleteContent(guid string) error
- func (r *WebRegistry) DeletePreview(guid string) error
- func (r *WebRegistry) ReadContent(guid string, target Decodable) error
- func (r *WebRegistry) ReadDependencies() ([]Dependency, error)
- func (r *WebRegistry) ReadPreview(guid string) (image.Image, error)
- func (r *WebRegistry) ReadResources() ([]Resource, error)
- func (r *WebRegistry) WriteContent(guid string, target Encodable) error
- func (r *WebRegistry) WriteDependencies(dependencies []Dependency) error
- func (r *WebRegistry) WritePreview(guid string, img image.Image) error
- func (r *WebRegistry) WriteResources(resources []Resource) error
- type WrapMode
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = fmt.Errorf("not found")
ErrNotFound indicates that the specified content is not available.
Functions ¶
This section is empty.
Types ¶
type CubeTexture ¶
type CubeTexture struct { Dimension uint16 MagFilter FilterMode MinFilter FilterMode Format TexelFormat FrontSide CubeTextureSide BackSide CubeTextureSide LeftSide CubeTextureSide RightSide CubeTextureSide TopSide CubeTextureSide BottomSide CubeTextureSide }
func (*CubeTexture) DecodeFrom ¶
func (t *CubeTexture) DecodeFrom(in io.Reader) error
type CubeTextureSide ¶
type CubeTextureSide struct {
Data []byte
}
type Dependency ¶
Dependency describes the dependency of a source asset to a target asset.
type DirRegistry ¶
type DirRegistry struct {
// contains filtered or unexported fields
}
DirRegistry is an implementation of Registry that stores content on the local filesystem.
func NewDirRegistry ¶
func NewDirRegistry(dir string) (*DirRegistry, error)
NewDirRegistry creates a Registry implementation that stores content on the filesystem. The provided dir parameter needs to point to the project root. A special assets directory will be created inside if one is not available already.
func (*DirRegistry) DeleteContent ¶
func (r *DirRegistry) DeleteContent(guid string) error
func (*DirRegistry) DeletePreview ¶
func (r *DirRegistry) DeletePreview(guid string) error
func (*DirRegistry) ReadContent ¶
func (r *DirRegistry) ReadContent(guid string, target Decodable) error
func (*DirRegistry) ReadDependencies ¶
func (r *DirRegistry) ReadDependencies() ([]Dependency, error)
func (*DirRegistry) ReadPreview ¶
func (r *DirRegistry) ReadPreview(guid string) (image.Image, error)
func (*DirRegistry) ReadResources ¶
func (r *DirRegistry) ReadResources() ([]Resource, error)
func (*DirRegistry) WriteContent ¶
func (r *DirRegistry) WriteContent(guid string, target Encodable) error
func (*DirRegistry) WriteDependencies ¶
func (r *DirRegistry) WriteDependencies(dependencies []Dependency) error
func (*DirRegistry) WritePreview ¶
func (r *DirRegistry) WritePreview(guid string, img image.Image) error
func (*DirRegistry) WriteResources ¶
func (r *DirRegistry) WriteResources(resources []Resource) error
type FilterMode ¶
type FilterMode uint8
const ( FilterModeUnspecified FilterMode = iota FilterModeNearest FilterModeLinear FilterModeNearestMipmapNearest FilterModeNearestMipmapLinear FilterModeLinearMipmapNearest FilterModeLinearMipmapLinear )
type Registry ¶
type Registry interface { ReadResources() ([]Resource, error) WriteResources(resources []Resource) error ReadDependencies() ([]Dependency, error) WriteDependencies(dependencies []Dependency) error ReadPreview(guid string) (image.Image, error) WritePreview(guid string, img image.Image) error DeletePreview(guid string) error ReadContent(guid string, target Decodable) error WriteContent(guid string, target Encodable) error DeleteContent(guid string) error }
Registry represents a managment interface for assets.
type TexelFormat ¶
type TexelFormat uint32
const ( TexelFormatUnspecified TexelFormat = iota TexelFormatR8 TexelFormatR16 TexelFormatR32F TexelFormatRG8 TexelFormatRG16 TexelFormatRG32F TexelFormatRGB8 TexelFormatRGB16 TexelFormatRGB32F TexelFormatRGBA8 TexelFormatRGBA16 TexelFormatRGBA32F TexelFormatDepth32F )
type TwoDTexture ¶
type TwoDTexture struct { Width uint16 Height uint16 WrapModeS WrapMode WrapModeT WrapMode MagFilter FilterMode MinFilter FilterMode Format TexelFormat Data []byte }
func (*TwoDTexture) DecodeFrom ¶
func (t *TwoDTexture) DecodeFrom(in io.Reader) error
type WebRegistry ¶
type WebRegistry struct {
// contains filtered or unexported fields
}
WebRegistry is an implementation of Registry that reads content from the web.
func NewWebRegistry ¶
func NewWebRegistry(assetsURL string) *WebRegistry
NewWebRegistry creates a Registry implementation that reads content from the web. The provided assetsURL parameter needs to point to the web location of the assets.
This registry does not support write or delete operations.
func (*WebRegistry) DeleteContent ¶
func (r *WebRegistry) DeleteContent(guid string) error
func (*WebRegistry) DeletePreview ¶
func (r *WebRegistry) DeletePreview(guid string) error
func (*WebRegistry) ReadContent ¶
func (r *WebRegistry) ReadContent(guid string, target Decodable) error
func (*WebRegistry) ReadDependencies ¶
func (r *WebRegistry) ReadDependencies() ([]Dependency, error)
func (*WebRegistry) ReadPreview ¶
func (r *WebRegistry) ReadPreview(guid string) (image.Image, error)
func (*WebRegistry) ReadResources ¶
func (r *WebRegistry) ReadResources() ([]Resource, error)
func (*WebRegistry) WriteContent ¶
func (r *WebRegistry) WriteContent(guid string, target Encodable) error
func (*WebRegistry) WriteDependencies ¶
func (r *WebRegistry) WriteDependencies(dependencies []Dependency) error
func (*WebRegistry) WritePreview ¶
func (r *WebRegistry) WritePreview(guid string, img image.Image) error
func (*WebRegistry) WriteResources ¶
func (r *WebRegistry) WriteResources(resources []Resource) error