gui

package
v0.0.0-...-8789af9 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Draw

type Draw struct {
	ScreenWidth, ScreenHeight int
	*Theme
	// contains filtered or unexported fields
}

func (*Draw) DrawCircle

func (d *Draw) DrawCircle(x, y, radius int, op *DrawOptions)

func (*Draw) DrawLine

func (d *Draw) DrawLine(points []Position, op *DrawOptions)

func (*Draw) DrawRectangle

func (d *Draw) DrawRectangle(x, y, width, height int, op *DrawOptions)

func (*Draw) DrawSegment

func (d *Draw) DrawSegment(x1, y1, x2, y2 int, op *DrawOptions)

func (*Draw) DrawTriangle

func (d *Draw) DrawTriangle(x1, y1, x2, y2, x3, y3 int, op *DrawOptions)

func (*Draw) Encode

func (d *Draw) Encode() []Vertex

func (*Draw) GetTheme

func (d *Draw) GetTheme() *Theme

func (*Draw) SetTheme

func (d *Draw) SetTheme(t *Theme)

type DrawContext

type DrawContext interface {
	DrawCircle(x int, y int, radius int, op *DrawOptions)
	DrawLine(points []Position, op *DrawOptions)
	DrawRectangle(x int, y int, width int, height int, op *DrawOptions)
	DrawSegment(x1 int, y1 int, x2 int, y2 int, op *DrawOptions)
	DrawTriangle(x1 int, y1 int, x2 int, y2 int, x3 int, y3 int, op *DrawOptions)
	Encode() []Vertex
	GetTheme() *Theme
	SetTheme(t *Theme)
}

func NewDrawContext

func NewDrawContext(width, height int) DrawContext

type DrawOptions

type DrawOptions struct {
	Style
}

type OpCode

type OpCode float32
const (
	DrawTriangle OpCode = iota
)

type Position

type Position struct {
	X, Y, Z int
}

type Style

type Style struct {
	FillColor    color.Color
	OutlineColor color.Color
	OutlineSize  int
	CornerRadius int
}

type Theme

type Theme struct {
	BackgroundColor color.Color
	PrimaryColor    color.Color
	SecondaryColor  color.Color
	TextColor       color.Color
	HandleColor     color.Color
}

func DefaultTheme

func DefaultTheme() *Theme

type Vertex

type Vertex struct {
	Position      [3]float32
	LocalPosition [2]float32
	OpCode        float32
	Radius        float32
	Color         [4]float32
}

type VertexAttributeLayout

type VertexAttributeLayout struct {
	ShaderLocation uint32
	Offset         uint64
	Format         string
}

type VertexBufferLayout

type VertexBufferLayout struct {
	ArrayStride uint64
	Attributes  []VertexAttributeLayout
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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