commit e4377b9076fa759291b5c165668feb6915be5fa3 Author: faiface Date: Mon Mar 27 00:57:13 2017 +0200 add code for 01_creating_a_window guide diff --git a/guide/01_creating_a_window/main.go b/guide/01_creating_a_window/main.go new file mode 100644 index 0000000..82e5b7c --- /dev/null +++ b/guide/01_creating_a_window/main.go @@ -0,0 +1,29 @@ +package main + +import ( + "github.com/faiface/pixel" + "github.com/faiface/pixel/pixelgl" + "golang.org/x/image/colornames" +) + +func run() { + cfg := pixelgl.WindowConfig{ + Title: "Pixel Rocks!", + Bounds: pixel.R(0, 0, 1024, 768), + VSync: true, + } + win, err := pixelgl.NewWindow(cfg) + if err != nil { + panic(err) + } + + win.Clear(colornames.Skyblue) + + for !win.Closed() { + win.Update() + } +} + +func main() { + pixelgl.Run(run) +}