Taking screenshot of Android OpenGL

前端 未结 3 1885
既然无缘
既然无缘 2020-12-13 04:55

I\'m trying to take a screenshot of Android OpenGL.

The code I found is as follows:

nt size = width * height;
    ByteBuffer buf = ByteBuffer.allocat         


        
3条回答
  •  一个人的身影
    2020-12-13 05:44

    Got it!

    My mistake was that I was remembering GL context in the class variable. In order to take a screenshot I have to use the gl context passed to the OnDraw in the class implementing GLSurfaceView.Renderer interface. I simply use my code in the "if" clause and everything works as expected. Hope that remark would help anyone.

    Best regards, Gordon

提交回复
热议问题