Hi Kenny and all the other mostly read-onlies ;-)
I have been digging into the GLUT-INIT issue for a couple of hours. First thing to do was to update UFFI to the current stable version of 1.4.28.
This fixed a couple of things. Next surprise for me was to discover that the code in the ffi-extender package was OpenMCL/MCL unaware. So this got me into trouble as Kenny does a lot of things in that package that I call "advanced stuff".
This is where I am still just completing the OpenMCL way of doing things. Along that path I had the joy of learning OpenMCL's FFI and some of UFFI's internals. Becoming better with Common Lisp, guys...
Another thing I could find was an interesting part of sample code in the OpenMCL distro:
x-x-x (in-package :opengl)
;; glut complains if it's initialized redundantly (let ((glut-initialized-p nil)) (defun initialize-glut () (let ((command-line-strings (list "openmcl"))) (when (not glut-initialized-p) (ccl::with-string-vector (argv command-line-strings) (rlet ((argvp (* t)) ; glutinit takes (* (:signed 32)) and (* (* (:unsigned 8))) (argcp :signed)) ; so why are these declared as (* t) and :signed? (setf (%get-long argcp) (length command-line-strings) (%get-ptr argvp) argv) (#_glutInit argcp argvp))) (setf glut-initialized-p t)))) ;; When a saved image is restarted, it needs to know that glut ;; hasn't been initialized yet. (defun uninitialize-glut () (setf glut-initialized-p nil)) )
(pushnew #'uninitialize-glut ccl::*save-exit-functions* :key #'ccl::function-name) x-x-x
I am currently translating this into an UFFI-version and hope to fix the problem calling GLUT-INIT.
That's it, unfortunately. I am still not at the speed I wish to be...
Cheers to everybody!
Frank - enjoying an all-new Powerbook G4 ...