win

package
v0.0.0-...-1ed56cc Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2018 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action int

Action is a configurable abstraction of a key press

const (
	PLAYER_FORWARD  Action = iota
	PLAYER_BACKWARD Action = iota
	PLAYER_LEFT     Action = iota
	PLAYER_RIGHT    Action = iota
	PROGRAM_QUIT    Action = iota
)

type InputManager

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

func NewInputManager

func NewInputManager() *InputManager

func (*InputManager) CheckpointCursorChange

func (im *InputManager) CheckpointCursorChange()

CheckpointCursorChange updates the publicly available Cursor() and CursorChange() methods to return the current Cursor and change since last time this method was called.

func (*InputManager) Cursor

func (im *InputManager) Cursor() mgl64.Vec2

Cursor returns the value of the cursor at the last time that CheckpointCursorChange() was called.

func (*InputManager) CursorChange

func (im *InputManager) CursorChange() mgl64.Vec2

CursorChange returns the amount of change in the underlying cursor since the last time CheckpointCursorChange was called

func (*InputManager) IsActive

func (im *InputManager) IsActive(a Action) bool

IsActive returns whether the given Action is currently active

type Window

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

func NewWindow

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

func (*Window) Height

func (w *Window) Height() int

func (*Window) InputManager

func (w *Window) InputManager() *InputManager

func (*Window) ShouldClose

func (w *Window) ShouldClose() bool

func (*Window) SinceLastFrame

func (w *Window) SinceLastFrame() float64

func (*Window) StartFrame

func (w *Window) StartFrame()

StartFrame sets everything up to start rendering a new frame. This includes swapping in last rendered buffer, polling for window events, checkpointing cursor tracking, and updating the time since last frame.

func (*Window) Width

func (w *Window) Width() int

Jump to

Keyboard shortcuts

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