[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:52: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
> ) 

Thx, that works on ACL/win32 as well. Will be committed to CVS shortly.

>
>
> 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... 

As per my earlier,  this code works fine for me:

 (glut-stroke-string (ffi-glut-id glut_stroke_roman)
      (format nil "NeHe - ~a" (/ g_rot 50.0)))

With glut_stroke_roman as zero. I would worry that X11 Freeglut varies 
here from win32, but... did this test function work for you the last 
time you ported to Linux?

-- 
Kenny

Why Lisp? http://lisp.tech.coop/RtL%20Highlight%20Film

"If you plan to enter text which our system might consider to be obscene, check here to certify that you are old enough to hear the resulting output." -- Bell Labs text-to-speech interactive Web page






More information about the cello-devel mailing list