[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[pygame] Big changes for pygame.image



hey guys, here's a heads up on what i just checked into cvs.

the image module has been completely redone. the main task of
the image library now is (will be) handling all Surface IO and
communication. the other big change is that the image module is
now always available, no longer optionally there.

SDL_image is still an optional dependency though. what happens,
if pygame is compiled without SDL_image, the image module will
only be able to load "bmp" images. 

there is a new function "get_extended()" which will return true
if the full set of SDL_image formats are available.

the Surface.save() function has also moved into the image module,
and it has been enhanced to support OPENGL surfaces. the old
Surface.save() will still work (for now at least), but it prints
a warning the first time it is used. expect the Surface.save()
to be removed completely around the time pygame-1.1 is released.

the way that it is setup now, it will be pretty easy to add
support for exchanging images with other python projects like
PIL and pyopengl textures. i'm planning to add these sometime
this week.

anyways, for the most part, this won't really change your code.
you just import your pygame.image and load your images the same
as before. the immediate change is that you can load BMP images
without SDL_image on your system. of course, if you are using
Surface.save() in your code, you should switch that to image.save()
at somepoint soon.

the good news is that now more of the pygame demos can run without
SDL_image support. the full list of pygame examples that can run
with NO optional dependencies is now liquid, stars, and zipshow.
previously it was just stars. also, arraydemo and chimp can now run
without SDL_image (but need other dependencies)

the chimp tutorial and documentation have also been updated to
reflect the pygame.image module changes.

note that there have been other changes to pygame within this last
week or so, although this one is the first one big to warrant a 
little extra information here on the list. you can always follow
along the pygame development here, http://pygame.seul.org/WhatsNew
one of the notable changes is that posting USEREVENTs to the
event queue will pass all the userevent member data through the queue.

oh, one other thing. this adds an extension module into the source,
so you will need to rebuild your "Setup" files if you update your
cvs code. (just rerun the "config.py" script and you'll be set)


____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org