     (resolve-renderer initial-renderer)))
 
 (defmacro generate-listeners
-  "Generates all listeners like onKeyPress, onMouseClick and others."
+  "Generates all listeners like `onKeyPress`, `onMouseClick` and others."
   []
   (letfn [(prefix [v method]
             (symbol (str v method)))

      :nothing)))

(defn applet-disposed
  "This function is called when PApplet executes 'dispose' method.
  It means we can dispose frame, call on-close function and perform other
  clean ups."
  [applet]
  (with-applet applet
    ((:on-close (meta applet))))

(def ^:private  executor (java.util.concurrent.Executors/newSingleThreadScheduledExecutor))

(defn- destroy-window
  "Clean up native window object once sketch is closed. Processing doesn't
  perform cleanups because it probably assumes that when the sketch is closed
  the JVM is closed as well which is not the case for clojure. So here we're
  performing renderer-specific cleanups."
  [applet]
  (let [native (-> applet .getSurface .getNative)]
    (condp = (.getClass native)
