Re: pyopengl and pypy, one step further
rndblnch <[email protected]> Thu, 2 Dec 2010 14:20:37 +0000 (UTC)
| Newsgroups | gmane.comp.python.opengl.devel |
|---|---|
| Message-ID | <[email protected]> |
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
------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
PyOpenGL Homepage
http://pyopengl.sourceforge.net
_______________________________________________
PyOpenGL-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyopengl-devel