resource

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: MIT Imports: 10 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, gfxWorker *async.Worker, 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(locator Locator, gfxEngine graphics.Engine, gfxWorker *async.Worker) *CubeTextureOperator

func (*CubeTextureOperator) Allocate

func (o *CubeTextureOperator) Allocate(registry *Registry, name 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 FileLocator

type FileLocator struct{}

func (FileLocator) Open

func (FileLocator) Open(segments ...string) (io.ReadCloser, error)

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(locator Locator, gfxEngine graphics.Engine, gfxWorker *async.Worker) *LevelOperator

func (*LevelOperator) Allocate

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

func (*LevelOperator) Release

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

type Locator

type Locator interface {
	Open(segments ...string) (io.ReadCloser, error)
}

type Mesh

type Mesh struct {
	Name string

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

func AllocateMesh

func AllocateMesh(registry *Registry, name string, gfxWorker *async.Worker, 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(locator Locator, gfxEngine graphics.Engine, gfxWorker *async.Worker) *ModelOperator

func (*ModelOperator) Allocate

func (o *ModelOperator) Allocate(registry *Registry, name 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(locator Locator, gfxEngine graphics.Engine, gfxWorker *async.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) 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 TwoDTexture

type TwoDTexture struct {
	Name       string
	GFXTexture graphics.TwoDTexture
}

type TwoDTextureOperator

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

func NewTwoDTextureOperator

func NewTwoDTextureOperator(locator Locator, gfxEngine graphics.Engine, gfxWorker *async.Worker) *TwoDTextureOperator

func (*TwoDTextureOperator) Allocate

func (o *TwoDTextureOperator) Allocate(registry *Registry, name 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

Jump to

Keyboard shortcuts

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