Animation lib strategy

Are there any docs or sample code for SDL 1.3 on best practices for creating
a cross platfrom animation library?
My primary targets are win32, linux and iphone.
It’s purpose would be creating basic sprite motion, gui type objects, as
well as parallax scrolling.
I’m rather new to 2d programming and there seems to be quite a few ways to
light up pixels. Should I blit/clip? Or should I draw directly to the
surface?

Also, is such functionality wrapped by SDL on the iphone? Because it would
appear that the demos such as fireworks call OpenGLES directly.

Last question, where is the best place to find docs on the 1.3 stuff? It
doesn’t appear that the docs feature the 1.3 functions.

Sorry for the barrage of questions. I’m just getting in to this stuff and it
can be a tad overwhelming :slight_smile:

Are there any docs or sample code for SDL 1.3 on best practices for creating
a cross platfrom animation library?

AFAIK, the SDL 1.3 API has not even totally congealed yet. I doubt
anyone is going to write anything quite like what you’re asking for
SDL 1.3 in the immediate future.

My primary targets are win32, linux and iphone.
It’s purpose would be creating basic sprite motion, gui type objects, as
well as parallax scrolling.

Check out what people have done with SDL 1.2.x. Lessons learned
solving these problems transcend the differences between SDL 1.2 and
1.3.

I’m rather new to 2d programming and there seems to be quite a few ways to
light up pixels. Should I blit/clip? Or should I draw directly to the
surface?

I’m not sure what you mean by “draw directly to the surface.” To a lot
of people, blitting is just that. I guess you mean access individual
pixels values yourself to draw your sprites; in other words: implement
your own blitter.

Should you implement your own blitter? I can’t think of any good
reason to do that, except perhaps drawing lots of very small, very
sparse sprites, but I still wouldn’t implement my own blitter unless I
was attempting to overcome challenges on certain very specific
platforms that needed that kind of delicate touch.

Also, is such functionality wrapped by SDL on the iphone? Because it would
appear that the demos such as fireworks call OpenGLES directly.

You mean blitting? Is blitting wrapped by SDL APIs? Yes. Apparently
iPhone support is not fully implemented, there was a post about it on
the mailing list quite recently, look around.

If I were writing a portable “animation library” that does the
things you’ve mentioned, I would wrap all of my graphics functions,
and provide different implementations for those graphics functions for
different platforms (the primary differences I would think would be
between using OpenGL and using a framebuffer with help from SDL’s blit
functions; you may also want to check out SDL_Gfx.)

Last question, where is the best place to find docs on the 1.3 stuff? It
doesn’t appear that the docs feature the 1.3 functions.

When I want documentation on SDL 1.3, I go here:

http://svn.libsdl.org/trunk/SDL/

…or refer to my local copy.

Sorry for the barrage of questions. I’m just getting in to this stuff and it
can be a tad overwhelming :slight_smile:

No need to apologize! That’s what this list is forOn Mon, Dec 15, 2008 at 8:45 PM, Rick R <rick.richardson at gmail.com> wrote:


http://codebad.com/

Hi Rick,

Nice idea. There’re existing library to do what you want already. But I admit it’s not a reason for not providing another tool :slight_smile:
I’m thinking about the Kyra sprite engine:
http://www.grinninglizard.com/kyra/

And, of course, any other library referenced on http://www.libsdl.org/libraries.php
It’s not that easy to start from scratch, watching what the others have done can be a good starting point, and maybe avoid wasting time.

As for parallax problems, I did a special library called SDLayer (or SDL_Layer, I didn’t fix a name). It compiles on Linux, Windows and Mac OS X. You can grab the source code at:
http://code.google.com/p/sdl-layer/

It may not do exactly what you want. Its main purpose is to manage different levels (layers / planes) of display without you to bother with projections and refresh rectangles, which can be tedious when each plane/layer has its own scrolling factor (parallax).
There’re 2 demos showing what it can do.

Let me know if it can be of some interest. All you need is SDL 1.2 and SDL_image for the demos only.
I’m also working on a low level sprite library which manages pools of graphical objects moving on the screen, and having no mechanism whatsoever for animation. We can talk about it if you want.

Regards,
Julien

— En date de?: Mar 16.12.08, Rick R <rick.richardson at gmail.com> a ?crit?:de: Rick R <rick.richardson at gmail.com>
Objet: [SDL] animation lib strategy
?: sdl at lists.libsdl.org
Date: Mardi 16 D?cembre 2008, 2h45

Are there any docs or sample code for SDL 1.3 on best practices for creating a cross platfrom animation library?
My primary targets are win32, linux and iphone.
It’s purpose would be creating basic sprite motion, gui type objects, as well as parallax scrolling.

I’m rather new to 2d programming and there seems to be quite a few ways to light up pixels. Should I blit/clip? Or should I draw directly to the surface?

Also, is such functionality wrapped by SDL on the iphone? Because it would appear that the demos such as fireworks call OpenGLES directly.

Last question, where is the best place to find docs on the 1.3 stuff? It doesn’t appear that the docs feature the 1.3 functions.

Sorry for the barrage of questions. I’m just getting in to this stuff and it can be a tad overwhelming :slight_smile:


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

If he’s not too familiar with programing 2D graphics, it might not be a bad
idea for him to roll his own sprite/animation routines, if only for the
excersize. I did, and it helped me tremdously in getting a good
understanding of SDL, and 2D programming in general.

Cheers,
Peter

Actually my main problem with SDL Layer is that it has been downloaded
more than 500 times since the first stable version, but nobody ever
sent me a single email to say if it compiles and works or not (except
Phuoc of course, thank you !)

The Google Code is yet very
convenient to post Issues, and my email is available on the website …
I guess that’s the drawback of free software …

Julien

— En date de?: Mer 17.12.08, Phuoc Can Hua a ?crit?:de: Phuoc Can Hua
Objet: Re: [SDL] Re : animation lib strategy
?: @Julien_Clement1
Date: Mercredi 17 D?cembre 2008, 1h42

Rick,
I just want to add my comments to Julien’s
suggestions.

I’ve worked through Kyra. It has a very impressive demo and a detailed
documentation. The response I got from Kyra’s help forum was quick (but that
was over a year ago). It also has the widget feature, i.e. the sprites can be
use as buttons etc.

The limitation of Kyra is that all frames of a sprite are pre-defined, i.e.
can’t draw new image in runtime. For that case, I’m looking at
Julien’s SDL_layer because I mainly paint on different layers. I’m still
experimenting. So far I managed to run a slide show (movie) with overlayed text.

Regards
Phuoc

/_/_/_/_/_/_
www.huaonline.com
My Homepage is my Castle

— On Tue, 16/12/08, julien CLEMENT <@Julien_Clement1> wrote:

From: julien CLEMENT <@Julien_Clement1>
Subject: [SDL] Re : animation lib strategy
To: “A list for developers using the SDL library.
(includes
SDL-announce)”
Received: Tuesday, 16 December, 2008, 8:16 PM
Hi Rick,

Nice idea. There’re existing library to do what you
want already. But I admit it’s not a reason for not
providing another tool :slight_smile:
I’m thinking about the Kyra sprite engine:
http://www.grinninglizard.com/kyra/

And, of course, any other library referenced on
http://www.libsdl.org/libraries.php
It’s not that easy to start from scratch, watching what
the others have done can be a good starting point, and maybe
avoid wasting time.

As for parallax problems, I did a special library called
SDLayer (or SDL_Layer, I didn’t fix a name). It compiles
on Linux, Windows and Mac OS X. You can grab the source code
at:
http://code.google.com/p/sdl-layer/

It may not do exactly what you
want. Its main purpose is to
manage different levels (layers / planes) of display without
you to bother with projections and refresh rectangles, which
can be tedious when each plane/layer has its own scrolling
factor (parallax).
There’re 2 demos showing what it can do.

Let me know if it can be of some interest. All you need is
SDL 1.2 and SDL_image for the demos only.
I’m also working on a low level sprite library which
manages pools of graphical objects moving on the screen, and
having no mechanism whatsoever for animation. We can talk
about it if you want.

Regards,
Julien

— En date de?: Mar 16.12.08, Rick R
<rick.richardson at gmail.com> a ?crit?:
De: Rick R <rick.richardson at gmail.com>
Objet: [SDL] animation lib strategy
?: sdl at lists.libsdl.org
Date:
Mardi 16 D?cembre 2008, 2h45

Are there any docs or sample code for SDL 1.3 on best
practices for creating a cross platfrom animation library?
My primary targets are win32, linux and iphone.
It’s purpose would be creating basic sprite motion, gui
type objects, as well as parallax scrolling.

I’m rather new to 2d programming and there seems to be
quite a few ways to light up pixels. Should I blit/clip? Or
should I draw directly to the surface?

Also, is such functionality wrapped by SDL on the iphone?
Because it would appear that the demos such as fireworks
call OpenGLES directly.

Last question, where is the best place to find docs on the
1.3 stuff? It doesn’t appear that the docs feature the
1.3 functions.

Sorry for the barrage of questions. I’m just getting in
to this
stuff and it can be a tad overwhelming :slight_smile:

  Start your day with Yahoo!7 and win a Sony Bravia TV. Enter now

http://au.docs.yahoo.com/homepageset/?p1=other&p2=au&p3=tagline

Actually my main problem with SDL Layer is that it has been downloaded more
than 500 times since the first stable version, but nobody ever sent me a
single email to say if it compiles and works or not (except Phuoc of course,
thank you !)

It’s a little bit hard to follow the work as it progresses, as I had
to diff each release together and guess what the changes were for all
the time. Load it up in Subversion (or some other source control
system of your choice, Subversion just happens to be there on Google
Code) and work there, you might find it annoying at first if you’ve
never worked with a source control system, but you’ll soon find that
you can’t work without it anymore!

http://code.google.com/p/sdl-layer/issues/detail?id=1

The Google Code is yet very convenient to post Issues, and my email is
available on the website … I guess that’s the drawback of free software

It’s even harder to post comments on non-free software! ;-)On Wed, Dec 17, 2008 at 4:11 AM, julien CLEMENT wrote:


http://pphaneuf.livejournal.com/

Well, Pierre,

As a matter of fact, I use control version system and find them quite heavy to use for little projects, especially when there’s 1 developer. So, did you download it and tried it ? On which platform etc.

Thanks
Julien

— En date de?: Mer 17.12.08, Pierre Phaneuf a ?crit?:de: Pierre Phaneuf
Objet: Re: [SDL] animation lib strategy
?: @Julien_Clement1, “A list for developers using the SDL library… (includes SDL-announce)”
Date: Mercredi 17 D?cembre 2008, 16h05

On Wed, Dec 17, 2008 at 4:11 AM, julien CLEMENT <@Julien_Clement1> wrote:

Actually my main problem with SDL Layer is that it has been downloaded
more
than 500 times since the first stable version, but nobody ever sent me a
single email to say if it compiles and works or not (except Phuoc of
course,
thank you !)

It’s a little bit hard to follow the work as it progresses, as I had
to diff each release together and guess what the changes were for all
the time. Load it up in Subversion (or some other source control
system of your choice, Subversion just happens to be there on Google
Code) and work there, you might find it annoying at first if you’ve
never worked with a source control system, but you’ll soon find that
you can’t work without it anymore!

http://code.google.com/p/sdl-layer/issues/detail?id=1

The Google Code is yet very convenient to post Issues, and my email is
available on the website … I guess that’s the drawback of free
software

It’s even harder to post comments on non-free software! :wink:


http://pphaneuf.livejournal.com/

I do agree that having the code in SVN would be helpful.
But in either case, I will be trying to get SDL_Layer working on the iPhone
tonight, and I will definitely give you some feedback :)On Wed, Dec 17, 2008 at 11:01 AM, julien CLEMENT wrote:

Well, Pierre,

As a matter of fact, I use control version system and find them quite heavy
to use for little projects, especially when there’s 1 developer. So, did you
download it and tried it ? On which platform etc.

Thanks
Julien

— En date de : Mer 17.12.08, Pierre Phaneuf a
?crit :

De: Pierre Phaneuf
Objet: Re: [SDL] animation lib strategy
?: clementj2005 at yahoo.fr, “A list for developers using the SDL library.
(includes SDL-announce)”
Date: Mercredi 17 D?cembre 2008, 16h05

On Wed, Dec 17, 2008 at 4:11 AM, julien CLEMENT wrote:

Actually my main problem with SDL
Layer is that it has been downloaded
more
than 500 times since the first stable version, but nobody ever sent me a
single email to say if it compiles and works or not (except Phuoc of
course,
thank you !)

It’s a little bit hard to follow the work as it progresses, as I had
to diff each release together and guess what the changes were for all
the time. Load it up in Subversion (or some other source control
system of your choice, Subversion just happens to be there on Google
Code) and work there, you might find it annoying at first if you’ve
never worked with a source control system, but you’ll soon find that
you can’t work without it anymore!

http://code.google.com/p/sdl-layer/issues/detail?id=1

The Google Code is yet very convenient to post Issues, and my email is
available on the website … I guess that’s the drawback of free
software

It’s even harder to post
comments on non-free software! :wink:


http://pphaneuf.livejournal.com/


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

As a matter of fact, I use control version system and find them quite heavy
to use for little projects, especially when there’s 1 developer. So, did you
download it and tried it ? On which platform etc.

Not so much interested in using it (I was working on dirty rectangles
in my own SDL app, so I wanted to see how you were doing it), but I
did compile it (one of your first version) on Mac OS X. Had to tweak
the Makefile a bit, since I use the SDL framework bundle rather than a
"make install" setup (so I don’t have an sdl-config binary).

I myself tend to keep everything in source control, even my private
projects, using branches for experiments that I’m not sure will pan
out, for example. When I go public with something, then it definitely
goes in a public repository. It’s easier for people to review changes
and figure out what’s is going on…On Wed, Dec 17, 2008 at 11:01 AM, julien CLEMENT wrote:


http://pphaneuf.livejournal.com/

sdl-config is a really simple shell script. When I got my first
iBook G4 way back when, I wrote my own. It was extremely easy and made
the software development process the way I was used to doing things.On Wed, Dec 17, 2008 at 11:27 AM, Pierre Phaneuf wrote:

Not so much interested in using it (I was working on dirty rectangles
in my own SDL app, so I wanted to see how you were doing it), but I
did compile it (one of your first version) on Mac OS X. Had to tweak
the Makefile a bit, since I use the SDL framework bundle rather than a
"make install" setup (so I don’t have an sdl-config binary).


http://codebad.com/