Draw an image.Image to a window.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example
README.md
canvas.go
canvas_test.go

README.md

canvas

Draw an image.Image to a window. You need to have SDL2 and pkg-config to compile your program.

img := image.NewRGBA(image.Rect(0, 0, 640, 480))

c, err := New(img, 1, "Canvas Title")
if err != nil {
	log.Fatal(err)
}
defer c.Close()

// Update returns true until the window should be closed.
for c.Update() {
	// Modify the image based on its Pix slice or Set.
	c.Draw()
}

Image Sine Wave