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

前端 未结 2 945
耶瑟儿~
耶瑟儿~ 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 06:58

    Implement SurfaceHolder.Callback, and wait until you're told that the surface has been created. Also pay attention to when it is destroyed. You should only rely on the surface being valid between matching create and destroy calls.

提交回复
热议问题