Re: glReadPixels with null pointer
"Mike C. Fletcher" <[email protected]> Wed, 04 Sep 2013 16:46:14 -0400
| Newsgroups | gmane.comp.python.opengl.devel |
|---|---|
| Message-ID | <[email protected]> |
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 ------------------------------------------------------------------------------ Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk _______________________________________________ PyOpenGL Homepage http://pyopengl.sourceforge.net