Search code examples
androidglsurfaceview

How to reset Glsurfaceview's render object


Can I reset the GLSurfaceView.Renderer object for GLSurfaceView ?


Solution

  • You can't. The API doesn't work that way.

    Instead, use a single method with an if/then or switch statement that causes it to change behavior.

    If you don't like that approach, use a plain SurfaceView and provide your own EGL setup and threading classes. Then you can render however you like, and can even take advantage of things like Choreographer to reduce latency. See Grafika for examples.