 (defonce untitled-applet-id* (atom 0))
 (def ^:dynamic *applet* nil)
 (def ^:dynamic *graphics* nil)
+
+(defn- no-fn
+  "Function that does nothing."
+  [])
 
 (defn ^PApplet current-applet []
   *applet*)

        target            (validate-target! (:target options))
        title             (or (:title options) (str "Quil " (swap! untitled-applet-id* inc)))
        renderer          (or (:renderer options) :java2d)
        draw-fn           (or (:draw options) (fn [] nil))
        output-file       (validate-output-file! renderer (:output-file options))
        target            (if (empty? output-file) target :none)
        setup-fn          (fn []
                            (when-let [wheel-listener (wrap-mouse-wheel (:mouse-wheel options)
                                                                        (current-applet))]
                              (.addMouseWheelListener (current-applet) wheel-listener))
                            (when-let [f (:setup options)]
                              (f)))
        safe-draw-fn      (fn []
                            (try
                              (draw-fn)


(generate-listeners)

(defn -mouseWheel [this evt]
  (with-applet this
    (when-let [mouse-wheel (:mouse-wheel (.state this))]
      (mouse-wheel (.getCount evt)))))

(defn applet
  "Create and start a new visualisation applet.
