Capture screen of GLSurfaceView to bitmap

SurfaceView and GLSurfaceView punch holes in their windows to allow their surfaces to be displayed. In other words, they have transparent areas. So you cannot capture an image by calling GLSurfaceView.getDrawingCache(). If you want to get an image from GLSurfaceView, you should invoke gl.glReadPixels() in GLSurfaceView.onDrawFrame(). I patched createBitmapFromGLSurface method and call it in onDrawFrame(). … Read more

GLSurfaceView inside fragment not rendering when restarted

Here’s how I have my GLSurfaceView setup in a fragment: onCreateView() { glSurfaceView = new GLSurfaceView(getActivity()); … } onPause() { if (glSurfaceView != null) { glSurfaceView.onPause(); } … } onResume() { if (glSurfaceView != null) { glSurfaceView.onResume(); } … } } So, similar to what you’d do in an activity. This works in my use … Read more

error code: 521