Update of /project/cello/cvsroot/cello/kt-opengl
In directory clnet:/tmp/cvs-serv15578/kt-opengl
Modified Files:
kt-opengl.lpr ogl-macros.lisp
Log Message:
Ongoing merge with Celtk
--- /project/cello/cvsroot/cello/kt-opengl/kt-opengl.lpr 2006/05/27 06:01:39 1.1
+++ /project/cello/cvsroot/cello/kt-opengl/kt-opengl.lpr 2006/06/26 17:05:33 1.2
@@ -1,4 +1,4 @@
-;; -*- lisp-version: "8.0 [Windows] (May 22, 2006 0:51)"; cg: "1.81"; -*-
+;; -*- lisp-version: "8.0 [Windows] (Jun 21, 2006 9:54)"; cg: "1.81"; -*-
(in-package :cg-user)
--- /project/cello/cvsroot/cello/kt-opengl/ogl-macros.lisp 2006/06/11 13:32:25 1.2
+++ /project/cello/cvsroot/cello/kt-opengl/ogl-macros.lisp 2006/06/26 17:05:33 1.3
@@ -113,6 +113,19 @@
(gl-end)
(glec :with-gl-begun))))
+(defmacro with-gensyms ((&rest syms) &body body)
+ `(let ,(loop for sym in syms
+ collecting `(,sym (gensym)))
+ ,@body))
+
+(defmacro with-gl-translation ((dxf dyf &optional (dzf 0)) &body body)
+ (with-gensyms (dx dy dz)
+ `(let ((,dx ,dxf)(,dy ,dyf)(,dz ,dzf))
+ (gl-translatef ,dx ,dy ,dz)
+ (prog1
+ ,@body
+ (gl-translatef (- ,dx)(- ,dy)(- ,dz))))))
+
(defun kt-opengl-init ()
(declare (ignorable load-oglfont-p))
(unless *opengl-dll*