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

前端 未结 2 953
耶瑟儿~
耶瑟儿~ 2021-02-15 06:38

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:03

    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.

提交回复
热议问题