[cello-devel] Re: cl-opengl/hello-c: make-ff-pointer problem on OS X / Allegro: Pse help
Kenny Tilton
ktilton at nyc.rr.com
Thu Jul 7 16:42:43 UTC 2005
Frank Goenninger - PRION Consulting wrote:
> Kenny & all:
>
> now that I am able to use ACL 7.0 and as I am currently re-porting
> Cello to OS X I ran into a problem with make-ff-pointer:
>
> When calling the make-ff-pointer function in order to get a ffi-glut-
> id for a font the function just returns the value passed to it. This
> is wrong and causes the following bus error:
>
> ------
>
> Received signal number 10 (Bus error)
> [Condition of type SYNCHRONOUS-OPERATING-SYSTEM-SIGNAL]
>
> Backtrace:
> 0: (SWANK::DEBUG-IN-EMACS #<SYNCHRONOUS-OPERATING-SYSTEM-SIGNAL @
> #x5831c02>)
> 1: (SWANK:SWANK-DEBUGGER-HOOK #<SYNCHRONOUS-OPERATING-SYSTEM- SIGNAL
> @ #x5831c02> #<Function SWANK-DEBUGGER-HOOK>)
> 2: (ERROR SYNCHRONOUS-OPERATING-SYSTEM-SIGNAL :NAME #1="Bus error"
> :NUMBER 10 :FORMAT-CONTROL "Received signal number ~s ~@[(~a) ~]"
> :FORMAT-ARGUMENTS (10 #1#))
> 3: (CL-OPENGL:GLUTSTROKECHARACTER #<FOREIGN-FUNCTIONS:FOREIGN-
> POINTER NIL #x0 @ #x5831752> 78)
> 4: (CL-OPENGL:GLUT-STROKE-CHARACTER #<FOREIGN-FUNCTIONS:FOREIGN-
> POINTER NIL #x0 @ #x5831752> 78)
> 5: (CL-OPENGL:GLUT-STROKE-STRING #<FOREIGN-FUNCTIONS:FOREIGN-
> POINTER NIL #x0 @ #x5831752> "NeHe - 0.0")
> 6: ((:INTERNAL CL-OPENGL::NH14-DISP 0))
>
> ------
>
> I modified function make-ff-pointer as follows:
>
> (defun make-ff-pointer (n)
> #+allegro (ff:make-foreign-pointer :address n :type '(* void))
> #+lispworks (fli:make-pointer :address n :pointer-type '(:pointer
> :void))
> #-(or lispworks allegro) n
> )
>
> As you can see from the backtrace the function in question is CL-
> OPENGL:GLUT-STROKE-STRING which gets called from within NH14-DISP.
> What is needed as the first parameter is a _pointer_ to a font...
> Now, how to do that - I am stuck...
I am investigating, but real quick: Freeglut lies. :) What is wanted is
an integer, an enum kinda thing, 0,1,2 --- they are hard-coded to mean
certain limited fonts Freeglut knows about.
kt
More information about the cello-devel
mailing list