glReadPixels with null pointer
Tim Sheerman-Chase <[email protected]> Thu, 05 Sep 2013 01:05:49 +0100
| Newsgroups | gmane.comp.python.opengl.devel |
|---|---|
| Message-ID | <[email protected]> |
On 04/09/13 22:05, [email protected] 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 ------------------------------------------------------------------------------ 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