[pypy-dev] (no subject)
fijall at gmail.com
Wed Dec 1 14:52:39 CET 2010
I would suggest using array module. It allocates memory in a
non-moving location and it's address can be found using buffer_info
On Wed, Dec 1, 2010 at 3:18 PM, renaud blanch <rndblnch at gmail.com> wrote:
> i'm trying to make some pyopengl  -based code  run on top of pypy.
> this is partially successful, but i need some advice to progress further.
> pyopengl 3.x makes use of ctypes to provide the opengl binding, and it
> works out of the box for simple functions (those that do not takes
> c-pointer to buffers of data as arguments).
> for the rest, the first issue is that pyopengl use two functions from
> the ctypes.pythonapi lib, namely PyString_AsString and
> any advice on how to replace those functions to make them compatible with pypy?
> Mike Fletcher (pyopengl author) gave me some hints about that point:
>> For the first issue, those are going to require some reworking, in
>> essence those are "C" implemented code that happens to use Python/ctypes
>> as the implementation language and makes assumptions about the
>> data-storage for the objects (e.g. that a string is internally a
>> contiguous series of bytes, which is *not necessarily* true in PyPy).
>> We'd need to find a mechanism in PyPy that would give us that direct
>> memory-pointer access to be able to use it. Note: a compacting garbage
>> collector (or anything else that can move memory locations) will cause
>> problems there, so we may need to find a way to signal PyPy not to move
>> a given object, and to use contiguous data-arrays for their storage.
> thanks a lot for any advice,
> 0. PyOpenGL 3.x / The Python OpenGL® Binding
> 1. opengl-programmable / a short step by step tutorial to OpenGL
> programmable pipeline
> pypy-dev at codespeak.net
More information about the Pypy-dev