First, let's encapsulate OpenGL ES initialization code in a dedicated C++ class:
jnifolder. It needs to include
EGL/egl.hwhich defines EGL API to bind OpenGL ES to the Android platform. This header declares among others
EGLContexttypes which are handles to system resources.
GrapicsService lifecycle is composed of three main steps:
start(): This binds an OpenGL rendering context to the Android native window and loads graphic resources (textures and meshes later in this chapter).
stop(): This unbinds rendering context from Android window and frees allocated graphic resources.
update(): This performs rendering operations during each refresh ...