PDA

View Full Version : glReadPixels halts my app



nighthawk07
03-08-2011, 01:16 AM
I have written an application to capture opengl es screen.
And been using the glReadPixels command.

Seems that that command halts my application while reaching the _memcpy of the pixels to my buffer. (this asm command is being used internally in the glReadPixels command process).
I've been using fpc in order to code the application, and been allocation buffer space using the SetLength(MyArray, dataLength);

It seems that anything I try to run the glReadPixels command fails, both in the emulation of ios and on the device itself.
I do not know what the exact problem is and been trying to override the halting of the application by using glReadPixels with a small amount of data, comparing to the allocate array. or increasing the allocated space in the buffer so it would have to fit the array dimensions.

Please let me know what buffer to send to the glReadPixels.

JoshKlint
03-16-2011, 09:53 AM
See glPixelStorei(GL_UNPACK_ROW_LENGTH) and glPixelStorei(GL_PACK_ROW_LENGTH).

For safety, I call both anytime pixel data is sent to or retrieved from the GPU. I had some horrid random bugs that would sometimes crash and sometimes not before I figured that out.