Browse files

Use library's applet.clj instead of our own.

  • Loading branch information...
1 parent 675f488 commit 7f9c67afda7e15af4a10121a0e1dec4a9877d046 @technomancy committed Aug 30, 2009
Showing with 10 additions and 30 deletions.
  1. +1 −1 README.md
  2. +2 −2 project.clj
  3. +0 −23 src/sketchbook/applet.clj
  4. +7 −4 src/sketchbook/pop.clj
View
2 README.md
@@ -11,7 +11,7 @@ Then run with:
$ corkscrew repl
Clojure 1.0.0--SNAPSHOT
user=> (require 'sketchbook.pop)
- user=> (sketchbook.pop/run)
+ user=> (sketchbook.pop/run-pop)
To install corkscrew, see http://github.com/technomancy/corkscrew
View
4 project.clj
@@ -4,5 +4,5 @@
:dependencies [["clojure" "1.0.0" "org.clojure"]
["clojure-contrib" "1.0-SNAPSHOT" "org.clojure"]
["processing.core" "1.0.6" "org.processing"]]
- :source-dependencies [["clj-processing" "82d4c6ae20db47f9539729b0a69e0b7f83fa177f"
- :git "git://github.com/rosado/clj-processing.git"]]}
+ :source-dependencies [["clj-processing" "master"
+ :git "git://github.com/technomancy/clj-processing.git"]]}
View
23 src/sketchbook/applet.clj
@@ -1,23 +0,0 @@
-(ns sketchbook.applet
- (:use rosado.processing)
- (:import (javax.swing JFrame)))
-
-(defmacro defapplet
- [name title setup draw width height]
- `(do
- (def ~name
- (proxy [processing.core.PApplet] []
- (setup []
- (binding [*applet* ~'this]
- (size ~width ~height)
- (~setup)))
- (draw []
- (binding [*applet* ~'this]
- (~draw)))))
- (defn ~(symbol (str "run-" name)) []
- (.init ~name)
- (doto (JFrame. ~title)
- (.setSize ~width ~height)
- (.add ~name)
- (.pack)
- (.show)))))
View
11 src/sketchbook/pop.clj
@@ -1,6 +1,7 @@
(ns sketchbook.pop
- (:use [sketchbook.applet]
- [rosado.processing]))
+ (:refer-clojure :exclude [pop])
+ (:use [rosado.processing]
+ [rosado.processing.applet]))
(def generation (atom 0.0))
@@ -17,7 +18,9 @@
(+ (* y 100) 10)
90 90))))
-(defapplet popp "Synthpop-inspired Jams"
+(defapplet pop "Synthpop-inspired Jams"
setup draw 510 510)
-(run-popp)
+;; To make things go:
+;; (run-pop)
+;; (stop-pop)

0 comments on commit 7f9c67a

Please sign in to comment.