diff --git a/fb/main.go b/fb/main.go index 3248dff..316d7a1 100644 --- a/fb/main.go +++ b/fb/main.go @@ -24,6 +24,7 @@ func Resolution() (w int, h int) { } var devfb *os.File +var width, height = Resolution() func init() { var err error @@ -40,8 +41,8 @@ func Bytes(c color.Color) []byte { func Draw(img image.Image) error { buf := bufio.NewWriterSize(devfb, 1<<16) - for h := 0; h < Height; h++ { - for w := 0; w < Width; w++ { + for h := 0; h < height; h++ { + for w := 0; w < width; w++ { _, err := buf.Write(Bytes(img.At(w, h))) if err != nil { return err