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

Re: [pygame] Screenshots, music and flipping



> Please make the screenshots on the pygame homepage links to the original
> sites for the games, or provide some means of rwaching them. I looked at
> the site today and wanted to check out "Twitch", but found no link. So,
> no, this was not just because I want to be able to easily get people to
> visit the Civil www-site... :-) Nice update of the pygame site, btw.

for civil i can do this. unfortunately for twitch there is no
homepage or release information. i just forced a sneak preview
out of david, heh


> Dug into the docs a little bit (more about that later), and found the nice
> display.flip() method. Is there any real performance differences when
> using flip() instead of plain display.update() (full screen update)?

when using single buffered surfaces, flip is the exact same as
a normal fullscreen update. when you have a doublebuffered display
mode, flip will to the hardware accelerated page flip. if your game
is redrawing the full screen every frame (not using individual update
rects) you are best off using the flip() function. that way the game
runs in either buffered mode with the same code.

if you're only updating parts of the screen with Update() rectangles
you won't want a doublebuffered screen, so you just use Update() and
don't need to worry about Flip()



> So, has anybody done some mp3-playing with pygame, and what could the
> pitfalls be? Is it worth a shot?

heh, i've played a couple, but nothing on the scale you're thinking.
it should be entirely possible, the only thing i see missing from
pygame's music playback is there's no way to get information like
current time, etc. if you want to display something like a playtime,
you'll need to carefully keep track of how long the song has been
playing by yourself. (stop the time playback when paused, etc).
it doesn't sound like a big deal so you should be fine.
you can check to see if the music is finished by either polling the
music module with pygame.music.get_busy(), or you can have an event
appear on the event queue when the music has finished,
pygame.music.set_end_event(USEREVENT)
...
if event.type == USEREVENT: startnextsong()

it should work quite well. i know there's an ID3 module or two
out there for python, so it needed you could display extra info
about the playing song.

sounds like an interesting little project, make sure it can run
windowed too (not just fullscreen), so we can all try running it
on our own machines, :]


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