Skip to content

Commit

Permalink
README: update the example to work out-of-box on macOS (#319)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinlindhe authored and veeableful committed Mar 15, 2018
1 parent c737384 commit b77db23
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,23 @@ func main() {
if err != nil {
panic(err)
}
surface.FillRect(nil, 0)

rect := sdl.Rect{0, 0, 200, 200}
surface.FillRect(&rect, 0xffff0000)
window.UpdateSurface()

sdl.Delay(2500)
running := true
for running {
for event := sdl.PollEvent(); event != nil; event = sdl.PollEvent() {
switch event.(type) {
case *sdl.QuitEvent:
println("Quit")
running = false
break
}
}
}
}
```

Expand Down

0 comments on commit b77db23

Please sign in to comment.