engine

package module
v0.0.0-...-963f1c7 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2022 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Helloworld

func Helloworld()

func Log

func Log(message string)

func LogErr

func LogErr(message string)

func LogInfo

func LogInfo(message string)

func LogTrace

func LogTrace(message string)

func LogWarn

func LogWarn(message string)

func Print

func Print(message string)

func Run

func Run()

Types

type AppConfig

type AppConfig struct {
	Title         string
	Width, Height float64
}

type Application

type Application interface {
	Run(platform *graphics.Platform, renderer graphics.RenderSystem, dispatcher events.Publisher)
	OnEvent(event events.Event)
	PushLayer(layer Layer)
	PushOverlay(overlay Layer)
	GetConfig() AppConfig
	Broadcast(event events.Event)
}
var GlobalApplication Application

func InitApp

func InitApp(config AppConfig) Application

func NewCassiniApp

func NewCassiniApp(config AppConfig) Application

type BaseLayer

type BaseLayer struct {
	Name string
	App  *CassiniApp
}

func (*BaseLayer) SetApp

func (bl *BaseLayer) SetApp(app *CassiniApp)

type CassiniApp

type CassiniApp struct {
	Log    LogLevel
	Layers LayerStack
	Config AppConfig
	Plat   *graphics.Platform
	Ren    graphics.RenderSystem
	Dis    events.Publisher
}

func (*CassiniApp) Broadcast

func (c *CassiniApp) Broadcast(event events.Event)

func (*CassiniApp) GetConfig

func (c *CassiniApp) GetConfig() AppConfig

func (*CassiniApp) OnEvent

func (c *CassiniApp) OnEvent(event events.Event)

func (*CassiniApp) PushLayer

func (c *CassiniApp) PushLayer(layer Layer)

func (*CassiniApp) PushOverlay

func (c *CassiniApp) PushOverlay(overlay Layer)

func (*CassiniApp) Run

func (c *CassiniApp) Run(platform *graphics.Platform, renderer graphics.RenderSystem, dispatcher events.Publisher)

type DemoLayer

type DemoLayer struct {
	BaseLayer
}

func (*DemoLayer) Broadcast

func (l *DemoLayer) Broadcast(event events.Event)

func (*DemoLayer) OnAttach

func (l *DemoLayer) OnAttach()

func (*DemoLayer) OnDetach

func (l *DemoLayer) OnDetach()

func (*DemoLayer) OnEvent

func (l *DemoLayer) OnEvent(event events.Event)

func (*DemoLayer) OnUpdate

func (l *DemoLayer) OnUpdate()

type Layer

type Layer interface {
	OnAttach()
	OnDetach()
	OnUpdate()
	OnEvent(event events.Event)
	SetApp(app *CassiniApp)
	Broadcast(event events.Event)
}

func NewDemoLayer

func NewDemoLayer(name string) Layer

type LayerStack

type LayerStack interface {
	PushLayer(layer Layer)
	PushOverlay(overlay Layer)
	PopLayer(layer Layer)
	PopOverlay(overlay Layer)
	Get() []Layer
	PrintStack()
}

func NewLayerStack

func NewLayerStack() LayerStack

type LogLevel

type LogLevel uint8
const (
	Err LogLevel = iota
	Warn
	Info
	Trace
)

type Window

type Window struct {
	*glfw.Window
}

func NewWindow

func NewWindow(width int, height int, title string) (Window, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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