Updated example in README.

This commit is contained in:
Erik Svedäng 2018-03-24 17:20:43 +01:00
parent 3d3b34f70f
commit 296861ae5e

View File

@ -39,13 +39,12 @@ The Carp REPL has built-in documentation, run ```(help)``` to access it!
(+ state 10))
(defn draw [app rend state]
(bg rend &(rgb @state (/ @state 2) (/ @state 3))))
(bg rend &(rgb (/ @state 2) (/ @state 3) (/ @state 4))))
(defn main []
(let [app (SDLApp.create "The Minimalistic Color Generator" 400 300)
state 0]
(SDLApp.run-with-callbacks &app SDLApp.default-event-handler tick draw state)))
(SDLApp.run-with-callbacks &app SDLApp.quit-on-esc tick draw state)))
```
To build this example, save it to a file called 'example.carp' and load it with ```(load "example.carp")```, then execute ```(build)``` to build an executable, and ```(run)``` to start.