Re: [PyOpenGL-Devel] glReadPixels with null pointer
Brought to you by:
mcfletch
From: Mike C. F. <mcf...@vr...> - 2013-09-04 21:05:15
|
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). With the modified code *any* integer/long passed in will be converted to a ctypes.c_void_p( value ). I believe that should be fine for all normal use cases of the function. HTH, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |