Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
xyproto committed Jan 4, 2024
1 parent 39a6dcb commit 4dc87da
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,19 @@ This program imports `pixelpusher`, sets up a callback function for drawing pixe
package main

import (
"github.com/xyproto/pixelpusher"
pp "github.com/xyproto/pixelpusher"
)

func onDraw(gfx *pixelpusher.Config) error {
func onDraw(canvas *pp.Canvas) error {
// x=0, y=0, red=255, green=0, blue=0
return pixelpusher.Plot(gfx, 0, 0, 255, 0, 0)
return pp.Plot(canvas, 0, 0, 255, 0, 0)
}

func main() {
// The window title is "Red Pixel"
gfx := pixelpusher.New("Red Pixel")
gfx.Run(onDraw, nil, nil, nil)
canvas := pp.New("Red Pixel")
// onDraw will be called whenever it is time to draw a frame
canvas.Run(onDraw, nil, nil, nil)
}
```

Expand All @@ -52,13 +53,13 @@ package main
import (
"errors"

"github.com/xyproto/pixelpusher"
pp "github.com/xyproto/pixelpusher"
)

var x, y = 160, 100

func onDraw(gfx *pixelpusher.Config) error {
return pixelpusher.Plot(gfx, x, y, 255, 0, 0)
func onDraw(canvas *pp.Canvas) error {
return pp.Plot(canvas, x, y, 255, 0, 0)
}

func onPress(left, right, up, down, space, enter, esc bool) error {
Expand All @@ -79,12 +80,12 @@ func onPress(left, right, up, down, space, enter, esc bool) error {
}

func main() {
pixelpusher.New("Simple Draw").Run(onDraw, onPress, nil, nil)
pp.New("Simple Draw").Run(onDraw, onPress, nil, nil)
}
```

# General information

* Version: 1.1.0
* Version: 1.2.0
* License: BSD-3
* Author: Alexander F. Rødseth <[email protected]>

0 comments on commit 4dc87da

Please sign in to comment.