The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Animated GIFs
Philipp Lorenz
Guest

Hello,

I was creating an animated GIF-file and included it into my program. But now
the GIF isn't animated.

I have the pictures seperate!

Who can help me?

Greets, P. Lorenz
Animated GIFs
Torsten Giebl
Guest

Hello !


Quote:
I was creating an animated GIF-file and included it into my program. But
now
the GIF isn't animated.

I have the pictures seperate!

Who can help me?


As Anim. GIFs need to be updated reguarly,
your are on your own with them.

I would split the Anim GIF into single BMPs
or PNGs for example, then load them into an array
and blit the bitmaps when necessary. The easiest is
to do this in your main loop.


CU
Animated GIFs
Philipp Lorenz
Guest

Yes, I had the same idea yesterday, but i am new with SDL! The compiler gave
me:

d3launch.cpp:33: error: cannot convert ?int? to ?SDL_Surface [9]? in
initialization
d3launch.cpp: In function ?bool load_files()?:
d3launch.cpp:217: error: expected primary-expression before ?]? token
d3launch.cpp:134: error: too many arguments to function ?SDL_Surface*
load_image(std::string)?
d3launch.cpp:217: error: at this point in file
d3launch.cpp: In function ?int main(int, char**)?:
d3launch.cpp:445: error: expected primary-expression before ?]? token

If you need the code, go to this link:
http://intelcentino.in.funpic.de/upload/d3launch.cpp

Thanks,

P. Lorenz



Quote:
Hello !

Quote:
I was creating an animated GIF-file and included it into my program. But
now
the GIF isn't animated.

I have the pictures seperate!

Who can help me?

As Anim. GIFs need to be updated reguarly,
your are on your own with them.

I would split the Anim GIF into single BMPs
or PNGs for example, then load them into an array
and blit the bitmaps when necessary. The easiest is
to do this in your main loop.


CU

_______________________________________________
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Animated GIFs
Doug
Guest

In article <200704042006.37454.descent1 at gmx.net>, descent1 at gmx.net says...
Quote:
I was creating an animated GIF-file and included it into my program. But now
the GIF isn't animated.
I have the pictures seperate!
Who can help me?

I worked on this and I made a small animated gif library, very similar to
SDL's image library.

The project is not yet complete (lacks documentation and multiple OS support
- only supports Win32 now), but all the source code is there for your
animated gif enjoyment.

You can download it at: http://bitbasher.net/SDL/SDL_anigif.zip

I support compile options for VC6 and VS2005 under Win32. The code is pretty
simple and *should* compile easy on other platforms/OS. The sample
application is Win32-only as it actually uses Win32 calls.

During development, I noticed that "not all animated gif files are created
equal". That is, there are many strange and exotic ways to make an animated
gif. I downloaded hundreds of them, and so far, all of them will work with
this code - so far Razz. It's important to determine (in your app) if you want
the animated gif to be overlayed (on top of existing image data) or full
frame (the size of the animated gif IS the surface size). You can optimize
the display of the animated somewhat based on how you use them.

Doug.