Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Lisp > lispbuilder-sdl...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 12406 of 13573
Post > Topic >>

lispbuilder-sdl-question

by C S S <css@[EMAIL PROTECTED] > May 2, 2008 at 01:35 AM

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.
 




 1 Posts in Topic:
lispbuilder-sdl-question
C S S <css@[EMAIL PROT  2008-05-02 01:35:31 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Oct 6 10:56:59 CDT 2008.