How to get a SurfaceHolder with a valid Surface (needed by EGL.eglCreateWindowSurface)?

前端 未结 2 1238
悲&欢浪女
悲&欢浪女 2021-02-15 06:37

I try to initialize GLES with EGL (because I want to draw from the main thread instead of using a Renderer and drawing from inside onDrawFrame). I get the error: \"Make sure the

2条回答
  •  长发绾君心
    2021-02-15 07:12

    The check valid for surface should be did when surface is created. So, surface.isValid() should be called in onSurfaceCreated or onSurfaceChanged, obviously, you should add surfaceholder.callback.

提交回复
热议问题