[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] Pygame reloaded in SVN



Hi,

being pretty quiet for the last months, I spent my time on rewriting
pygame, called pgreloaded. Now an early version found its way into the
SVN tree (branches/pgreloaded).

Dependencies
------------
* Python 2.4, 2.5, 2.6 supported
* Python 3.0 partly supported (currently incomplete and not fully usable)
* [Optional] SDL >= 1.2.10
* [Optional] SDL_mixer >= 1.2.8
* [Optional] SDL_ttf >= 2.0.9
* [Optional] SDL_image >= 1.2.7
* [Optional] SDL_gfx >= 2.0.17
* [Optional] libpng >= 1.2.24
* [Optional] libjpeg >= 6b

Modules
-------
pgreloaded ("pygame2") uses a completely new module layout, which ties
it closer to the 3rd party libraries it uses. The new module layout
should make it easier for developers already having experience with those
libraries to gain ground with pygame and python quickly. Novice users
can rely on both, pygame's or the 3rd party library documentation in
most cases to learn the API.

For more details about the module hierachy, take a look at the attached
document.

But it's more interesting to hear about what's completely new and changed.

Features
--------
* New FRect class for high precision rectangle handling using floating point
  values.
  FRect and Rect share the same properties and functions and can be converted
  into the other rectangle type without any problems.
* New PixelFormat class that wraps up SDL_PixelFormat.
* New CDTrack class that keeps information about CD tracks.
* New physics module integrated. Zhang Fan's GSoC work on an easy to use
  physics simulation is now available.
* New sdlgfx module, which wraps up the SDL_gfx library and adds features
  such as fast zoom and drawing primitives or FPS management.
* Improved C API.
* Improved SDL sound and channel handling. Though not perfect, they are more
  robust now.
* Completely rewritten build system, allowing a fine grained build
  configuration for nearly any purpose.
* Completely rewritten documentation system.
* Installation is compatible towards pygame - it goes into a new
  namespace and module hierarchy, so having pygame and pygame2 installed
  won't hurt your pygame 1.x applications.

Besides those great things about which we all can get excited, there are
some downsides to it - otherwise it would not be pygame.

Changes
-------
* Module, class and package layout changed.
* Completely different API in nearly all places for both, Python and C.
* No ABI or API compatibility towards pygame 1.x (and it is not planned!)
* Feature compatibility towards pygame 1.x only in limited areas.
* Overhauled test system.

Downsides
---------
* Early development stage. Expect weird things to happen when you use it.
* Not many examples and tests yet.
* API likely to change before an official release is made.
* MacOS support not available yet.
* physics module not working yet.
* Many other issues to be revealed.

Before you go ahead, test it out, run into bugs and want to post them to
the mailing list, please take a look at TODO.txt, whether that problem is
already mentioned there.

Regards
Marcus
Pygame2 package layout
----------------------

pgreloaded features the following layout (modules containing constants only are
not listed here).

pygame2.base
  The base module relying solely on Python and features the most basic data
  types and helper functions.

  The following classes exist under pygame2.base:
  BufferProxy - Proxying class for buffer access within object types.
  Color       - RGBA color management class.
  FRect       - High precision rectangle management class using floating point
                values.
  Rect        - Rectangle management class using integers.
  error       - Error class for pygame specific exceptions.

pygame2.font
  The font module is suitable for system-specific font detection.

pygame2.mask
  The mask module is suitable for fast pixel mask access and pixel-perfect area
  overlap handling. It can be used as standalone module or (if supported) in
  combination with the pygame2.sdl.video.Surface.

  The following classes exist under pygame2.mask:
  Mask - Simple bitmasking class.
  
pygame2.physics
  The Google Summer of Code work from Zhang Fan brought to you with pygame2.
  The physics module provides a simple and easy to use physics simulation
  framework including rigid body physics, shape collision systems and joints.
  To learn more about it, it's recommended to check out the physics branch 
  on pygame's SVN tree.
  
pygame2.sdl
  A thin SDL wrapper, that brings most of SDL's features to Python.
  pygame2.sdl is splitted into several submodules to allow fine grained access
  to the necessary parts of SDL only:
  
  pygame2.sdl.audio
    SDL audio wrapper, not fully supported (yet)- use pygame2.sdlmixer instead.
  
  pygame2.sdl.cdrom
    SDL cdrom wrapper, featuring access to CD drives, audio and playback
    handling of CD music as well as information about CD tracks.
    
    The following classes exist under pygame2.sdl.cdrom:
    CD      - CD drive manangement class.
    CDTrack - Storage class for CD track information.
  
  pygame2.sdl.event
    SDL event system wrapper, including event distribution and manipulation.
    This ranges from low-level system events such as keyboard and mouse input
    to user-defined events.
    
    The following classes exist under pygame2.sdl.event:
    Event - Event class containing certain system- or user-defined data.
    
  pygame2.sdl.gl
    SDL OpenGL extension wrapper. It features some OpenGL related methods,
    which are necessary to let SDL (resp. PyGame) bridge clearly to OpenGL.

  pygame2.sdl.image
    SDL image loading wrapper. It only offers the most basic image functions.
    Enhanced image support is available through pygame2.sdlimage.
  
  pygame2.sdl.joystick
    SDL joystick system wrapper. This allows you to access connected joysticks.
  
    The following classes exist under pygame2.sdl.joystick:
    Joystick - A class for dealing with joysticks.

  pygame2.sdl.keyboard
    SDL keyboard system wrapper. This allows you to access the connected
    keyboard and receive various information about its state.
  
  pygame2.sdl.mouse
    SDL mouse system wrapper. Setup own cursors and let the mouse move.
  
    The following classes exist under pygame2.sdl.mouse:
    Cursor - Container class for mouse cursor representations.
    
  pygame2.sdl.rwops
    SDL RWops wrapper. Useless for most pure python applications, but a mighty
    friend for C extensions.
  
  pygame2.sdl.time
    SDL timer system wrapper. It allows you to program periodic timers and
    suspend the application thread(s).
  
  pygame2.sdl.video
    SDL video system wrapper, which gives you basic access to all the nifty 2D
    graphics things, including SDL surfaces, overlays, querying formats and
    creating application windows.
  
    The following classes exist under pygame2.sdl.video:
    PixelFormat - Storage class for surface format information.
    Surface     - 2D pixel-based graphics surface.
    Overlay     - YUV overlay class for display surfaces.

  pygame2.sdl.wm
    SDL window manager wrapper, containing some helper functions to let
    window managers and desktop environments know about your SDL featured
    application.
  
pygame2.sdlext
  The SDL extensions package contains stuff that needs SDL, but does not come
  with it. It includes surface and pixel arrays, fast surface transformation
  routines and more and is splitted into several submodules.

  The following classes exist under pygame2.sdlext:
  PixelArray - A class for fast 2D access and manipulation of
               pygame2.sdl.video.Surface objects.
  
  pygame2.sdlext.draw
    Basic 2D drawing operations for pygame2.sdl.video.Surface objects.
  
  pygame2.sdlext.fastevent
    A threaded and fast alternative to the pygame2.sdl.event module.
  
  pygame2.sdlext.scrap
    Clipboard support for pygame2/SDL-based applications.
  
  pygame2.sdlext.surfarray
  pygame2.sdlext.numpysurfarray
  pygame2.sdlext.numericsurfarray
    Those modules provide 2D and 3D pixel access for pygame2.sdl.video.Surface
    objects using Numpy and Numeric.
    pygame2.sdlext.numericsurfarray won't be available for Python 3.0
  
  pygame2.sdlext.transform
    Fast and mighty pygame2.sdl.video.Surface manipulation functions.

pygame2.sdlgfx
  Earlier versions of pygame borrowed code from the SDL_gfx package in some
  places. But why borrowing, if we can have it all? This package wraps up some
  parts of the SDL_gfx package such as zoom operations and fast drawing
  primitives.
  
  The following classes exist under pygame2.sdlgfx:
  FPSmanager - An FPS management class with high resolution timers.

  pygame2.sdlgfx.primitives
    2D drawing primitives for pygame2.sdl.video.Surface objects.
  pygame2.sdlgfx.rotozoom
    2D zoom and rotation functions for pygame2.sdl.video.Surface objects.

pygame2.sdlimage
  A thin wrapper around SDL_image, making it suitable for Python applications.
  SDL_image provides enhanced loading facilities for the most popular image
  formats.

pygame2.sdlmixer
  A thin wrapper around SDL_mixer, which makes sound mixing and music playback
  very easy. pygame2.sdlmixer is splitted into several submodules.
  
  The following classes exist under pygame2.sdlmixer:
  Chunk   - Simple sound data class.
  Channel - A class for playing and mixing sound data.
  Music   - Music playback class. 
  Sound   - Alias for pygame2.sdlmixer.Chunk.
  
  pygame2.sdlmixer.channel
    General sound channel management support.
  pygame2.sdlmixer.music
    General music playback support.
  pygame2.sdlmixer.sndarray
  pygame2.sdlmixer.numpysndarray
  pygame2.sdlmixer.numericsndarray
    Those modules provide 2D access to sound data, making it easy to manipulate
    sounds.
    pygame2.sdlmixer.numericsndarray won't be available for Python 3.0

pygame2.sdlttf
  A thin wrapper around SDL_ttf, which enables TrueType and OpenType font
  handling and rendering on SDL surfaces.
  
  The following classes exist under pygame2.sdlttf:
  Font - Simple text rendering class for pygame2.sdl.video.Surfaces.
  
pygame2.sprite
  Sprite and group systems, suitable for games.

pygame2.threads
  Enhanced threading functions including thread pools.

Attachment: pgpPNth4p3QxX.pgp
Description: PGP signature