examples

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Rendered for js/wasm

Index

Constants

This section is empty.

Variables

View Source
var (
	Examples     = []func(float64, float64, float64){TriangleExample, SnowExample, FireworksExample, PatternExample, ParticlesExample, RaytracedExample}
	ExampleNames = []string{"Triangle", "Snow", "Fireworks", "Pattern", "Particles", "Raytraced Solar System"}
)

Functions

func FireworksExample

func FireworksExample(dt, width, height float64)

func ParticlesExample

func ParticlesExample(dt, width, height float64)

func PatternExample

func PatternExample(dt, width, height float64)

func ProvideContext

func ProvideContext(cvs *wasmdraw.CanvasElement, c *ctx2d.Context)

func RaytracedExample

func RaytracedExample(dt, width, height float64)

RaytracedExample renders the old ray-sphere scene through an allocation-free Canvas 2D pixel pipeline.

func SnowExample

func SnowExample(dt, width, height float64)

func TriangleExample

func TriangleExample(dt, width, height float64)

Types

type Firework

type Firework struct {
	ID         uint64
	X, R, Y    float64
	Vx, Vy, Vr float64
	Color      string
	Explodes   bool
}

func (*Firework) UpdateAndDraw

func (f *Firework) UpdateAndDraw(dt, width, height float64)

type Snowflake

type Snowflake struct {
	X, Y, R float64
	Vx, Vy  float64
	// contains filtered or unexported fields
}

func (*Snowflake) UpdateAndDraw

func (s *Snowflake) UpdateAndDraw(dt, width, height float64)

Jump to

Keyboard shortcuts

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