Game Development Reference
In-Depth Information
You'll compile NanoGL as a static library within the Quake project so that it can be reused by
other engines, such as Quake II, in Chapter 7. Now let's take a look at the changes required
to get the engine going.
Quake for Android Architecture
NanoGL allows you to reuse about 90% of the renderer with no changes and about 95% of
the entire engine. Figure 6-1 shows the architecture of this app. The light boxes represent thin
Java wrapper classes. The darker box is the C engine where most of the work will take place.
Figure 6-1. Quake for Android architecture
In the following sections, you'll learn how to create a nimble Java OpenGL renderer for
Quake. Next, you'll see how to handle audio independently of the format and how to provide
support for keyboard and multi-touch events. But first, let's see how the rendering works.
Java OpenGL Renderer Architecture
Android provides the built-in classes GLSurfaceView and GLSurfaceView.Renderer , which
you can extend for this implementation. These classes are very thin and their only job is to
provide a simple interface between the device and the native library. Listing 6-3 shows the
implementation.
The full source for the renderer is available from the topic source under ch06.Quake .
Tip
 
 
Search WWH ::




Custom Search