Renderer
A generic renderer interface.
The renderer is responsible for making OpenGL calls to render a frame.
GLSurfaceView clients typically create their own classes that implement this interface, and then call to register the renderer with the GLSurfaceView.
Threading The renderer will be called on a separate thread, so that rendering performance is decoupled from the UI thread. Clients typically need to communicate with the renderer from the UI thread, because that's where input events are received. Clients can communicate using any of the standard Java techniques for cross-thread communication, or they can use the { GLSurfaceView#queueEvent(Runnable) } convenience method. EGL Context Lost There are situations where the EGL rendering context will be lost. This typically happens when device wakes up after going to sleep. When the EGL context is lost, all OpenGL resources (such as textures) that are associated with that context will be automatically deleted. In order to keep rendering correctly, a renderer must recreate any lost resources that it still needs. The onSurfaceCreated method is a convenient place to do this.interface Renderer
Content copied to clipboard
Functions
onDrawFrame
Link copied to clipboard
abstract fun onDrawFrame()
Content copied to clipboard
onSurfaceChanged
Link copied to clipboard
onSurfaceCreated
Link copied to clipboard
abstract fun onSurfaceCreated(config: EGLConfig)
Content copied to clipboard