Closed littleguy77 closed 9 years ago
You could change the pixel array to 2048 * 2048 * 2 instead of *4, since you are reading bytes, and each pixel is 4 bytes, or 2 shorts.
That's definitely the best solution ;-) Just for information glReadPixels is storing in contiguous memory when using GL_RGBA that's why we can do that.
Thanks for the quick feedback. I'll make the recommended changes, add some documentation in the comments, and reopen the pull request when it's ready.
Thanks for the suggestions. Made the fixes and reopened the PR.
I would recommend removing the logging change, since it causes a performance issue.
The change actually improves performance, but I can remove it if you wish.
Ok, I removed the last commit.
@richard42 Just occurred to me I might have misread your last comment. Which commit did you want me to remove?
@Gillou68310 Please let me know if I have misattributed anything or my explanations are not clear. Thanks :)