package tins2020 import "github.com/veandco/go-sdl2/sdl" type Point struct { sdl.Point } func (p Point) Add(q Point) Point { return Pt(p.X+q.X, p.Y+q.Y) } func (p Point) In(r Rectangle) bool { return r.IsPointInsidePt(p) } type PointF struct { sdl.FPoint } func (p PointF) Add(q PointF) PointF { return PtF(p.X+q.X, p.Y+q.Y) } func (p PointF) Sub(q PointF) PointF { return PtF(p.X-q.X, p.Y-q.Y) } func Pt(x, y int32) Point { return Point{sdl.Point{X: x, Y: y}} } func PtF(x, y float32) PointF { return PointF{sdl.FPoint{X: x, Y: y}} } func PtPtr(x, y int32) *Point { p := Pt(x, y) return &p } func PtFPtr(x, y float32) *PointF { p := PtF(x, y) return &p }