Re: [PyOpenGL-Devel] pyopengl and pypy, one step further
Brought to you by:
mcfletch
|
From: rndblnch <rnd...@gm...> - 2010-12-02 14:21:05
|
i'm back again with some news: shaders are now working, it required a minor fix
of the StringLengths CConverter (in OpenGL/converters.py). the stringArrayForC
method requires an explicit cast to make pypy ctypes version happy:
def stringArrayForC( self, strings ):
"""Create a ctypes pointer to char-pointer set"""
from OpenGL import arrays
result = (ctypes.c_char_p * len(strings))()
for i,s in enumerate(strings):
- result[i] = arrays.GLcharARBArray.dataPointer(s)
+ result[i] = ctypes.cast(arrays.GLcharARBArray.dataPointer(s),
ctypes.c_char_p)
return result
now, the following programs run fine:
- 05-shader.py (partial shader-based implementation of the fixed pipeline)
- 06-perpixel.py (per-pixel lightening)
- 07-attrib.py (generic vertex attributes rather than pointers)
- 08-pbo.py (using pixel buffer object to read back pixels from framebuffer)
the last one does opengl à la opengles (without any fixed functionality) but
does not work yet.
this time, i think that it's pypy's fault :)
stay tuned,
renaud
|