   :name "load-shader",
   :opts {:renderer :p2d, :settings nil},
   :draw
-  "((let [gr (q/create-graphics 250 250) path (clojure.java.io/resource \"SimpleShader.glsl\") shd (q/load-shader (.getPath path))] (q/with-graphics gr (q/background 255) (q/fill 255 0 0) (q/triangle 50 30 220 120 20 180)) (q/image gr 0 0) (q/image gr 250 0) (q/shader shd) (q/image gr 0 250) (q/reset-shader) (q/image gr 250 250)))",
-  :setup "()",
+  "((let [gr (q/create-graphics 250 250) shd (q/state :shader)] (when (q/loaded? shd) (q/with-graphics gr (q/background 255) (q/fill 255 0 0) (q/triangle 50 30 220 120 20 180)) (q/image gr 0 0) (q/image gr 250 0) (q/shader shd) (q/image gr 0 250) (q/reset-shader) (q/image gr 250 250))))",
+  :setup
+  "(let [path (clojure.java.io/resource \"SimpleShader.glsl\") shd (q/load-shader (.getPath path))] (q/set-state! :shader shd))",
   :target :clj}
  {:fns ["with-graphics"],
   :ns "quil.snippets.rendering",

  :name "save-frame",
  :opts {:renderer :p3d, :settings nil},
  :draw
  "((q/camera 150 150 150 0 0 0 0 0 1) (q/background 127) (q/with-rotation [(/ (q/frame-count) 10)] (q/box 100)) (q/save-frame) (q/save-frame \"generated/rotating-box-####.png\"))",
  :setup "()",
  :target :clj}
 {:fns ["save"],

  :name "delay",
  :opts {:settings nil},
  :draw
  "((q/background 127) (q/ellipse (* 5 (q/frame-count)) (* 5 (q/frame-count)) 50 50) (comment \"delay frame for random duration between 0 and 2s\") (q/delay-frame (rand-int (* 500 (rand-int 4)))))",
  :setup "()",
  :target :clj}
 {:fns ["push-style" "pop-style"],
