[cello-cvs] CVS cello/kt-opengl

fgoenninger fgoenninger at common-lisp.net
Mon Aug 28 18:36:41 UTC 2006


Update of /project/cello/cvsroot/cello/kt-opengl
In directory clnet:/tmp/cvs-serv20116

Modified Files:
	ogl-utils.lisp 
Log Message:
Added: Id for CVS info
Changed: Done some code "beautifying" for myself being able to understand this better...

--- /project/cello/cvsroot/cello/kt-opengl/ogl-utils.lisp	2006/08/24 17:35:08	1.5
+++ /project/cello/cvsroot/cello/kt-opengl/ogl-utils.lisp	2006/08/28 18:36:40	1.6
@@ -22,17 +22,16 @@
 ;;; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 
 ;;; IN THE SOFTWARE.
 
-
+;;; $Id: ogl-utils.lisp,v 1.6 2006/08/28 18:36:40 fgoenninger Exp $
 
 (in-package :kt-opengl)
 
 (defun ogl-tex-activate (tex-name)
   (assert tex-name)
   ;;(print `(ogl-tex-activate doing ,tex-name))
-  (gl-bind-texture gl_texture_2d tex-name)
   (gl-enable gl_texture_2d)
-  (gl-polygon-mode gl_front_and_back gl_fill) ;; just front?
-  )
+  (gl-bind-texture gl_texture_2d tex-name)
+  (gl-polygon-mode gl_front_and_back gl_fill)) ;; just front ?
 
 (defparameter *textures-1* (fgn-alloc 'gluint 1 :ignore))
 
@@ -47,9 +46,15 @@
   (glec :ogl-texture-gen)
   (ff-elt *textures-1* gluint 0))
 
-(let (gl-s-plane gl-t-plane gl-r-plane gl-q-plane)
+(let ((gl-s-plane nil)
+      (gl-t-plane nil)
+      (gl-r-plane nil)
+      (gl-q-plane nil))
+
   (defun ogl-tex-gen-setup (mode tex-env tex-wrap scale &rest planes)
-    ;;(trc nil "ogl-tex-gen-setup:" mode tex-env tex-wrap scale planes)
+
+    ;;(trc "ogl-tex-gen-setup:" mode tex-env tex-wrap scale planes)
+
     (gl-tex-envf gl_texture_env gl_texture_env_mode tex-env)
     (gl-tex-parameterf gl_texture_2d gl_texture_min_filter gl_linear )
     (gl-tex-parameterf gl_texture_2d gl_texture_mag_filter gl_linear )
@@ -58,23 +63,23 @@
     (gl-tex-parameteri gl_texture_2d gl_texture_wrap_t tex-wrap) ;--
     
     (loop for plane in planes
-        do (ecase plane
-             (:s  (gl-tex-geni gl_s gl_texture_gen_mode mode)
-               (gl-tex-genfv gl_s gl_object_plane
-                 (ff-floatv-ensure gl-s-plane scale 0 0 0))
-               (gl-enable gl_texture_gen_s))
-             (:tee  (gl-tex-geni gl_t gl_texture_gen_mode mode)
-               (gl-tex-genfv gl_t gl_object_plane
-                 (ff-floatv-ensure gl-t-plane 0 scale 0 0))
-               (gl-enable gl_texture_gen_t))
-             (:r  (gl-tex-geni gl_r gl_texture_gen_mode mode)
-               (gl-tex-genfv gl_r gl_object_plane
-                 (ff-floatv-ensure gl-r-plane 0 0 scale 0))
-               (gl-enable gl_texture_gen_r))
-             (:q  (gl-tex-geni gl_q gl_texture_gen_mode mode)
-               (gl-tex-genfv gl_q gl_object_plane
-                 (ff-floatv-ensure gl-q-plane 0 0 scale 0))
-               (gl-enable gl_texture_gen_q))))))
+       do (ecase plane
+	    (:s  (gl-tex-geni gl_s gl_texture_gen_mode mode)
+		 (gl-tex-genfv gl_s gl_object_plane
+			       (ff-floatv-ensure gl-s-plane scale 0 0 0))
+		 (gl-enable gl_texture_gen_s))
+	    (:tee  (gl-tex-geni gl_t gl_texture_gen_mode mode)
+		   (gl-tex-genfv gl_t gl_object_plane
+				 (ff-floatv-ensure gl-t-plane 0 scale 0 0))
+		   (gl-enable gl_texture_gen_t))
+	    (:r  (gl-tex-geni gl_r gl_texture_gen_mode mode)
+		 (gl-tex-genfv gl_r gl_object_plane
+			       (ff-floatv-ensure gl-r-plane 0 0 scale 0))
+		 (gl-enable gl_texture_gen_r))
+	    (:q  (gl-tex-geni gl_q gl_texture_gen_mode mode)
+		 (gl-tex-genfv gl_q gl_object_plane
+			       (ff-floatv-ensure gl-q-plane 0 0 scale 0))
+		 (gl-enable gl_texture_gen_q))))))
 
 (defun ogl-scissor-box ()
   (let ((box (fgn-alloc 'glint 4 :scissor)))




More information about the Cello-cvs mailing list