engine

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2021 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PackageVersion string

Functions

This section is empty.

Types

type Engine

type Engine struct {
	GUI *GUIManager

	Entities []Entity
	// contains filtered or unexported fields
}

func (*Engine) ClearEntities

func (eng *Engine) ClearEntities()

func (*Engine) Run

func (eng *Engine) Run() error

func (*Engine) Shutdown

func (eng *Engine) Shutdown() error

func (*Engine) SwapEntities

func (eng *Engine) SwapEntities()

type Entity

type Entity struct {
	ModelName string
	Position  mgl32.Vec3
	Rotation  mgl32.Vec3
	Scale     mgl32.Vec3
	TileIndex int
}

type GUIManager

type GUIManager struct {
	Program glProgram
	Quad    rawModel
	// contains filtered or unexported fields
}

func (*GUIManager) AddLayer

func (m *GUIManager) AddLayer(name LayerName, source gui.GUIContext)

func (*GUIManager) DrawGUI

func (m *GUIManager) DrawGUI()

func (*GUIManager) RemoveNamedLayer

func (m *GUIManager) RemoveNamedLayer(name LayerName)

func (*GUIManager) ToggleNamedLayer

func (m *GUIManager) ToggleNamedLayer(name LayerName, enabled bool)

type LayerName

type LayerName uint32

type RunConfig

type RunConfig struct {
	Logger       *log.Logger
	WindowWidth  int
	WindowHeight int
}

func DefaultConfig

func DefaultConfig() RunConfig

func (RunConfig) NewEngine

func (r RunConfig) NewEngine(ctx context.Context) *Engine

type Uniform

type Uniform int
const (
	U_PROJECTION Uniform = iota
	U_CAMERA
	U_TRANSFORM
	U_MATERIAL_SHINE_DAMPER
	U_MATERIAL_REFLECTIVITY
	U_TEXTURE_DIFFUSE
	U_TEXTURE_NORMAL
	U_TEXTURE_SPECULAR
	U_TILE_SIZE
	U_TILE_INDEX
	U_TMP_LIGHT_POS
	U_TMP_LIGHT_COLOUR
	// ...
	U_MAX
)

func (Uniform) String

func (u Uniform) String() string

Jump to

Keyboard shortcuts

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