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

Re: [pygame] Adding functions to library



On Wed, Nov 16, 2011 at 9:19 PM, Christopher Arndt <chris@xxxxxxxxxxxxx> wrote:
On 16.11.2011 17:39, Luke Paireepinart wrote:
Quick question, are there any cython extensions in pygame currently?
or ctypes?  or is it purely C?  If so, what wrapper is used?

The pyportmidi binding for portmidi, which is wrapped by pygame.midi is written in Cython. The source file is here:

https://bitbucket.org/pygame/pygame/src/dd6752f761be/src/pypm.pyx

Chris



Hi,

yeah, as Chris says, there is one cython module.  Most modules are written using C.  The plan was to eventually move that code out into separate libraries... but I don't know if that will happen.  But keeping the C code separate might be 'cleaner'.

If you're going to spend time optimizing C code and maybe assembly, consider using liborc.  Since then you can generate assembly automatically, and C code.  It's kind of nice looking for array based code: http://code.entropywave.com/documentation/orc/orc-tutorial.html

But yeah, I don't see a problem with new cython modules if you prefer to do it that way.

I can offer help if you run into any problems which ever way you do it.


cheers,