engine

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2017 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// SceneSrcDir is the expected location of scenes
	SceneSrcDir = "assets/scenes/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

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

Engine constitutes the rendering engine which creates and initializes the rendering system.

func (*Engine) AddScene

func (e *Engine) AddScene(scene Scene, name string)

AddScene adds a scene to the engine.

func (*Engine) Init

func (e *Engine) Init(width, height int, title string) error

Init is called to initialize glfw and opengl

func (*Engine) LoadScene

func (e *Engine) LoadScene(name string)

LoadScene switches the current scene to the one specificed if it has already been added.

func (*Engine) LoadSceneFile

func (e *Engine) LoadSceneFile(fileName string) (string, error)

LoadSceneFile loads a scene from a file but does not make it the current scene. You must still call LoadScene with the scene id to load it as the current scene. LoadSceneFile should not be called before Init is called.

func (*Engine) Run

func (e *Engine) Run()

Run starts and runs the main engine loop

type Scene

type Scene interface {
	// ID retrieves the id of this scene.
	ID() string
	// Stop stops the components of the scene.
	Stop()
	// Start starts the scene components.
	Start()
	// Terminate stops the scene and frees any resources.
	Terminate()
}

Scene represents a logical grouping of entities

Jump to

Keyboard shortcuts

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