From: ·········@gmail.com
Subject: Lispbuilder-SDL "object"?
Date: 
Message-ID: <5251b5b0-71f8-40f0-9537-7b67ee42726d@e25g2000prg.googlegroups.com>
Hello, I am using lispbuilder-SDL and I have been wondering about a
something for some time now.
If we look in the lispbuilder-sdl manual:

get-position object => result
AND
get-position (object sdl-surface) => result

What is the "object"? Let's say I want to move my surface. I first
have to get it's location, but I am stumped...
None of the examples use this function neither.

Thanks for any help :)

From: Ken Tilton
Subject: Re: Lispbuilder-SDL "object"?
Date: 
Message-ID: <x%h2j.1933$Oe4.640@newsfe10.lga>
·········@gmail.com wrote:
> Hello, I am using lispbuilder-SDL and I have been wondering about a
> something for some time now.
> If we look in the lispbuilder-sdl manual:
> 
> get-position object => result
> AND
> get-position (object sdl-surface) => result
> 
> What is the "object"? Let's say I want to move my surface. I first
> have to get it's location, but I am stumped...
> None of the examples use this function neither.
> 
> Thanks for any help :)

<cough> This is Lisp, why don't you run it and see?:

    (format t "~&get-position on ~a returns ~a"
             my-surface (get-position my-surface))

Perhaps you are thrown by the formatting of their documentation? 
Something like:

    get-position (object sdl-surface)


...documents:

(defmethod get-position ((object sdl-surface))
     (...whatever...))

ie, They are not talking about two different parametrs (1) object and 
(2) sdl-surface, altho it sure looks that way.

kt

ps. Fair warning, i do not actually use cl-sdl, but I did go look at 
their doc before answering. k

-- 
http://www.theoryyalgebra.com/

"In the morning, hear the Way;
  in the evening, die content!"
                     -- Confucius
From: ·········@gmail.com
Subject: Re: Lispbuilder-SDL "object"?
Date: 
Message-ID: <e0c6ce1b-4049-4c9a-9396-ef59772e1b02@y43g2000hsy.googlegroups.com>
On Nov 25, 7:09 pm, Ken Tilton <···········@optonline.net> wrote:
> ·········@gmail.com wrote:
> > Hello, I am using lispbuilder-SDL and I have been wondering about a
> > something for some time now.
> > If we look in the lispbuilder-sdl manual:
>
> > get-position object => result
> > AND
> > get-position (object sdl-surface) => result
>
> > What is the "object"? Let's say I want to move my surface. I first
> > have to get it's location, but I am stumped...
> > None of the examples use this function neither.
>
> > Thanks for any help :)
>
> <cough> This is Lisp, why don't you run it and see?:
>
>     (format t "~&get-position on ~a returns ~a"
>              my-surface (get-position my-surface))
>
> Perhaps you are thrown by the formatting of their documentation?
> Something like:
>
>     get-position (object sdl-surface)
>
> ...documents:
>
> (defmethod get-position ((object sdl-surface))
>      (...whatever...))
>
> ie, They are not talking about two different parametrs (1) object and
> (2) sdl-surface, altho it sure looks that way.
>
> kt
>
> ps. Fair warning, i do not actually use cl-sdl, but I did go look at
> their doc before answering. k
>
> --http://www.theoryyalgebra.com/
>
> "In the morning, hear the Way;
>   in the evening, die content!"
>                      -- Confucius

Thanks,
yes it seemed to me that it also requires some weird "object" besides
the surface.
Thanks again :)

kuratkull
From: Luke Crook
Subject: Re: Lispbuilder-SDL "object"?
Date: 
Message-ID: <5490a916-1adc-4ada-afa8-b76ad8110483@e23g2000prf.googlegroups.com>
On Nov 25, 9:48 am, ·········@gmail.com wrote:
> On Nov 25, 7:09 pm, Ken Tilton <···········@optonline.net> wrote:
>
> > ·········@gmail.com wrote:
> > > get-position object => result
> > > AND
> > > get-position (object sdl-surface) => result
>
> > > What is the "object"? Let's say I want to move my surface. I first
> > > have to get it's location, but I am stumped...
> > > None of the examples use this function neither.
>
> > > Thanks for any help :)
>
> > Perhaps you are thrown by the formatting of their documentation?
> > Something like:
>
> >     get-position (object sdl-surface)
>
> > ...documents:
>
> > (defmethod get-position ((object sdl-surface))
> >      (...whatever...))
>
> > ie, They are not talking about two different parametrs (1) object and
> > (2) sdl-surface, altho it sure looks that way.
>
> yes it seemed to me that it also requires some weird "object" besides
> the surface.

Pass GET-POSITION a SURFACE or a RECTANGLE to return an object of type
POINT containing the X and Y coords of the SURFACE or RECTANGLE.
For example:

(setf *a-surface* (sdl:create-surface 50 50))
(setf *b-surface* (sdl:create-surface 50 50))
(setf (sdl:x *a-surface*) 20)
      (sdl:y *a-surface*) 30)
(sdl:set-surface *b-surface* (sdl:get-position *a-surface*))


"get-position object => result"

This is the doc string for the generic function.

"get-position (object sdl-surface) => result"

This is the doc string for the defmethod specializing on SDL-SURFACE.

"get-position (object rectangle) => result"

This is the doc string for the defmethod specializing on RECTANGLE.

The documentation is generated from the documentation strings using
Edi Weitz's DOCUMENTATION-TEMPLATE, and Gary King's CL-MARKDOWN.

- http://www.weitz.de/documentation-template/
- http://common-lisp.net/project/cl-markdown/

- Luke
From: Luke Crook
Subject: Re: Lispbuilder-SDL "object"?
Date: 
Message-ID: <e92c62fe-eb2a-4fb7-942a-fb87d72e8b60@s19g2000prg.googlegroups.com>
On Nov 27, 3:19 am, Luke Crook <····@balooga.com> wrote:
> (sdl:set-surface *b-surface* (sdl:get-position *a-surface*))

SET-SURFACE and SET-POSITION do the same thing. I'm going to delete
SET-SURFACE from the svn repo.

So then;

(sdl:set-position *b-surface* (sdl:get-position *a-surface*))

- Luke