Permalink
Browse files

update for cantor 0.2.0

  • Loading branch information...
2 parents cc3baeb + a5045ad commit 042733150c0717faf6447626b6206f5683683e2e @ztellman committed May 30, 2010
View
@@ -6,6 +6,7 @@ penumbra.ipr
/lib/*
/native/*
/autodoc/*
+autodoc
penumbra.jar
pom.xml
META-INF
View
@@ -1,7 +1,11 @@
(defproject penumbra "0.6.0-SNAPSHOT"
:description "An idiomatic wrapper for OpenGL"
:dependencies [[slick-util "1.0.0"]
+<<<<<<< HEAD:project.clj
[cantor "0.2.0-SNAPSHOT"]
+=======
+ [cantor "0.1.0"]
+>>>>>>> a5045ad609301cde724c2ca32b1596e1af5bff48:project.clj
[org.clojure/clojure "1.2.0-master-SNAPSHOT"]
[org.clojure/clojure-contrib "1.2.0-SNAPSHOT"]]
:native-dependencies [[penumbra/lwjgl "2.4.2"]]
@@ -182,7 +182,7 @@
(filter #(imports (:name %)) sigs))))))
(auto-import penumbra.app.window/Window
- title! size fullscreen! vsync! display-mode!)
+ title! size fullscreen! vsync! display-mode! display-modes)
(auto-import penumbra.app.controller/Controller
stop! pause!)
@@ -194,7 +194,7 @@
(defmethod transformer 'nth [x]
(concat
(take (-> x count dec) x)
- (if (-> x last number?)
+ (if (or (-> x last number?) (-> x last typeof (= :int)))
(list (int (last x)))
(list (list 'int (last x))))))
@@ -255,4 +255,4 @@
(map #(list 'declare %) decl))
(list
'defn 'void 'main []
- (list 'do x))))))
+ (list 'do x))))))
@@ -12,17 +12,17 @@
'((defn float4 lighting
[(in int -i)
(in float3 -normal)]
- (let [n-dot-vp (max 0 (dot -normal (-> :light-source (nth -i) .position float3 normalize)))
- n-dot-hv (max 0 (dot -normal (-> :light-source (nth -i) .halfVector float3 normalize)))]
+ (let [n-dot-vp (max 0 (dot -normal (-> :light-source (nth 0) .position float3 normalize)))
+ n-dot-hv (max 0 (dot -normal (-> :light-source (nth 0) .halfVector float3 normalize)))]
(let [pf (float (if (= n-dot-vp 0)
0
(pow n-dot-hv (-> :front-material .shininess))))
- ambient (float4 (-> :light-source (nth -i) .ambient))
- diffuse (float4 (-> :light-source (nth -i) .diffuse (* n-dot-vp)))
- specular (float4 (-> :light-source (nth -i) .specular (* pf)))]
+ ambient (float4 (-> :light-source (nth 0) .ambient))
+ diffuse (float4 (-> :light-source (nth 0) .diffuse (* n-dot-vp)))
+ specular (float4 (-> :light-source (nth 0) .specular (* pf)))]
(return
(+
(-> :front-light-model-product .sceneColor)
(-> :front-material .ambient (* ambient))
(-> :front-material .specular (* specular))
- (-> :front-material .diffuse (* diffuse)))))))))
+ (-> :front-material .diffuse (* diffuse)))))))))
@@ -470,4 +470,4 @@
(with-program (:program info)
(run-renderer
(assoc info :attributes (:attributes programs))
- f)))))))
+ f)))))))
@@ -16,11 +16,11 @@
;;Render Buffers
-(gl-import- glGenRenderbuffers gl-gen-render-buffers)
-(gl-import- glBindRenderbuffer gl-bind-render-buffer)
-(gl-import- glRenderbufferStorage gl-render-buffer-storage)
-(gl-import- glFramebufferRenderbuffer gl-frame-buffer-render-buffer)
-(gl-import- glDeleteRenderbuffers gl-delete-render-buffers)
+(gl-import- glGenRenderbuffersEXT gl-gen-render-buffers)
+(gl-import- glBindRenderbufferEXT gl-bind-render-buffer)
+(gl-import- glRenderbufferStorageEXT gl-render-buffer-storage)
+(gl-import- glFramebufferRenderbufferEXT gl-frame-buffer-render-buffer)
+(gl-import- glDeleteRenderbuffersEXT gl-delete-render-buffers)
(defn gen-render-buffer
"Creates a render buffer."
@@ -58,14 +58,14 @@
;;Frame Buffers
-(gl-import- glGenFramebuffers gl-gen-frame-buffers)
-(gl-import- glBindFramebuffer gl-bind-frame-buffer)
-(gl-import- glCheckFramebufferStatus gl-check-frame-buffer-status)
-(gl-import- glDeleteFramebuffers gl-delete-frame-buffers)
-(gl-import- glFramebufferTexture gl-frame-buffer-texture)
-(gl-import- glFramebufferTexture2D gl-frame-buffer-texture-2d)
-(gl-import- glFramebufferTexture3D gl-frame-buffer-texture-3d)
-(gl-import- glFramebufferTextureLayer gl-frame-buffer-texture-layer)
+(gl-import- glGenFramebuffersEXT gl-gen-frame-buffers)
+(gl-import- glBindFramebufferEXT gl-bind-frame-buffer)
+(gl-import- glCheckFramebufferStatusEXT gl-check-frame-buffer-status)
+(gl-import- glDeleteFramebuffersEXT gl-delete-frame-buffers)
+(gl-import- glFramebufferTextureEXT gl-frame-buffer-texture)
+(gl-import- glFramebufferTexture2DEXT gl-frame-buffer-texture-2d)
+(gl-import- glFramebufferTexture3DEXT gl-frame-buffer-texture-3d)
+(gl-import- glFramebufferTextureLayerEXT gl-frame-buffer-texture-layer)
(gl-import- glDrawBuffers gl-draw-buffers)
(gl-import- glDrawBuffer draw-buffer)
(gl-import- glReadBuffer gl-read-buffer)
@@ -178,4 +178,4 @@
(try
(f)
(finally
- (bind-frame-buffer 0)))))
+ (bind-frame-buffer 0)))))
@@ -7,7 +7,7 @@
; You must not remove this notice, or any other, from this software.
(ns ^{:skip-wiki true}
- penumbra.opengl.geometry
+ penumbra.opengl.geometry
(:use [clojure.contrib.def :only (defmacro- defvar)]
[cantor]
[penumbra.opengl.core])
@@ -24,6 +24,7 @@
(if-let [font (@*font-cache* (list* name modifiers))]
font
(let [hash (apply hash-map modifiers)
+ hash (update-in hash [:size] float)
hash (assoc hash :family name)
hash (zipmap (map text-attribute (keys hash)) (vals hash))
font (TrueTypeFont. (Font. hash) true)]
@@ -332,7 +332,7 @@
(defn init [state]
(app/title! "Asteroids")
- (app/vsync! false)
+ (app/vsync! true)
(app/key-repeat! false)
(init-asteroids)
(init-particles)
@@ -62,7 +62,7 @@
(*= pos (float3 2)))
(let [marble (-> position .x (+ noise) (* 2) sin abs)
mixed (mix [0.2 0.15 0.1 1] [0.8 0.7 0.7 1] (pow marble 0.75))]
- (* mixed (lighting 0 normal)))))
+ (* mixed (lighting 0 normal)))))
(app/title! "Marble")
(enable :depth-test)

0 comments on commit 0427331

Please sign in to comment.