-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
12 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/xyproto/pixelpusher" | ||
pp "github.com/xyproto/pixelpusher" | ||
) | ||
|
||
func onDraw(gfx *pixelpusher.Config) error { | ||
// x, y, r, g, b | ||
return pixelpusher.Plot(gfx, 0, 0, 255, 0, 0) | ||
func onDraw(canvas *pp.Canvas) error { | ||
// x=0, y=0, red=255, green=0, blue=0 | ||
return pp.Plot(canvas, 0, 0, 255, 0, 0) | ||
} | ||
|
||
func main() { | ||
gfx := pixelpusher.New("Red Pixel") | ||
gfx.Run(onDraw, nil, nil, nil) | ||
// The window title is "Red Pixel" | ||
canvas := pp.New("Red Pixel") | ||
// onDraw will be called whenever it is time to draw a frame | ||
canvas.Run(onDraw, nil, nil, nil) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters