rexdemo

package
v0.0.0-...-47ad847 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2016 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Room = &room.Room{
	Name:    "REx Demo",
	Service: "_rexdemo._tcp.",
}

Room is the room used by clients and servers for the demo.

Functions

This section is empty.

Types

type Demo

type Demo struct {
	Mut     *sync.Mutex `json:"-"`
	X       float64     `json:"x"`
	Y       float64     `json:"y"`
	Counter int         `json:"counter"`
	Last    time.Time   `json:"last"`
}

Demo is the state of a demo a copy of the state is present in the server and all clients.

func NewDemo

func NewDemo() *Demo

NewDemo returns a new Demo object

func (*Demo) State

func (d *Demo) State() *Demo

State returns a snapshot of d.

type RemotePoint

type RemotePoint struct {
	X float64
	Y float64
}

RemotePoint is a touch event from another client

func Pt

func Pt(x, y float64) RemotePoint

Pt is a simple constructor for RemotePoint.

type State

type State interface {
	State() *Demo
}

State is an interface satisfied by other Demo types.

type StatusPainter

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

StatusPainter is an object responsible for rendering the demo status at the top of the client UI.

func NewStatusPainter

func NewStatusPainter(demo State, font *truetype.Font, bg color.Color, images *glutil.Images) *StatusPainter

NewStatusPainter initializes and returns a StatusPainter.

func (*StatusPainter) Draw

func (p *StatusPainter) Draw(sz size.Event, pad int, opt *truetype.Options)

Draw renders the demo state to the screen

func (*StatusPainter) Release

func (p *StatusPainter) Release()

Release calls Release on underlying gl elements.

Jump to

Keyboard shortcuts

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