[PyOpenGL-Devel] glReadPixels with null pointer
Brought to you by:
mcfletch
From: Tim Sheerman-C. <ord...@sh...> - 2013-09-05 00:05:55
|
On 04/09/13 22:05, pyo...@li... wrote: > On 13-09-02 01:59 PM, Tim Sheerman-Chase wrote: >> >Hi all, >> > >> >I had problems when using glReadPixels when the data buffer pointer >> >passed to the function is zero: >> > >> >glReadPixels(0, 0, capSize[0], capSize[1], GL_BGRA, GL_UNSIGNED_BYTE, 0) > Hi Tim, > > I've merged your patch into bzr head, though with some modifications, as > "if array != 0:" will trigger "cannot determine the scalar value of an > array" errors when array is a numpy array (it creates a boolean array of > size of array then attempts to determine whether array is True/False and > blows up). > That seems sensible to me. However, I am still having problems with the current trunk version #623 when using glReadPixels in the previously described situation. I did a quick hack to try to fix it but I am unsure if this does not break something else. https://code.launchpad.net/~thetourist/pyopengl/tim2 My code breaks if the ctypes pointer created by ctypes.c_void_p is passed through arrayType.voidDataPointer. I have skipped this step. I am a little unclear as to what what would be returned in each of the cases and it might be worth checking. Thanks, Tim |