Carp/examples/minimal_sdl.carp

15 lines
356 B
Plaintext
Raw Normal View History

2018-03-24 12:34:49 +03:00
(load-and-use SDL)
2018-03-20 18:48:56 +03:00
(Project.config "title" "Minimal")
2018-03-24 12:34:49 +03:00
(defn tick [state]
(+ state 10))
2018-03-20 18:48:56 +03:00
2018-03-24 12:34:49 +03:00
(defn draw [app rend state]
2018-03-26 09:50:32 +03:00
(bg rend &(rgb (/ @state 2) (/ @state 3) (/ @state 4))))
2018-03-20 18:48:56 +03:00
(defn main []
2018-03-24 12:34:49 +03:00
(let [app (SDLApp.create "The Minimalistic Color Generator" 400 300)
state 0]
(SDLApp.run-with-callbacks &app SDLApp.quit-on-esc tick draw state)))