Anima
A microframework for drawing.
(load "anima.carp")
(use Anima)
(defn setup [rend]
(framerate 0)) ; shortcut for a static sketch
(defn draw [rend]
(do
(color rend 255)
(line rend 0 0 800 800)))
(defsketch "One line to rule them all" 800 800
setup
draw)
Function Reference
background
(Fn [Int] ())
Set the current background color to color. The color can have 1 component (greyscale, from 0 to 255), three components (RGB value, from 0 to 255), or 4 components (RGBA value, from 0 to 255).
Warning: This will also clear the screen with that color.
color
(Fn [Int] ())
Set the current drawing color to color. The color can have 1 component (greyscale, from 0 to 255), three components (RGB value, from 0 to 255), or 4 components (RGBA value, from 0 to 255).
defsketch
(Fn [&String Int Int (Fn [SDL_Renderer] ())] ())
Create a sketch with a name, width, height, and setup function. Optionally takes a draw and state function as well.
hsb-to-rgb
(λ [Int, Int, Int] (Array Int))
Convert a three-component HSB color to an RGB color array.
rect
(λ [(Ptr SDL_Renderer), Int, Int, Int, Int] ())
Draw a rectangle with (ax, ay) as origin, w as width, and h as height.