Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Lispbuilder-SDL "object"?

12 views
Skip to first unread message

kura...@gmail.com

unread,
Nov 25, 2007, 7:12:29 AM11/25/07
to
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 :)

Ken Tilton

unread,
Nov 25, 2007, 12:09:49 PM11/25/07
to

<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

kura...@gmail.com

unread,
Nov 25, 2007, 12:48:08 PM11/25/07
to
On Nov 25, 7:09 pm, Ken Tilton <kennytil...@optonline.net> wrote:
> --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

Luke Crook

unread,
Nov 27, 2007, 6:19:51 AM11/27/07
to
On Nov 25, 9:48 am, kuratk...@gmail.com wrote:
> On Nov 25, 7:09 pm, Ken Tilton <kennytil...@optonline.net> wrote:
>
> > kuratk...@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

Luke Crook

unread,
Nov 27, 2007, 6:29:11 AM11/27/07
to
On Nov 27, 3:19 am, Luke Crook <l...@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

0 new messages