ly.img.android.opengl.egl / Renderer / onSurfaceCreated

onSurfaceCreated

abstract fun onSurfaceCreated(config: EGLConfig!): Unit

Called when the surface is created or recreated.

Called when the rendering thread starts and whenever the EGL context is lost. The EGL context will typically be lost when the Android device awakes after going to sleep.

Since this method is called at the beginning of rendering, as well as every time the EGL context is lost, this method is a convenient place to put code to create resources that need to be created when the rendering starts, and that need to be recreated when the EGL context is lost. Textures are an example of a resource that you might want to create here.

Note that when the EGL context is lost, all OpenGL resources associated with that context will be automatically deleted. You do not need to call the corresponding "glDelete" methods such as glDeleteTextures to manually delete these lost resources.

Parameters

config - EGLConfig!: the EGLConfig of the created surface. Can be used to create matching pbuffers.