[cello-devel] Re: Cello

jan janmar at iprimus.com.au
Sun Mar 7 03:06:49 UTC 2004


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

(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)


-- 
jan





More information about the cello-devel mailing list