I want to use lispbuilder-sdl to implement a simple GUI (of a Go board). 
  Then I want to provide functions that I can call to place and remove 
stones from the board. But I want the SDL to be passive--just sitting 
there until I call one of those functions. Basically the GUI is going to 
be one possible view into a Go engine that is actually running the show 
so I don't want the main loop to be in the SDL function.

At the moment I have this function:

(defun draw-board ()
   (sdl:with-init ()
     (sdl:window *size* *size* :title-caption "Go Board")
     (setf (sdl:frame-rate) 5)
     (sdl:clear-display (sdl:color :r #xcc :g #x99 :b #x33))

     (loop for i from 0 to 18
        do
        (sdl:draw-line (board-point 0 i)
                      (board-point 18 i)
                      :color (sdl:color :r 0 :g 0 :b 0))
        (sdl:draw-line (board-point i 0)
                      (board-point i 18)
                      :color (sdl:color :r 0 :g 0 :b 0)))

     (loop for x from 3 to 15 by 6 do
         (loop for y from 3 to 15 by 6 do
              (sdl:draw-filled-circle (board-point x y) 3
                                      :color (sdl:color :r 0 :g 0 :b 0))))
     (sdl:update-display)
     (sdl:with-events ()
       (:quit-event () (format t "Quitting.~%") t)
       (:video-expose-event () (sdl:update-display)))))

This works fine but the function never returns. I could run it in 
another thread but would rather not if I don't have to. Is there some 
simple change I can make or am I swimming against the tide of The SDL 
Way(tm).

-Peter


-- 
Peter Seibel            :  [EMAIL PROTECTED]
Gigamonkeys Consulting  :  http://www.gigamonkeys.com/
_______________________________________________
application-builder mailing list
[email protected]
http://www.lispniks.com/mailman/listinfo/application-builder

Reply via email to