core

package
v0.0.0-...-6b7bc02 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MinOfUint

func MinOfUint(vars ...uint) (min uint)

Types

type Any

type Any interface{}

func IfThenElse

func IfThenElse(condition bool, a, b Any) Any

type App

type App struct {
	Window          Window
	EventManager    *EventManager
	ResourceManager *ResourceManager
	ShouldRun       bool
	// contains filtered or unexported fields
}

func InitApp

func InitApp(title string, width, height int, resizable bool, syncSwap bool) (app *App)

func (*App) Close

func (a *App) Close()

func (*App) HandleEvent

func (a *App) HandleEvent(e Event) bool

func (*App) Render

func (a *App) Render(renderable Renderable)

func (*App) Run

func (a *App) Run() bool

type Color

type Color [4]float32

type CustomEventHandler

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

func NewCustomEventHandler

func NewCustomEventHandler(handler func(e Event) bool) CustomEventHandler

func (CustomEventHandler) HandleEvent

func (eh CustomEventHandler) HandleEvent(e Event) bool

type EmptyResourceLoader

type EmptyResourceLoader struct{}

func (EmptyResourceLoader) CanLoad

func (r EmptyResourceLoader) CanLoad(resourceType ResourceType, uri string, param LoaderParam) bool

func (EmptyResourceLoader) Load

func (r EmptyResourceLoader) Load(uri string, param LoaderParam) (Resource, error)

func (EmptyResourceLoader) Unload

func (r EmptyResourceLoader) Unload(resource Resource) error

type Event

type Event interface {
}

type EventHandler

type EventHandler interface {
	HandleEvent(e Event) bool
}

type EventManager

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

func NewEventManager

func NewEventManager(cap int) *EventManager

func (*EventManager) Fulsh

func (em *EventManager) Fulsh()

func (*EventManager) Push

func (em *EventManager) Push(e Event)

func (*EventManager) RegisterFncHandler

func (em *EventManager) RegisterFncHandler(handler func(e Event) bool)

func (*EventManager) RegisterHandler

func (em *EventManager) RegisterHandler(handler EventHandler)

func (*EventManager) UnregisterHandler

func (em *EventManager) UnregisterHandler(handler EventHandler)

type FpsEvent

type FpsEvent struct {
	Fps int
}

type LoaderParam

type LoaderParam interface{}

type MouseButtonEvent

type MouseButtonEvent struct {
	Button glfw.MouseButton
	Action glfw.Action
	Mods   glfw.ModifierKey
}

type MouseMoveEvent

type MouseMoveEvent struct {
	Pos  [2]float64
	NPos [2]float64
}

type MouseScrollEvent

type MouseScrollEvent struct {
	X float64
	Y float64
}

type Renderable

type Renderable interface {
	Render(dt float64, app *App)
}

type ResizeEvent

type ResizeEvent struct {
	Size [2]int
}

type Resource

type Resource struct {
	Type   ResourceType
	Uri    string
	Data   ResourceData
	Empty  bool
	Unload func()
}

type ResourceData

type ResourceData interface{}

type ResourceLoader

type ResourceLoader interface {
	CanLoad(resourceType ResourceType, uri string, param LoaderParam) bool
	Load(uri string, param LoaderParam) (Resource, error)
}

type ResourceManager

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

func NewResourceManager

func NewResourceManager() *ResourceManager

func (*ResourceManager) AddLoader

func (r *ResourceManager) AddLoader(loader ResourceLoader) *ResourceManager

func (*ResourceManager) AddResource

func (r *ResourceManager) AddResource(resource Resource)

func (*ResourceManager) GetLoader

func (r *ResourceManager) GetLoader(resourceType ResourceType, uri string, param LoaderParam) (ResourceLoader, error)

func (*ResourceManager) GetResource

func (r *ResourceManager) GetResource(resourceUri string) Resource

func (*ResourceManager) PreloadReource

func (r *ResourceManager) PreloadReource(resourceType ResourceType, uri string, param LoaderParam) *ResourceManager

func (*ResourceManager) Unload

func (r *ResourceManager) Unload()

type ResourceType

type ResourceType string

type Window

type Window struct {
	Width  int
	Height int
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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