Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…that calculate the rectangle
  • Loading branch information...
commit 70b349c11fec39752a211ba4b3546df8a81dd01c 1 parent e5fa819
@ztellman authored
Showing with 8 additions and 6 deletions.
  1. +1 −1  project.clj
  2. +7 −5 src/penumbra/opengl.clj
View
2  project.clj
@@ -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"]]
View
12 src/penumbra/opengl.clj
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.