I am creating a small platformer-like game for Android using OpenGL. The game has 3 main screens/states:
- Main menu screen
- Level selection screen
- The game screen
Currently I use a GLSurfaceView.Renderer to render all three screens and just run different parts of the render code depending on which screen I am on. Now my code is getting really messy because the render(), update() and onTouchEvent() methods of the renderer all have code for all three states in big if statements.
My question is now: Is it possible to have multiple GLSurfaceView.Renderer's (one for each screen/game state) and how can I implement the switching between them?