Permalink
Browse files

update to cantor 0.2.1, and make with-viewport amenable to functions …

…that calculate the rectangle
  • Loading branch information...
1 parent e5fa819 commit 70b349c11fec39752a211ba4b3546df8a81dd01c @ztellman committed Jul 3, 2010
Showing with 8 additions and 6 deletions.
  1. +1 −1 project.clj
  2. +7 −5 src/penumbra/opengl.clj
View
@@ -1,7 +1,7 @@
(defproject penumbra "0.6.0-SNAPSHOT"
:description "An idiomatic wrapper for OpenGL"
:dependencies [[slick-util "1.0.0"]
- [cantor "0.2.0"]
+ [cantor "0.2.1"]
[org.clojure/clojure "1.2.0-master-SNAPSHOT"]
[org.clojure/clojure-contrib "1.2.0-SNAPSHOT"]]
:native-dependencies [[penumbra/lwjgl "2.4.2"]]
@@ -116,14 +116,16 @@
(gl-viewport x y w h)))
(defmacro with-viewport
- "Sets the render window within the inner scope."
- [[x y w h] & body]
- `(let [[x# y# w# h#] @*view*]
- (viewport ~x ~y ~w ~h)
+ "Sets the render window within the inner scope.
+
+ 'rect' is of the form [x y w h]."
+ [rect & body]
+ `(let [old-view# @*view*]
+ (apply viewport ~rect)
(try
~@body
(finally
- (viewport x# y# w# h#)))))
+ (apply viewport old-view#)))))
(gl-import- glOrtho gl-ortho)
(gl-import- gluPerspective glu-perspective)

0 comments on commit 70b349c

Please sign in to comment.