Creating a bitmap of a drawn square in android opengl es 2.0
I have drawn a square using opengl es 2.0 and now i want to create a bitmap of that drawn square. Can anyone please guide me on how to do that? Please let me know if my question is not clear. Thanks It is done using glReadPixels(). This is slow, but is the only method available with OpenGL ES 2.0 on Android. In Java: Bitmap buttonBitmap = Bitmap.createBitmap(mWidth, mHeight, Bitmap.Config.ARGB_8888); ByteBuffer byteBuffer = ByteBuffer.allocateDirect(mWidth * mHeight * 4); GLES20.glReadPixels(0, 0, mWidth, mHeight, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, byteBuffer); buttonBitmap