(kind of a long-ish announce, but it’s the first one)
I’ve been working on a python sdl binding for the past several
months. With the help of a handful of dedicated users it has
reached its first pretty solid release.
(solid enough for the unwashed masses)
The python wrapper is designed to be pretty thin around SDL,
but it does take liberties with some of the interfaces to make
it work cleaner in the python environment. Any current SDL
users should feel pretty comfortable with this binding.
(although being comfortable with python would help) :]
Anyways, there is a wealth of more information at the pygame
website. http://pygame.seul.org
Be aware that pygame requires python 2.0 and at least SDL-1.1.5
Currently pygame wraps the following libraries.
- SDL
- SDL_image
- SDL_ttf
- SDL_mixer
To help avoid any confusion. There is a previous python
binding for sdl named pySDL. This project has unfortunately
stalled out sometime in July. While pygame doesn’t attempt
to fully replace pySDL, it may be the case if pySDL is never
picked up.
Just to give you special SDL folks a spicy-tasty. here is
the unofficial pygame entry for the unofficial #SDL bouncing
ball contest…
#!/usr/bin/env python
import pygame, pygame.image
pygame.init()
screen = pygame.display.set_mode((640, 480))
ball = pygame.image.load(‘bounceme.bmp’).convert()
for tick in xrange(1000000):
if pygame.event.poll().type is pygame.QUIT: break
pos = abs(tick%1024-512), abs((tick+200)%704-352)
pygame.display.update(screen.blit(ball, pos))
… there are many more examples along with full reference
and tutorials available. that website again.
pygame
http://pygame.seul.org