examples

package
v0.0.0-...-c9079ed Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DrawPointLineScale = 1
	DrawOutlineWidth   = 1
)

Variables

View Source
var GRABBABLE_MASK_BIT uint = 1 << 31
View Source
var Keyboard Vector
View Source
var Mouse Vector
View Source
var RightClick = false
View Source
var RightDown = false

Functions

func CheckError

func CheckError(obj uint32, status uint32, getiv func(uint32, uint32, *int32), getInfoLog func(uint32, int32, *int32, *uint8)) bool

func CheckGLErrors

func CheckGLErrors()

func ClearRenderer

func ClearRenderer()

func ClearTextRenderer

func ClearTextRenderer()

func ColorForShape

func ColorForShape(shape *cp.Shape, data interface{}) cp.FColor

func CompileShader

func CompileShader(typ uint32, source string) uint32

func DefaultDraw

func DefaultDraw(space *Space)

func Display

func Display(space *Space, tick float64, update UpdateFunc, draw DrawFunc)

func DrawBB

func DrawBB(bb BB, outline FColor)

func DrawCircle

func DrawCircle(pos Vector, angle, radius float64, outline, fill FColor)

func DrawDot

func DrawDot(size float64, pos Vector, fill FColor)

func DrawFatSegment

func DrawFatSegment(a, b Vector, radius float64, outline, fill FColor)

func DrawInfo

func DrawInfo(space *Space)

func DrawInit

func DrawInit()

func DrawInstructions

func DrawInstructions()

func DrawPolygon

func DrawPolygon(count int, verts []Vector, radius float64, outline, fill FColor)

func DrawSegment

func DrawSegment(a, b Vector, fill FColor)

func DrawString

func DrawString(pos Vector, str string)

func FlushRenderer

func FlushRenderer()

func FlushTextRenderer

func FlushTextRenderer()

func LinkProgram

func LinkProgram(vshader, fshader uint32) uint32

func Main

func Main(space *Space, tick float64, update UpdateFunc, draw DrawFunc)

func MouseToSpace

func MouseToSpace(x, y float64, ww, wh int) Vector

func PushChar

func PushChar(character int32, x, y float64, color FColor) float64

func SetAttribute

func SetAttribute(program uint32, name string, size int32, gltype uint32, stride int32, offset int)

func TextInit

func TextInit()

func Update

func Update(space *Space, tick float64, update UpdateFunc)

func V2f

func V2f(v Vector) v2f

Types

type DrawFunc

type DrawFunc func(*Space)

type DrawOptions

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

func NewDrawOptions

func NewDrawOptions(flags uint, outline, constraint, collisionPoint FColor, data interface{}) *DrawOptions

func (*DrawOptions) CollisionPointColor

func (d *DrawOptions) CollisionPointColor() FColor

func (*DrawOptions) ConstraintColor

func (d *DrawOptions) ConstraintColor() FColor

func (*DrawOptions) Data

func (d *DrawOptions) Data() interface{}

func (*DrawOptions) DrawCircle

func (*DrawOptions) DrawCircle(pos Vector, angle, radius float64, outline, fill FColor, data interface{})

func (*DrawOptions) DrawDot

func (*DrawOptions) DrawDot(size float64, pos Vector, fill FColor, data interface{})

func (*DrawOptions) DrawFatSegment

func (*DrawOptions) DrawFatSegment(a, b Vector, radius float64, outline, fill FColor, data interface{})

func (*DrawOptions) DrawPolygon

func (*DrawOptions) DrawPolygon(count int, verts []Vector, radius float64, outline, fill FColor, data interface{})

func (*DrawOptions) DrawSegment

func (*DrawOptions) DrawSegment(a, b Vector, fill FColor, data interface{})

func (*DrawOptions) Flags

func (d *DrawOptions) Flags() uint

func (*DrawOptions) OutlineColor

func (d *DrawOptions) OutlineColor() FColor

func (*DrawOptions) ShapeColor

func (*DrawOptions) ShapeColor(shape *Shape, data interface{}) FColor

type TextTriangle

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

type TextVertex

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

8*2 + 16 = 32

type Triangle

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

type UpdateFunc

type UpdateFunc func(*Space, float64)

type Vertex

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

8*2 + 16*2 bytes = 48 bytes

Jump to

Keyboard shortcuts

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