[cello-cvs] CVS cello/kt-opengl

fgoenninger fgoenninger at common-lisp.net
Mon Aug 28 18:37:22 UTC 2006


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

Modified Files:
	ogl-macros.lisp 
Log Message:
Changed: Now using CFFI scheme for defining and using foreign libs.

--- /project/cello/cvsroot/cello/kt-opengl/ogl-macros.lisp	2006/08/21 04:28:29	1.6
+++ /project/cello/cvsroot/cello/kt-opengl/ogl-macros.lisp	2006/08/28 18:37:22	1.7
@@ -33,7 +33,6 @@
 (defmacro with-matrix ((&optional load-identity-p) &body body)
   `(call-with-matrix ,load-identity-p (lambda () , at body) ',body))
 
-
 (defun call-with-matrix (load-identity-p matrix-fn matrix-code)
   (declare (ignorable matrix-code))
   (gl-push-matrix)  
@@ -98,6 +97,7 @@
 
 (defvar *gl-begun*)
 (defvar *gl-stop*)
+
 (defmacro with-gl-begun ((what) &body body)
   `(progn
      (when (boundp '*gl-begun*)
@@ -123,24 +123,19 @@
          (gl-translatef (- ,dx)(- ,dy)(- ,dz))))))
 
 (defun kt-opengl-init ()
-  (declare (ignorable load-oglfont-p))
   (unless *opengl-dll*
-    #-mcl
     (progn
-      (print "loading open GL/GLU")
-      (cffi-uffi-compat:load-foreign-library
-       *gl-dynamic-lib*
-       :module "open-gl"))
-    #+mcl
-      (format t "~&We're on Darwin, so we do not load the OpenGL dynlib explicitely~%.")
-    #-mcl
-    (setf *opengl-dll* (cffi-uffi-compat:load-foreign-library *glu-dynamic-lib*
-                         :module "gl-util"))
-    #+mcl
-    (setf *opengl-dll* t)
-  ))
+       (let ((opengl-loaded-p
+               (use-foreign-library OpenGL))
+	     (glu-loaded-p
+               #+macosx
+               t ;; on Mac OS X, no explicit loading of GLU needed.
+              #-macosx 
+               (use-foreign-library GLU)))
+	(assert (and opengl-loaded-p glu-loaded-p))
+	(setf *opengl-dll* t)))))
 
-(eval-when (load eval)
+(eval-when (:load-toplevel :execute)
   (kt-opengl-init))
 
 (defun glec (&optional (id :anon))




More information about the Cello-cvs mailing list