dbg

package
v0.0.0-...-e1c21c9 Latest Latest
Warning

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

Go to latest
Published: May 10, 2019 License: Zlib Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdvanceFrame

func AdvanceFrame()

func Color

func Color(argb uint32)

func Destroy

func Destroy()

func DrawBorder

func DrawBorder(x, y, w, h, thickness float32)

func DrawCircle

func DrawCircle(x, y float32, r float32)

draw a circle

func DrawLine

func DrawLine(from, to f32.Vec2)

func DrawRect

func DrawRect(x, y, w, h float32)

draw a rect

func DrawStr

func DrawStr(x, y float32, str string, args ...interface{})

draw string

func DrawStrScaled

func DrawStrScaled(x, y float32, scale float32, str string, args ...interface{})

func GlyphRegion

func GlyphRegion(char byte) (left, right, bottom, top float32)

func Hud

func Hud(format string, args ...interface{})

func HudFunc

func HudFunc(fn func() string)

func Init

func Init(w, h int)

func LoadFontImage

func LoadFontImage() (img image.Image, fmt string, err error)

func LogFPS

func LogFPS(fps, drawCall int)

func SetCamera

func SetCamera(x, y, w, h float32)

func SetDebug

func SetDebug(enum DebugEnum)

Types

type DebugEnum

type DebugEnum uint32
const (
	FPS DebugEnum = 1 << iota
	Stats
	Draw

	ALL  = FPS | Stats | Draw
	None = DebugEnum(0)
)
var DEBUG DebugEnum = FPS | Draw

type DebugRender

type DebugRender struct {

	// buffer
	Buffer TextShapeBuffer
	// contains filtered or unexported fields
}

func NewDebugRender

func NewDebugRender(vsh, fsh string) *DebugRender

func (*DebugRender) Destroy

func (dr *DebugRender) Destroy()

func (*DebugRender) Draw

func (dr *DebugRender) Draw()

func (*DebugRender) SetViewPort

func (dr *DebugRender) SetViewPort(x, y, w, h float32)

type FontSystem

type FontSystem interface {
	Glyph(r rune) (tex uint16, left, right, bottom, top float32)
}

type HudLog

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

Game internal state.

type PosTexColorVertex

type PosTexColorVertex struct {
	X, Y, U, V float32
	RGBA       uint32
}

type TextShapeBuffer

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

Rect:

3 ---- 2
| `    |
|   `  |
0------1

Order: 3, 0, 1, 3, 1, 2

func (*TextShapeBuffer) Border

func (buff *TextShapeBuffer) Border(x, y, w, h, thick float32)

func (*TextShapeBuffer) Circle

func (buff *TextShapeBuffer) Circle(x, y float32, radius float32)

func (*TextShapeBuffer) Destroy

func (buff *TextShapeBuffer) Destroy()

func (*TextShapeBuffer) Line

func (buff *TextShapeBuffer) Line(from, to f32.Vec2)

func (*TextShapeBuffer) Rect

func (buff *TextShapeBuffer) Rect(x, y, w, h float32)

3-------2 | | | | 0-------1

func (*TextShapeBuffer) Reset

func (buff *TextShapeBuffer) Reset()

func (*TextShapeBuffer) String

func (buff *TextShapeBuffer) String(x, y float32, chars string, scale float32)

func (*TextShapeBuffer) Update

func (buff *TextShapeBuffer) Update()

Jump to

Keyboard shortcuts

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