asset_manager

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNameDup        = errors.New("ErrNameDup")
	ErrTypeNotSupport = errors.New("ErrTypeNotSupport")
)

Functions

This section is empty.

Types

type Asset

type Asset struct {
	ID       int
	Loaded   bool
	Name     string
	Type     AssetType
	Data     interface{} // type-dependant
	Resource Resource    // type-dependant
}

Asset is where you can get a resource which is the real thing to use. When you get a resource, you don't need a asset.

func NewAsset

func NewAsset(name string, Type AssetType, data interface{}) *Asset

func (*Asset) Load

func (as *Asset) Load() error

type AssetType

type AssetType string
var (
	AssetTypeTexture AssetType = "texture"
	AssetTypeShader  AssetType = "shaderprogram"
	AssetTypeModel   AssetType = "model"
)

type AsssetManager

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

func NewAsssetManager

func NewAsssetManager() *AsssetManager

func (*AsssetManager) FindByName

func (am *AsssetManager) FindByName(name string) *Asset

func (*AsssetManager) Load

func (am *AsssetManager) Load(as *Asset)

will assign id field

func (*AsssetManager) PrintAllAsset

func (am *AsssetManager) PrintAllAsset()

func (*AsssetManager) Register

func (am *AsssetManager) Register(name string, as *Asset) error

type ModelDataType

type ModelDataType struct {
	FilePath string
}

type Resource

type Resource interface {
	Upload()
	Active()
}

type ShaderDataType

type ShaderDataType struct {
	VPath string
	FPath string
}

type TextureDataType

type TextureDataType struct {
	FilePath    string
	Width       int32
	Height      int32
	RepeatModeU int
	RepeatModeV int
	FlipY       bool
	GenMipMaps  bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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