core

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2019 License: Unlicense Imports: 1 Imported by: 0

README

Core

Core contained shared code for any implementing applications. It consists of a set of utilities for loading and managing a Source Engine games resources.

Entity

Provides an interface, and generic implementation of a game entity, as well as 3d transform struct and camera implementation.

Event

Event provides a very simple emitter/subscriber manager to allow engine event processing. It can be used for handling internal engine events, or for game logic, although that isn't recommended.

Filesystem

Source Engine is a little annoying in that there are potentially unlimited possible locations that engine resources can be located. Filesystem provides a way to register and organise any potential resource path or filesystem, while preserving filesystem type search priority.

Loader

Loader generates data structures for Source formats from file streams. Materials, textures, meshes etc.

Logger

Logger is a simple module to abstract out different print() priorities, and (eventually) locations than just stdout.

Material

Material provides a more GPU friendly vmt material implementation

Mesh

Provides a set of common data formats for vertex data in the bsp or compiled .mdl props.

Model

Models are combinations of simple data structures that represent a single higher level visual object. e.g. []Mesh is a studio model, []Face is bsp data etc.

Resource

Resource provides a management struct for tracking what game resources have been loaded from the filesystem. When a map is loaded, all found materials, textures, models should be added to the ResourceManager, so they can be loaded only once, and cleaned up correctly when no longer needed.

Scene

Provides a simple scene struct that contains bsp face and staticprop information

Texture

Provides a set of GPU friendly texture formats. For now OpenGL usage is enforced, but abstracting that out should be doable.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {
	Managers []IManager
	// contains filtered or unexported fields
}

Engine Game engine Only 1 should be initialised

func NewEngine

func NewEngine() *Engine

NewEngine returns a new engine instance

func (*Engine) AddManager

func (engine *Engine) AddManager(manager IManager)

AddManager Adds a new manager to the engine

func (*Engine) Close

func (engine *Engine) Close()

Close marks the engine to exit at the end of the current loop

func (*Engine) Initialise

func (engine *Engine) Initialise()

Initialise the engine, and attached managers

func (*Engine) Run

func (engine *Engine) Run()

Run the engine

func (*Engine) SetSimulationSpeed

func (engine *Engine) SetSimulationSpeed(multiplier float64)

SetSimulationSpeed allows for speeding up and slowing down the game clock

type IManager

type IManager interface {
	Register()
	RunConcurrent()
	Update(float64)
	Unregister()
	PostUpdate()
}

IManager Generic game manager. Different systems should implement these methods

type Manager

type Manager struct {
}

Manager Managers exist to create and handle behaviour.

func (*Manager) PostUpdate

func (manager *Manager) PostUpdate()

PostUpdate Called at the end of each loop.

func (*Manager) Register

func (manager *Manager) Register()

Register this manager in the engine. This is called by the engine when the system is attached.

func (*Manager) RunConcurrent

func (manager *Manager) RunConcurrent()

RunConcurrent If this manager is supported to run concurrently, custom concurrency function should be defined here

func (*Manager) Unregister

func (manager *Manager) Unregister()

Unregister Called when this manager is detached and destroyed by the engine

func (*Manager) Update

func (manager *Manager) Update(dt float64)

Update Called every update loop. dt is the time elapsed since last called

Jump to

Keyboard shortcuts

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