Reputation: 908
Im Making an android Game with OpenGl ES, I Want to capture what is rendered onto screen By FloatBuffer and save it for later use, For Example If this is the OutPut:
I want this for Result (as PNG Image) :
How can I do this?
Upvotes: 0
Views: 276
Reputation: 12129
What is on screen won't be a floating point buffer - it's typically RGBA8 unorm 32-bit per pixel.
Capture via glReadPixels to fetch the raw RGBA data - you'll have to supply the raw to PNG save functionality, that's not part of OpenGL ES itself.
Note that this is a relatively expensive operation, especially at high screen resolutions, so don't expect to do this at interactive frame rates.
Upvotes: 2