[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] new buffer code from Lenard
- To: pygame-users@xxxxxxxx
- Subject: [pygame] new buffer code from Lenard
- From: René Dudfield <renesd@xxxxxxxxx>
- Date: Wed, 19 Jun 2013 10:04:41 +0200
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Wed, 19 Jun 2013 04:04:48 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=Y3GeGHQd7Vs5KKq+j0zhY1mHOaRhNjSGVmQGHaDyqZA=; b=mSQmMnjHIjbI/Tj7W58PeRcSHFl6WujCzVx1qnt4JOnwWnONRop5D/btzHq7Vb5x7D vZLxN31U4quoHwKtWMXiF/0cBL0+tsWQFncZ6s+m+I32uAlRNfRAA208YrqdEk91EmT6 qsNqqObAgSzw13EIsICbdtV1qPi7YuYAPvNlzRlezW2ZE1Tgqq5AjZ8O34fsEslUBpEX Qx8n9JRlc4FkcX6rnc+EppsZBj0lRKup52l/z0xOYh1C1sDAOx9afot4lvwVX9O7hl/3 1tvCOm1iYgXKAv1tbHpC8iQIX3WAjs8/DCY/Sytd/25rRw5Qjkpcura5NeyxCtzgLSiV CE+w==
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Hellos,
Lenard made some new buffer improvements to pygame. If anyone has time to test it with their apps that would be cool. Just installing it from source, and seeing if your app still works ok. Especially if you use any of the buffer related code directly.
https://bitbucket.org/pygame/pygame/
Here's the notes from WHATSNEW...
Add full Python new buffer protocol support to Pygame 1.9.2. In addition
Python level array interface support is added to several Pygame objects
and function. This changeset marks the end of a series of commits,
starting with revision 98e3a61592c1 on September 8, 2012.
Affected Pygame buffer exporting objects are BufferProxy, Surface
(through method get_buffer), Sound, PixelArray, and Color. Affected
importers are Sound, freetype.Font, BufferProxy, and the
pixelcopy module functions (array_to_surface, surface_to_array, map_array,
and make_surface).
Internally, Pygame has been rewritten to use the C Py_buffer to represent
external array objects. For Python 2.5 and earlier, which do not support
the new buffer protocol, Py_buffer is defined in pygame.h. The details
of translating between Py_buffer and the array interface are now found
in only on C file, base.c. Consequently, the base module exports several new
Pygame C api functions and a new exception: PgBuffer_AsArrayInterface,
PgBuffer_AsArrayStruct, PgObject_GetBuffer, PgBuffer_Release,
PgDict_AsBuffer, and PgExc_BufferError. These api additions also reduce
the amount of conditional compilation code required to support Python
versions which lack the new buffer protocol.
Finally, for proper testing, additions are made to the unit test framework.
A new extension module, pygame.newbuffer, adds new classes for importing
and exporting the new buffer interface at the Python level. It is built
conditionally. The new pygame.tests.test_utils.buftools Python module
implements the high level classes used in the actual unit tests. Also,
a new class in pygame.tests.test_utils.arrinter exports a C level
array interface from the Python level.