且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从iOS(OopenGL-ES)中的屏幕外OpenGL像素缓冲区读取像素

更新时间:2023-11-13 10:16:10

解决了。 iOS上的glReadPixels不支持RGBA到BGRA转换。
更改

Solved. RGBA to BGRA conversion is not supported by glReadPixels on iOS. Changing

glReadPixels(0, 0, _videoDimensions.width, _videoDimensions.height, GL_BGRA_EXT, GL_UNSIGNED_BYTE, CVPixelBufferGetBaseAddress(outPixelBuffer)); 

glReadPixels(0, 0, _videoDimensions.width, _videoDimensions.height, GL_RGBA, GL_UNSIGNED_BYTE, CVPixelBufferGetBaseAddress(outPixelBuffer));

解决问题。 glGetError是我的新朋友;)

Solves the problem. glGetError is my new friend ;)