game

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: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Camera

type Camera struct {
	Pos          *matmath.VECX
	Front        *matmath.VECX
	UP           *matmath.VECX
	Target       *matmath.VECX
	NearDistance float32
	ViewT        *matmath.MATX
	ProjectionT  *matmath.MATX
}

type GameObjectI

type GameObjectI interface {
	ID_sg(...int) int
	ModelAsset_sg(...*asset_manager.Asset) *asset_manager.Asset
	ShaderAsset_sg(...*asset_manager.Asset) *asset_manager.Asset
	TextureAsset_sg(...*asset_manager.Asset) *asset_manager.Asset
	NotDrawable() bool
	DrawEnable_sg(...bool) bool
	ReadyForDraw_sg(...bool) bool
	GetTransform() *common.Transform
	Start()
	Update()
	OnDraw()
}

the common gameobject Interface

type GlobalFrameInfo

type GlobalFrameInfo struct {
	CurFrame       int
	StartMS        float64 // the time that the globalinfo successfully starts at
	LastFrameMS    float64 // the time that the last frame begins at
	NowMS          float64 // the time that the current frame begins at
	ElapsedMS      float64 // the ms between now and the StartMS
	FrameElapsedMS float64 // the ms between now and the last frame
	FrameRate      float64 // the frame per second
	Debug          bool    // whether print the frame info
}

type GlobalInfo

type GlobalInfo struct {
	AssetManager *asset_manager.AsssetManager

	CustomInit func(*GlobalInfo)
	MainCamera *Camera
	*GlobalFrameInfo
	// contains filtered or unexported fields
}

func NewGlobalInfo

func NewGlobalInfo(windowWidth, windowHeight int, title string) *GlobalInfo

func (*GlobalInfo) AddGameObject

func (gi *GlobalInfo) AddGameObject(gb GameObjectI)

func (*GlobalInfo) Boot

func (gi *GlobalInfo) Boot()

func (*GlobalInfo) Projection added in v0.0.4

func (gi *GlobalInfo) Projection() *matmath.MATX

func (*GlobalInfo) StartGame

func (gi *GlobalInfo) StartGame(mode string)

func (*GlobalInfo) View added in v0.0.4

func (gi *GlobalInfo) View() *matmath.MATX

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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