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 ...
On Oct 28, 2004, at 1:56 PM, Frank Goenninger wrote:
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".
Oops. :) Sounds like you are past that though.
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:
Ah, lucky us! Do they have a working OpenGL demo?
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...
Can't wait to see what you do at full speed if you think this is slow. :)
Over here I have managed to build enough under Lispworks to run lesson-14, except now I have to sort out glutInit and feature out glut-set-option and set up glut-wm-close etc etc., so I am right behind you. Let's keep each other posted.
btw, I used the latest UFFI and this time Lispworks did not complain about anything. That made me happy. :)
kt
On Thu, 2004-10-28 at 21:41, Kenneth Tilton wrote:
On Oct 28, 2004, at 1:56 PM, Frank Goenninger wrote:
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".
Oops. :) Sounds like you are past that though.
No, unfortunately I am stuck here.
Kenny, it would help if you could explain the semantical differences between the following functions/macros:
ffx::ff-defun-callable ffx::ff-def-call
(hmm - The question mark in my faces says: When to use which?)
Why are you not just using UFFI's def-function here?
It seems I have missed something very fundamental here...
Another PITA is the the fact that I couldn't find a way of making callbacks to simply work as expected. I figured that defcallback is a macro in OpenMCL to be wrapped around the body of the callback, not just a "register" operation as used in your ffx package...
So: ???
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:
Ah, lucky us! Do they have a working OpenGL demo?
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.
Only a quick hack available so far. This needs a lot of polishing to be production quality.
That's it, unfortunately. I am still not at the speed I wish to be...
Can't wait to see what you do at full speed if you think this is slow. :)
Over here I have managed to build enough under Lispworks to run lesson-14, except now I have to sort out glutInit and feature out glut-set-option and set up glut-wm-close etc etc., so I am right behind you. Let's keep each other posted.
Congrats! Yeah, but I feel we're in quite good comms.
btw, I used the latest UFFI and this time Lispworks did not complain about anything. That made me happy. :)
kt
Well, currently I am a bit frustrated. Several pieces still to be fixed and no progress for two days... ;-)
Frank