resource

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2022 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const CubeTextureTypeName = TypeName("cube_texture")
View Source
const LevelTypeName = TypeName("level")
View Source
const ModelTypeName = TypeName("model")
View Source
const TwoDTextureTypeName = TypeName("twod_texture")

Variables

This section is empty.

Functions

func InjectCubeTexture

func InjectCubeTexture(target **CubeTexture) func(value interface{})

func InjectLevel

func InjectLevel(target **Level) func(value interface{})

func InjectModel

func InjectModel(target **Model) func(value interface{})

func InjectTwoDTexture

func InjectTwoDTexture(target **TwoDTexture) func(value interface{})

func ReleaseMesh

func ReleaseMesh(registry *Registry, mesh *Mesh) error

Types

type CubeTexture

type CubeTexture struct {
	Name       string
	GFXTexture graphics.CubeTexture
}

type CubeTextureOperator

type CubeTextureOperator struct {
	// contains filtered or unexported fields
}

func NewCubeTextureOperator

func NewCubeTextureOperator(delegate asset.Registry, gfxEngine graphics.Engine) *CubeTextureOperator

func (*CubeTextureOperator) Allocate

func (o *CubeTextureOperator) Allocate(registry *Registry, id string) (interface{}, error)

func (*CubeTextureOperator) Release

func (o *CubeTextureOperator) Release(registry *Registry, resource interface{}) error

type Entity

type Entity struct {
	Model  *Model
	Matrix sprec.Mat4
}

type Level

type Level struct {
	Name                     string
	SkyboxTexture            *CubeTexture
	AmbientReflectionTexture *CubeTexture
	AmbientRefractionTexture *CubeTexture
	CollisionMeshes          []shape.Placement
	StaticMeshes             []*Mesh
	StaticEntities           []*Entity
}

type LevelOperator

type LevelOperator struct {
	// contains filtered or unexported fields
}

func NewLevelOperator

func NewLevelOperator(delegate gameasset.Registry, gfxEngine graphics.Engine) *LevelOperator

func (*LevelOperator) Allocate

func (o *LevelOperator) Allocate(registry *Registry, id string) (interface{}, error)

func (*LevelOperator) Release

func (o *LevelOperator) Release(registry *Registry, res interface{}) error

type Mesh

type Mesh struct {
	Name string

	GFXMeshTemplate graphics.MeshTemplate
	// contains filtered or unexported fields
}

func AllocateMesh

func AllocateMesh(registry *Registry, name string, gfxEngine graphics.Engine, meshAsset *asset.Mesh) (*Mesh, error)

type Model

type Model struct {
	Name  string
	Nodes []*Node
	// contains filtered or unexported fields
}

func (Model) FindNode

func (m Model) FindNode(name string) (*Node, bool)

type ModelOperator

type ModelOperator struct {
	// contains filtered or unexported fields
}

func NewModelOperator

func NewModelOperator(delegate gameasset.Registry, gfxEngine graphics.Engine) *ModelOperator

func (*ModelOperator) Allocate

func (o *ModelOperator) Allocate(registry *Registry, id string) (interface{}, error)

func (*ModelOperator) Release

func (o *ModelOperator) Release(registry *Registry, resource interface{}) error

type Node

type Node struct {
	Name     string
	Matrix   sprec.Mat4
	Mesh     *Mesh
	Parent   *Node
	Children []*Node
}

func (Node) FindNode

func (n Node) FindNode(name string) (*Node, bool)

type Operator

type Operator interface {
	Allocate(registry *Registry, name string) (interface{}, error)
	Release(registry *Registry, resource interface{}) error
}

type Reference

type Reference struct {
	Count           int
	LoadOperation   async.Outcome
	UnloadOperation async.Outcome
	Value           interface{}
}

TODO: Make private

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

func NewRegistry

func NewRegistry(delegate asset.Registry, gfxEngine graphics.Engine, gfxWorker Worker) *Registry

func (*Registry) Load

func (r *Registry) Load(typeName TypeName, name string) async.Outcome

func (*Registry) LoadCubeTexture

func (r *Registry) LoadCubeTexture(name string) async.Outcome

func (*Registry) LoadLevel

func (r *Registry) LoadLevel(name string) async.Outcome

func (*Registry) LoadModel

func (r *Registry) LoadModel(name string) async.Outcome

func (*Registry) LoadTwoDTexture

func (r *Registry) LoadTwoDTexture(name string) async.Outcome

func (*Registry) Register

func (r *Registry) Register(typeName TypeName, operator Operator)

func (*Registry) Schedule added in v0.3.0

func (r *Registry) Schedule(fn func() error) Task

func (*Registry) ScheduleVoid added in v0.3.0

func (r *Registry) ScheduleVoid(fn func()) Task

func (*Registry) Unload

func (r *Registry) Unload(typeName TypeName, name string) async.Outcome

func (*Registry) UnloadCubeTexture

func (r *Registry) UnloadCubeTexture(texture *CubeTexture) async.Outcome

func (*Registry) UnloadLevel

func (r *Registry) UnloadLevel(texture *Level) async.Outcome

func (*Registry) UnloadModel

func (r *Registry) UnloadModel(texture *Model) async.Outcome

func (*Registry) UnloadTwoDTexture

func (r *Registry) UnloadTwoDTexture(texture *TwoDTexture) async.Outcome

type Task added in v0.3.0

type Task struct {
	// contains filtered or unexported fields
}

func (Task) Run added in v0.3.0

func (t Task) Run() error

func (Task) Wait added in v0.3.0

func (t Task) Wait() error

type TwoDTexture

type TwoDTexture struct {
	Name       string
	GFXTexture graphics.TwoDTexture
}

type TwoDTextureOperator

type TwoDTextureOperator struct {
	// contains filtered or unexported fields
}

func NewTwoDTextureOperator

func NewTwoDTextureOperator(delegate asset.Registry, gfxEngine graphics.Engine) *TwoDTextureOperator

func (*TwoDTextureOperator) Allocate

func (o *TwoDTextureOperator) Allocate(registry *Registry, id string) (interface{}, error)

func (*TwoDTextureOperator) Release

func (o *TwoDTextureOperator) Release(registry *Registry, resource interface{}) error

type Type

type Type struct {
	// contains filtered or unexported fields
}

func (*Type) Load

func (t *Type) Load(name string) async.Outcome

func (*Type) Unload

func (t *Type) Unload(name string) async.Outcome

type TypeName

type TypeName string

type Worker added in v0.3.0

type Worker interface {
	Schedule(fn func() error)
}

Jump to

Keyboard shortcuts

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