[cello-devel] Re: Cello

Kenny Tilton ktilton at nyc.rr.com
Sun Mar 7 05:04:03 UTC 2004



jan wrote:

>"Thomas F. Burdick" <tfb at OCF.Berkeley.EDU> writes:
>
>  
>
>>Kenny Tilton writes:
>>    
>>
>>>jan wrote:
>>>
>>>      
>>>
>>>>Hi Kenny,
>>>>
>>>>At the moment the CMUCL port isn't going well, the only `progress'
>>>>I've been able to make since I last mailed you was to find that the
>>>>same problem occurs on SBCL.
>>>>        
>>>>
>>>Sounds specific. What is the problem?
>>>      
>>>
>>Yikes, I'm curious too.
>>    
>>
>
>Here is the minimal program I'm trying to get working.
>I'm getting a segfault in ffi land.
>
On which call? If to glutMainLoop, do you manage to re-enter any callback?

Don't be discouraged. FFI is hell on wheels. But once you are staring at 
a specific call and stare at the ffi doc you'll likely spot something. I 
see something: you are not using UFFI. That might actually be a good 
idea, just to eliminate one level of uncertainty, but I would go with 
UFFI unless you happen to be a CMUCL FFI whiz. (Pardon if you indeed are 
and are in fact doing the wise thing of leaving out the extra layer. The 
following does look knowledgable.)

kt

>
>(sys::load-object-file #p"/usr/lib/libGL.so")
>(sys::load-object-file #p"/usr/lib/libglut.so")
>
>(alien:def-alien-routine ("glFlush" gl-flush)
>    c-call:void)
>
>(alien:def-alien-routine ("glClear" gl-clear)
>    c-call:void
>  (mask integer :in))
>
>(alien:def-alien-routine ("glutInitDisplayMode" glut-init-display-mode)
>    c-call:void
>  (mode c-call:unsigned-int :in))
>
>(alien:def-alien-routine ("glutCreateWindow" glut-create-window)
>    integer
>  (title c-call:c-string :in))
>
>(alien:def-alien-routine ("glutDisplayFunc" glut-display-func)
>    c-call:void
>  (callback (* t) :in))
>
>(alien:def-alien-routine ("glutMainLoop" glut-main-loop)
>    c-call:void)
>
>(defconstant GL_COLOR_BUFFER_BIT #x00004000)
>(defconstant GLUT_SINGLE #x0000)
>(defconstant GLUT_RGB #x0000)
>
>(alien:def-callback simple-render (c-call:void)
>  (gl-clear GL_COLOR_BUFFER_BIT) 
>  (gl-flush))
>
>(defun simple-window ()
>  (glut-init-display-mode (logior GLUT_SINGLE GLUT_RGB))
>  (glut-create-window "Title.")
>  (glut-display-func (alien:callback simple-render))
>  (glut-main-loop))
>
>;(simple-window)
>
>
>  
>

-- 
http://tilton-technology.com

Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film 

Your Project Here! http://alu.cliki.net/Industry%20Application






More information about the cello-devel mailing list