October 2018
Intermediate to advanced
464 pages
15h 17m
English
The obvious difference between this example and the previous recipe lies in how we derive the angle to pass to the Matrix.setRotateM() call. We also changed the GLSurfaceView render mode using setRenderMode() to only draw on request. We made the request using requestRender() after calculating a new angle in the onTouchEvent() callback.
We also demonstrated the importance of deriving our own GLSurfaceView class. Without our CustomGLSurfaceView class, we would not have a way to override the onTouchEvent callback or any other callbacks from GLSurfaceView.