From: C S S
Subject: lispbuilder-sdl-question
Date: 
Message-ID: <fvdk43$aor$1@news.lrz-muenchen.de>
Hello. I am using lispbuilder-sdl mostly on sbcl, and some strange 
behavior is keeping me awake at the moment (because it made my program 
not work).

The following code draws a diagonal white line onto a little window:

(sdl:with-init () (sdl:window 300 300)
			(let ((surface1 (sdl:create-surface 300 300))
			      (surface2 (sdl:create-surface 300 300)))
			  (sdl:draw-line-* 0 0 100 100 :color (sdl:color :r 255 :g 255 :b 255))
			  (sdl:update-display))
			    (sdl:with-events ()
			      (:quit-event () t)))

The following code does the same, but it first draws it to another 
surface, and then blits this surface on the display:

(sdl:with-init () (sdl:window 300 300)
			(let ((surface1 (sdl:create-surface 300 300))
			      (surface2 (sdl:create-surface 300 300)))
			  (sdl:draw-line-* 0 0 100 100 :color (sdl:color :r 255 :g 255 :b 
255) :surface surface1)
			  (sdl:update-surface surface1)
			  (sdl:blit-surface surface1))
			  (sdl:update-display)
			    (sdl:with-events ()
			      (:quit-event () t))
			    )

So far it all works fine. But when I first use surface2 to draw the 
line, then blit it to surface1 and then blit surface1 to the screen, as 
the following code does, nothing happens:

(sdl:with-init () (sdl:window 300 300)
			(let ((surface1 (sdl:create-surface 300 300))
			      (surface2 (sdl:create-surface 300 300)))
			  (sdl:draw-line-* 0 0 100 100 :color (sdl:color :r 255 :g 255 :b 
255) :surface surface2)
			  (sdl:update-surface surface2)
			  (sdl:blit-surface surface2 surface1)
			  (sdl:update-surface surface1)
			  (sdl:blit-surface surface1)
			  (sdl:update-display))
			    (sdl:with-events ()
			      (:quit-event () t)))

A black window appears, and no white line. Maybe I didnt set some of the 
flags correctly. I dont know.

Well, these examples seem to be stupid, but in fact, I need to draw a 
few surfaces onto a bigger surface and then draw this bigger surface on 
the screen (which also didnt work). The Lispbuilder-SDL-Version should 
be the latest svn-Version "Revision 704".

Maybe I have set some Flags for the Surfaces wrong, I dont know.

Can anybody explain to me, why lispbuilder-sdl acts that way (and maybe, 
if I could do what I want in some other way)?

Thank You
CSS

PS: When running these commands under CLISP, the same happens.