hi, Amaury Forgeot d'Arc <amauryfa <at> gmail.com> writes: > But IMO the call to pythonapi.PyString_AsString could be removed in > OpenGL/arrays/strings.py: > > def dataPointer(value): > return ctypes.cast(ctypes.c_char_p(value), ctypes.c_void_p).value
great, this replacement (and also the one suggested by Armin with create_string_buffer instead of c_char_p) seams to works (i.e., runs fine on cpython). > I don't know about the other function, though. this one is only in experimental code of pyopengl, so i won't bother much for now. the next issue is now that the array data types used by pyopengl are not compatible with pypy ctypes: they are lacking (at least) _CData_input as shown in the stack trace below. any advice on that one? should i try to fix PyOpenGL ArrayDatatype, or try to patch pypy's ctypes function.py to work around that one? thanks again, renaud % pypy 01-direct.py Traceback (most recent call last): File "app_main.py", line 33, in run_toplevel File "01-direct.py", line 268, in <module> sys.exit(main()) File "01-direct.py", line 262, in main init_texture() File "01-direct.py", line 48, in init_texture "".join(pixel(i, j, k) for i in range(width) File "/Users/Shared/src/pypy-1.4-osx/site-packages/OpenGL/latebind.py", line 45, in __call__ return self._finalCall( *args, **named ) File "/Users/Shared/src/pypy-1.4-osx/site-packages/OpenGL/wrapper.py", line 784, in wrapperCall result = self.wrappedOperation( *cArguments ) File "/Users/Shared/src/pypy-1.4-osx/site-packages/OpenGL/platform/baseplatform.py", line 335, in __call__ return self( *args, **named ) File "/Users/Shared/src/pypy-1.4-osx/lib_pypy/_ctypes/function.py", line 166, in __call__ argtypes, argsandobjs = self._wrap_args(argtypes, args) File "/Users/Shared/src/pypy-1.4-osx/lib_pypy/_ctypes/function.py", line 281, in _wrap_args wrapped = argtype._CData_input(arg) AttributeError: type object 'ArrayDatatype' has no attribute '_CData_input' _______________________________________________ pypy-dev@codespeak.net http://codespeak.net/mailman/listinfo/pypy-dev