0

I am trying to overlay a SurfaceView with a GLSurfaceView using OpenGL ES 2.0, so I need to set a transparent background in the GLSurfaceView.

After looking for solutions on the internet, I have found that this code normally do the job...

In the SurfaceView:

mGlSurfaceView.setZOrderOnTop(true);
mGlSurfaceView.getHolder().setFormat(PixelFormat.RGBA_8888);
mGlSurfaceView.setRenderer(mRenderer);
mGlSurfaceView.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
mGlSurfaceView.requestRender();

And in the renderer:

GLES20.glClearColor(0.0f, 0.0f, 0.0f, 0.0f)

The glSurfaceView overlay the other views, but it is still opaque. I have tried anything I variant of these calls plus some others that have solved the problem for other people, but it doesn't work for me.

Thank you

Nick Skywalker
  • 1,027
  • 2
  • 10
  • 26

1 Answers1

0

IIRC you need to configure the activity as transparent. See:

How do I create a transparent Activity on Android?

Community
  • 1
  • 1
solidpixel
  • 10,688
  • 1
  • 20
  • 33